orderbuilding fixes for new line price semantics
This commit is contained in:
@@ -136,9 +136,6 @@ function buildTranches() {
|
||||
const lb = _endpoints.value[1]
|
||||
const ws = weights.value
|
||||
const symbol = co.selectedSymbol
|
||||
const inverted = symbol.inverted
|
||||
const scale = 10 ** -symbol.decimals
|
||||
const isMinimum = inverted === order.buy
|
||||
for (let i = 0; i < ws.length; i++) {
|
||||
const w = ws[i]
|
||||
const t = newTranche({fraction: w * MAX_FRACTION})
|
||||
@@ -153,15 +150,7 @@ function buildTranches() {
|
||||
// console.log('tranche start/end',
|
||||
// t.startTime === DISTANT_PAST ? 'PAST' : t.startTime,
|
||||
// t.endTime === DISTANT_FUTURE ? 'FUTURE' : t.endTime)
|
||||
if (inverted) {
|
||||
// invert prices
|
||||
line[1] = 1/line[1]
|
||||
line[3] = 1/line[3]
|
||||
}
|
||||
// scale to pool decimals
|
||||
line[1] *= scale
|
||||
line[3] *= scale
|
||||
applyLinePoints(t, isMinimum, ...line)
|
||||
applyLinePoints(t, symbol, order.buy, ...line)
|
||||
tranches.push(t)
|
||||
}
|
||||
return tranches
|
||||
|
||||
Reference in New Issue
Block a user