DCABuilder slippage parameter fix
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {uint32max, uint64max} from "@/misc.js";
|
||||
import {encodeIEE754} from "@/common.js";
|
||||
import {DEFAULT_SLIPPAGE} from "@/orderbuild.js";
|
||||
|
||||
export const MAX_FRACTION = 65535;
|
||||
export const NO_CONDITIONAL_ORDER = uint64max;
|
||||
@@ -86,6 +87,10 @@ export function newTranche({
|
||||
if( marketOrder ) {
|
||||
if (minIntercept !== 0 || minSlope !== 0 || maxIntercept !== 0 || maxSlope !== 0)
|
||||
console.warn('Ignoring line information in a market order')
|
||||
if (slippage === 0) {
|
||||
console.warn(`setting market order slippage to ${DEFAULT_SLIPPAGE}`)
|
||||
slippage = DEFAULT_SLIPPAGE
|
||||
}
|
||||
minIntercept = encodeIEE754(slippage) // this is the slippage field for market orders
|
||||
minSlope = 0
|
||||
maxIntercept = 0
|
||||
|
||||
Reference in New Issue
Block a user