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

@@ -49,15 +49,14 @@ export const useChartOrderStore = defineStore('chart_orders', () => {
const orders = ref([defaultOrder]) // order models in UI format
const selectedOrder = ref(null)
const selectedSymbol = ref(null)
const selectedPool = ref(null)
const intervalSecs = ref(0)
const baseToken = computed(()=>selectedSymbol.value === null ? null : selectedSymbol.value.base)
const quoteToken = computed(()=>selectedSymbol.value === null ? null : selectedSymbol.value.quote)
const price = computed(() => {
if (!selectedPool.value || !selectedSymbol.value)
if (!selectedSymbol.value)
return null
const s = useStore()
let result = s.poolPrices[[s.chainId, selectedPool.value[0]]]
let result = s.poolPrices[[s.chainId, selectedSymbol.address]]
if (selectedSymbol.value.inverted)
result = 1 / result
return result
@@ -94,7 +93,7 @@ export const useChartOrderStore = defineStore('chart_orders', () => {
}
return {
chartReady, selectedSymbol, selectedPool, intervalSecs, baseToken, quoteToken, price,
chartReady, selectedSymbol, intervalSecs, baseToken, quoteToken, price,
orders, drawing, newOrder, removeOrder, resetOrders, meanRange,
}
})