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) { function parseFill(obj) {
let [tx, time, filledIn, filledOut, fee] = obj let [tx, time, filledIn, filledOut, fee] = obj
time = new Date(time * 1000) // time = new Date(time * 1000)
filledIn = BigInt(filledIn) filledIn = BigInt(filledIn)
filledOut = BigInt(filledOut) filledOut = BigInt(filledOut)
const filled = obj.amountIsInput ? filledIn : 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 baseUrl
let latest = null // latest time, price let latest = null // latest time, price
function fill(end, period) { function fill(end) {
const period = res.seconds
if (latest===null) return if (latest===null) return
const [latestTime, price] = latest const [latestTime, price] = latest
end = ohlcStart(end, period) end = ohlcStart(end, period)
@@ -206,6 +207,8 @@ export async function loadOHLC (symbol, contract, from, to, tvRes) {
const rows = responses[ri].split('\n') const rows = responses[ri].split('\n')
for( let rj=0; rj<rows.length; rj++) { for( let rj=0; rj<rows.length; rj++) {
const line = rows[rj]; const line = rows[rj];
if (line.trim().length === 0)
continue
const row = line.split(',') const row = line.split(',')
let time, open, high, low, close=null let time, open, high, low, close=null
switch (row.length) { switch (row.length) {
@@ -263,17 +266,19 @@ export async function loadOHLC (symbol, contract, from, to, tvRes) {
break break
} }
if ( time >= from ) { if ( time >= from ) {
fill(time, res.seconds) if ( latest !== null && time > latest[0] + res.seconds) {
fill(time)
}
const bar = {time: time * 1000, open, high, low, close}; const bar = {time: time * 1000, open, high, low, close};
bars.push(bar) bars.push(bar)
latest = [time, close] latest = [time, close]
} }
} }
} }
console.log(`processed ${lineNum} lines`) // console.log(`processed ${lineNum} lines`)
} }
// console.log('loadOHLC prefill bars', bars) // console.log('loadOHLC prefill bars', bars)
fill(to, res.seconds) fill(to)
// console.log('loadOHLC bars', bars) // console.log('loadOHLC bars', bars)
return bars return bars
} }

View File

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

View File

@@ -16,6 +16,7 @@ function pulse() {
if (props.touch === lastValue) return if (props.touch === lastValue) return
lastValue = props.touch lastValue = props.touch
const e = element.value; const e = element.value;
if (!e) return
if (!e.classList.contains('pulse')) { if (!e.classList.contains('pulse')) {
// add class for the first time // add class for the first time
e.classList.add('pulse') 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 class="text-center">Last Updated November 18, 2024</v-card-text>
<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 use of the
website (and all subdomains and subpages thereon) located at dexorder.trade, including without limitation 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 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 (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 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 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 (<b>Execution Policy</b>), however from time to time the Site and the Dexorder Service may be inaccessible or
inoperable for any inoperable for any
reason, including, without limitation: (a) if an Interaction repeatedly fails to be executed (such as due to an 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"/> <toolbar-button tooltip="Assets" icon="mdi-currency-btc" route="Assets"/>
<!-- mdi-format-list-checks mdi-format-list-bulleted-square --> <!-- mdi-format-list-checks mdi-format-list-bulleted-square -->
<toolbar-button tooltip="Status" icon="mdi-format-list-checks" route="Status"/> <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>
</div> </div>
</template> </template>

View File

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