price handling fixes affecting orderbuild, pairprice, ordershapes, etc

This commit is contained in:
tim
2024-10-13 18:28:01 -04:00
parent 4b5626094a
commit fe8dd3ef6c
8 changed files with 16 additions and 17 deletions

View File

@@ -68,7 +68,7 @@ class TrancheShapes {
* 10 ** -(amountIsBase ? this.symbol.base.d : this.symbol.quote.d)
const weight = Number(filledAmount) / Number(this.status.order.amount)
const amountSymbol = amountIsBase ? this.symbol.base.s : this.symbol.quote.s
console.log('fillpoint', buy, filledAmount, this.status.order, this.symbol)
// console.log('fillpoint', buy, filledAmount, this.status.order, this.symbol)
const time = f.time
const out = Number(f.filledOut) / (1-this.status.order.route.fee/1000000)
let price = out / Number(f.filledIn)
@@ -89,7 +89,7 @@ class TrancheShapes {
const symbol = this.symbol
const scale = 10**symbol.decimals;
const buy = status.order.tokenIn === this.symbol.quote.a
const inverted = buy === symbol.inverted
const inverted = buy
amount = Number(amount)
* 10 ** -(buy ? this.symbol.base.d : this.symbol.quote.d)
const amountSymbol = buy ? this.symbol.base.s : this.symbol.quote.s