bugfix for limit/diagonal tranche building

This commit is contained in:
tim
2025-04-01 13:48:59 -04:00
parent 0442b08623
commit 715a43c097
5 changed files with 10 additions and 13 deletions

View File

@@ -206,10 +206,11 @@ function buildTranches() {
if (endTime <= s.clock)
warnings.push(`Tranche already expired at ${new Date(endTime*1000)}`)
const t = newTranche({
marketOrder: true,
slippage: builder.slippage,
fraction: ws[i] * MAX_FRACTION,
startTime: ts[i],
endTime, // always give at least 60 seconds of window to execute
slippage: builder.slippage,
})
tranches.push(t)
}

View File

@@ -90,10 +90,6 @@ function buildTranches() {
let p = ps[i]
const w = ws[i]
const t = newTranche({
// todo start/end
// todo check expired
// if (endTime <= s.clock)
// warnings.push(`Tranche already expired at ${new Date(endTime*1000)}`)
fraction: w * MAX_FRACTION,
})
const symbol = co.selectedSymbol

View File

@@ -44,7 +44,7 @@ function buildTranches() {
warnings.push('Slippage will be set to the minimum of 0.01%')
const slip = Math.max(slippage.value, MIN_SLIPPAGE)
return {
tranches: [newTranche({slippage: slip / 100})],
tranches: [newTranche({marketOrder: true, slippage: slip / 100})],
warnings,
}
}