post-order line draw improvements

This commit is contained in:
tim
2024-11-04 18:39:09 -04:00
parent cfcba95445
commit 28dd64b1cf
20 changed files with 140 additions and 106 deletions

View File

@@ -95,7 +95,7 @@ socket.on( 'of', (chainId, vault, orderIndex, filled)=>{
}
const status = s.orders[vault][orderIndex]
console.log('apply fills', status, filled)
// console.log('apply fills', status, filled)
let orderIn = 0n
let orderOut = 0n
@@ -107,7 +107,10 @@ socket.on( 'of', (chainId, vault, orderIndex, filled)=>{
const numOld = ts.fills.length;
for (let i=0; i<fills.length; i++) {
const fill = fills[i]
const [tx, time, fi, fo, fee] = fill
let [tx, time, fi, fo, fee] = fill
fi = BigInt(fi)
fo = BigInt(fo)
fee = BigInt(fee)
filledIn += fi
filledOut += fo
if (i<=numOld) {
@@ -124,8 +127,9 @@ socket.on( 'of', (chainId, vault, orderIndex, filled)=>{
orderIn += filledIn
orderOut += filledOut
}
status[7] = orderIn.toString()
status[8] = orderOut.toString()
status.filledIn = orderIn
status.filledOut = orderOut
status.filled = status.order.amountIsInput ? orderIn : orderOut
console.log('apply fills completed', status)
// console.log('apply fills completed', status)
})