underfunded

This commit is contained in:
tim
2025-03-03 22:06:55 -04:00
parent f5f53c6af4
commit 488e9f45f1

View File

@@ -71,12 +71,6 @@
</suspense>
</template>
<template v-slot:item.state="{ item }">
<!--
<v-chip v-if="item.state===PendingOrderState.Submitted || item.state===PendingOrderState.Signing"
prepend-icon="mdi-signature">Wallet Signing</v-chip>
<v-chip v-if="item.state===PendingOrderState.Rejected" prepend-icon="mdi-cancel">Rejected</v-chip>
<v-chip v-if="item.state===PendingOrderState.Sent" prepend-icon="mdi-send">Sent</v-chip>
-->
<v-chip v-if="item.state===OrderState.Open" class="d-none d-lg-inline-flex" prepend-icon="mdi-dots-horizontal"
color="green">Open
</v-chip>
@@ -90,14 +84,11 @@
</v-chip>
<v-chip v-if="item.state===OrderState.Expired" prepend-icon="mdi-progress-check" color="grey-darken-1">Partial
</v-chip>
<v-chip v-if="item.state===OrderState.Underfunded" prepend-icon="mdi-alert" color="warning">Underfunded</v-chip>
<v-chip v-if="item.state===OrderState.Underfunded" prepend-icon="mdi-alert" color="warning">Underfunded
<v-tooltip :text="`This order is underfunded. Add more ${item.inSymbol} to your vault.`" location="top" activator="parent"></v-tooltip>
</v-chip>
<v-chip v-if="item.state===OrderState.Error" prepend-icon="mdi-alert" color="error">Error</v-chip>
</template>
<!-- <template v-slot:item.action="{item}">-->
<!-- <btn v-if="item.state===OrderState.Open" icon="mdi-cancel" color="red"-->
<!-- @click="cancelOrder(vaultAddr,item.index)">Cancel-->
<!-- </btn>-->
<!-- </template>-->
<template v-slot:expanded-row="{item}">
<template v-for="(t, i) in item.order.tranches">
<tr>
@@ -187,6 +178,7 @@ import {lookupSymbol, tickerForOrder} from "@/charts/datafeed.js";
import {setSymbol} from "@/charts/chart.js";
import {uniswapV3AveragePrice} from "@/blockchain/uniswap.js";
import {timestampString} from "@/misc.js";
import {metadataMap} from "@/version.js";
const PairPrice = defineAsyncComponent(()=>import("@/components/PairPrice.vue"))
const TokenAmount = defineAsyncComponent(()=>import('./TokenAmount.vue'))
@@ -355,19 +347,21 @@ const orders = computed(()=>{
for (const st of result) {
let low, high;
// console.log('elab', st.order)
const buy = st.order.tokenIn > st.order.tokenOut;
const o = st.order;
const buy = o.tokenIn > o.tokenOut;
if (buy) {
low = st.order.tokenOut
high = st.order.tokenIn
low = o.tokenOut
high = o.tokenIn
}
else {
low = st.order.tokenIn
high = st.order.tokenOut
low = o.tokenIn
high = o.tokenOut
}
st.base = st.order.inverted ? high : low;
st.quote = st.order.inverted ? low : high;
st.minIsLimit = buy === st.order.inverted // whether limit/breakout is flipped
// console.log('buy/inverted/minIsLimit', buy, st.order.inverted, st.minIsLimit)
st.base = o.inverted ? high : low;
st.quote = o.inverted ? low : high;
st.minIsLimit = buy === o.inverted // whether limit/breakout is flipped
const found = metadataMap[st.chainId][o.tokenIn]
st.inSymbol = found ? found.s : o.tokenIn
// console.log('elaborated', st)
}
result.sort((a,b)=>b.startTime-a.startTime)