order sanity checks

This commit is contained in:
tim
2025-03-16 21:15:00 -04:00
parent b9975cda10
commit 5876efe29f
11 changed files with 130 additions and 33 deletions

View File

@@ -81,6 +81,7 @@ function buildTranches() {
const order = props.order
const builder = props.builder
const tranches = []
const warnings = []
console.log('buildTranches', builder, order, tranches)
const ps = prices.value
@@ -90,6 +91,9 @@ function buildTranches() {
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
@@ -99,7 +103,7 @@ function buildTranches() {
}
if (!flipped.value)
tranches.reverse()
return tranches
return {tranches, warnings}
}