order building fixes

This commit is contained in:
Tim
2024-03-27 16:11:12 -04:00
parent fb82f23d88
commit 204c63f1b9
3 changed files with 10 additions and 20 deletions

View File

@@ -80,8 +80,8 @@ function buildOrder() {
// }
const symbol = co.selectedSymbol
const fee = co.selectedPool[1]
const tokenIn = order.buy ^ symbol.inverted ? symbol.quote : symbol.base
const tokenOut = order.buy ^ symbol.inverted ? symbol.base : symbol.quote
const tokenIn = order.buy ? symbol.quote : symbol.base
const tokenOut = order.buy ? symbol.base : symbol.quote
const amountDec = order.amountIsTokenA ? symbol.base.d : symbol.quote.d
const amount = BigInt(Math.trunc(order.amount * 10 ** amountDec))
const amountIsInput = !!(order.amountIsTokenA ^ order.buy)