Workarounds for #41 and #39

This commit is contained in:
7400
2023-11-15 09:31:20 -08:00
parent 34b579f204
commit 0098d7f29f
2 changed files with 3 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ const price = computed(()=>{
let p = s.poolPrices[route.pool]
if( !p )
return ''
p = Number(p) // TODO: Temporary workaround. Better to fix reason for p being set to string.
console.log('pool price is',p)
if( props.inverted )
p = 1/p

View File

@@ -283,7 +283,8 @@ function placeOrder() {
priceConstraint = !limitPrice.value ? null : newLimitConstraint(isAbove, isRatio, limit)
}
for (let i = 0; i < n; i++) {
const start = Math.floor(i * (duration / (n-1)))
// const start = Math.floor(i * (duration / (n - 1)))
const start = Math.floor(i * (duration / Math.max((n - 1), 1)))
const end = start + window
console.log('tranche window', start, end, (end-start)/60)
const cs = [newTimeConstraint(TimeMode.SinceOrderStart, start, TimeMode.SinceOrderStart, end)]