This commit is contained in:
tim
2025-02-21 23:37:29 -04:00
parent 366531c185
commit 2397ebfe45
7 changed files with 17 additions and 15 deletions

View File

@@ -164,7 +164,7 @@ export function parseOrderStatus(chainId, status) {
function parseFill(obj) {
let [tx, time, filledIn, filledOut, fee] = obj
time = new Date(time * 1000)
// time = new Date(time * 1000)
filledIn = BigInt(filledIn)
filledOut = BigInt(filledOut)
const filled = obj.amountIsInput ? filledIn : filledOut

View File

@@ -144,7 +144,8 @@ export async function loadOHLC (symbol, contract, from, to, tvRes) {
let baseUrl
let latest = null // latest time, price
function fill(end, period) {
function fill(end) {
const period = res.seconds
if (latest===null) return
const [latestTime, price] = latest
end = ohlcStart(end, period)
@@ -206,6 +207,8 @@ export async function loadOHLC (symbol, contract, from, to, tvRes) {
const rows = responses[ri].split('\n')
for( let rj=0; rj<rows.length; rj++) {
const line = rows[rj];
if (line.trim().length === 0)
continue
const row = line.split(',')
let time, open, high, low, close=null
switch (row.length) {
@@ -262,18 +265,20 @@ export async function loadOHLC (symbol, contract, from, to, tvRes) {
finished = true
break
}
if (time >= from) {
fill(time, res.seconds)
if ( time >= from ) {
if ( latest !== null && time > latest[0] + res.seconds) {
fill(time)
}
const bar = {time: time * 1000, open, high, low, close};
bars.push(bar)
latest = [time, close]
}
}
}
console.log(`processed ${lineNum} lines`)
// console.log(`processed ${lineNum} lines`)
}
// console.log('loadOHLC prefill bars', bars)
fill(to, res.seconds)
fill(to)
// console.log('loadOHLC bars', bars)
return bars
}

View File

@@ -38,15 +38,13 @@ function pairPrice(chainId, baseToken, quoteToken, price) {
if (price === null || price === undefined)
return null
const decimals = quoteToken.d - baseToken.d
// console.log('pairPrice', chainId, baseToken, quoteToken, price, decimals)
if (decimals >= 0)
price /= 10 ** decimals
else
price *= 10 ** -decimals
// console.log('adjusted pairPrice', price)
if (inversionPreference(chainId, baseToken, quoteToken))
const pref = inversionPreference(chainId, baseToken, quoteToken);
if (pref)
price = 1 / price
// console.log('inverted?', price)
return price
}

View File

@@ -16,6 +16,7 @@ function pulse() {
if (props.touch === lastValue) return
lastValue = props.touch
const e = element.value;
if (!e) return
if (!e.classList.contains('pulse')) {
// add class for the first time
e.classList.add('pulse')

View File

@@ -5,7 +5,7 @@
<v-card-text class="text-center">Last Updated November 18, 2024</v-card-text>
<v-card-text>
Please read these Terms of Service (the <b>Terms</b>) and our Privacy Policy carefully because they govern your
Please read these Terms of Service (the <b>Terms</b>) and our <a href="https://dexorder.trade/privacy-policy" target="dexorder">Privacy Policy</a> carefully because they govern your
use of the
website (and all subdomains and subpages thereon) located at dexorder.trade, including without limitation the
subdomains app.dexorder.trade and www.dexorder.trade (collectively, the <b>Site</b>), and the Dexorder web
@@ -205,7 +205,7 @@
(i) Subject to your compliance with these Terms, Dexorder will use its commercially
reasonable efforts to provide you with access to the Dexorder Service and to cause your Interactions to be
executed on the applicable DEX in accordance with Dexorders Execution Policy located at
<a href="https://dexorder.trade/home/execution_policy">https://dexorder.trade/home/execution_policy</a>
<a href="https://dexorder.trade/execution-policy">https://dexorder.trade/execution-policy</a>
(<b>Execution Policy</b>), however from time to time the Site and the Dexorder Service may be inaccessible or
inoperable for any
reason, including, without limitation: (a) if an Interaction repeatedly fails to be executed (such as due to an

View File

@@ -9,7 +9,7 @@
<toolbar-button tooltip="Assets" icon="mdi-currency-btc" route="Assets"/>
<!-- mdi-format-list-checks mdi-format-list-bulleted-square -->
<toolbar-button tooltip="Status" icon="mdi-format-list-checks" route="Status"/>
<toolbar-button tooltip="About" icon="mdi-information-outline" href="https://dexorder.trade/home" target="dexorder-help"/>
<toolbar-button tooltip="About" icon="mdi-information-outline" href="https://dexorder.trade/" target="dexorder"/>
</div>
</div>
</template>

View File

@@ -146,10 +146,8 @@ export function inversionPreference(chainId, base, quote) {
break // definitely inverted
}
}
console.log('inverted?', base, quote, preferInverted)
prefs.inverted[key] = preferInverted
}
// console.log('inversion preference', base, quote, prefs.inverted[key], inputInverted)
return prefs.inverted[key] !== inputInverted
}