order execution bugfixes
This commit is contained in:
@@ -96,7 +96,7 @@ import {FixedNumber} from "ethers";
|
|||||||
import {pendOrder} from "@/blockchain/wallet.js";
|
import {pendOrder} from "@/blockchain/wallet.js";
|
||||||
|
|
||||||
const s = useStore()
|
const s = useStore()
|
||||||
const buy = ref(true)
|
const buy = ref(false)
|
||||||
let _tokenA = ref(s.tokens && s.tokens.length >= 1 ? s.tokens[0] : null)
|
let _tokenA = ref(s.tokens && s.tokens.length >= 1 ? s.tokens[0] : null)
|
||||||
let _tokenB = ref(s.tokens && s.tokens.length >= 2 ? s.tokens[1] : null)
|
let _tokenB = ref(s.tokens && s.tokens.length >= 2 ? s.tokens[1] : null)
|
||||||
const tokenA = computed({
|
const tokenA = computed({
|
||||||
@@ -140,10 +140,10 @@ const inverted = ref(false)
|
|||||||
const minPrice = ref(null)
|
const minPrice = ref(null)
|
||||||
const maxPrice = ref(null)
|
const maxPrice = ref(null)
|
||||||
const limitPrice = ref(null)
|
const limitPrice = ref(null)
|
||||||
const interval = ref(10)
|
const interval = ref(1)
|
||||||
const intervalIsTotal = ref(true)
|
const intervalIsTotal = ref(true)
|
||||||
const timeUnits = ['minutes', 'hours', 'days']
|
const timeUnits = ['minutes', 'hours', 'days']
|
||||||
const timeUnitIndex = ref(1)
|
const timeUnitIndex = ref(0)
|
||||||
const limitIsMinimum = computed(() => !(buy.value ^ inverted.value))
|
const limitIsMinimum = computed(() => !(buy.value ^ inverted.value))
|
||||||
const validOrder = computed(()=>amount.value > 0 && routes.value.length > 0 )
|
const validOrder = computed(()=>amount.value > 0 && routes.value.length > 0 )
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ async function placeOrder() {
|
|||||||
const route = routes.value[0];
|
const route = routes.value[0];
|
||||||
const amountToken = amountIsTokenA ? ta : tb
|
const amountToken = amountIsTokenA ? ta : tb
|
||||||
const amt = FixedNumber.fromString(amount.value.toString(), {decimals: amountToken.decimals}).value
|
const amt = FixedNumber.fromString(amount.value.toString(), {decimals: amountToken.decimals}).value
|
||||||
const amountIsInput = amountIsTokenA.value === buy.value
|
const amountIsInput = amountIsTokenA.value !== buy.value
|
||||||
|
|
||||||
// build tranches
|
// build tranches
|
||||||
const n = tranches.value // num tranches
|
const n = tranches.value // num tranches
|
||||||
|
|||||||
Reference in New Issue
Block a user