symbol rework; fee % switching; symbol search improvements

This commit is contained in:
tim
2024-10-11 00:26:29 -04:00
parent 6d19adb130
commit 5b23864c2e
11 changed files with 233 additions and 178 deletions

View File

@@ -60,6 +60,7 @@ import RowBar from "@/components/chart/RowBar.vue";
import ColorBand from "@/components/chart/ColorBand.vue";
import Color from "color";
import {Exchange, newOrder} from "@/blockchain/orderlib.js";
import {lookupSymbol} from "@/charts/datafeed.js";
const props = defineProps(['order'])
const s = useStore()
@@ -112,7 +113,6 @@ function buildOrder() {
// Tranche[] tranches;
// }
const symbol = co.selectedSymbol
const fee = co.selectedPool[1]
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)
@@ -125,7 +125,7 @@ function buildOrder() {
tranches = [...tranches, ...ts]
}
return newOrder(tokenIn.value.a, tokenOut.value.a, Exchange.UniswapV3, fee, amount, amountIsInput, tranches)
return newOrder(tokenIn.value.a, tokenOut.value.a, symbol.exchangeId, symbol.fee, amount, amountIsInput, tranches)
}