orderbuilding fixes for new line price semantics
This commit is contained in:
@@ -151,10 +151,12 @@ export function parseOrderStatus(chainId, status) {
|
||||
filledIn = BigInt(filledIn)
|
||||
filledOut = BigInt(filledOut)
|
||||
trancheStatus = trancheStatus.map((obj)=>parseTrancheStatus(obj))
|
||||
return {
|
||||
const result = {
|
||||
chainId, order, fillFeeHalfBps, state, startTime, startPrice, ocoGroup,
|
||||
filledIn, filledOut, trancheStatus,
|
||||
}
|
||||
};
|
||||
console.log('SwapOrderStatus', result)
|
||||
return result
|
||||
}
|
||||
|
||||
function parseTrancheStatus(obj) {
|
||||
@@ -205,20 +207,18 @@ export function parseTranche(tranche) {
|
||||
rateLimitPeriod,
|
||||
startTime,
|
||||
endTime,
|
||||
minIntercept,
|
||||
minSlope,
|
||||
maxIntercept,
|
||||
maxSlope,
|
||||
minLine,
|
||||
maxLine,
|
||||
] = tranche
|
||||
minIntercept = decodeIEE754(minIntercept)
|
||||
minSlope = decodeIEE754(minSlope)
|
||||
maxIntercept = decodeIEE754(maxIntercept)
|
||||
maxSlope = decodeIEE754(maxSlope)
|
||||
return {
|
||||
minLine = {intercept: minLine.intercept, slope: minLine.slope }
|
||||
maxLine = {intercept: maxLine.intercept, slope: maxLine.slope }
|
||||
const result = {
|
||||
fraction, startTimeIsRelative, endTimeIsRelative, minIsBarrier, maxIsBarrier, marketOrder,
|
||||
minIsRatio, maxIsRatio, rateLimitFraction, rateLimitPeriod,
|
||||
startTime, endTime, minIntercept, minSlope, maxIntercept, maxSlope,
|
||||
startTime, endTime, minLine, maxLine,
|
||||
}
|
||||
console.log('parseTranche', tranche, result)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user