add param to deriveMarketOrderParams
This commit is contained in:
@@ -992,6 +992,8 @@ export const mapToMarketOrderParams = async (
|
|||||||
appliedV2Adjustment: false,
|
appliedV2Adjustment: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let conditionalParams = {};
|
||||||
|
|
||||||
if (driftClient && fetchFromRedis && selectMostRecentBySlot) {
|
if (driftClient && fetchFromRedis && selectMostRecentBySlot) {
|
||||||
// Get L2 orderbook data using the utility function
|
// Get L2 orderbook data using the utility function
|
||||||
const redisL2 = await fetchL2FromRedis(
|
const redisL2 = await fetchL2FromRedis(
|
||||||
@@ -1033,6 +1035,13 @@ export const mapToMarketOrderParams = async (
|
|||||||
oraclePrice
|
oraclePrice
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO - apply this to all apiVersions once testing is complete.
|
||||||
|
conditionalParams = {
|
||||||
|
ensureCrossingEndPrice: true,
|
||||||
|
bestBidPrice: spreadInfo.bestBidPrice,
|
||||||
|
bestAskPrice: spreadInfo.bestAskPrice,
|
||||||
|
};
|
||||||
|
|
||||||
const isCrossed =
|
const isCrossed =
|
||||||
spreadInfo.bestBidPrice &&
|
spreadInfo.bestBidPrice &&
|
||||||
spreadInfo.bestAskPrice &&
|
spreadInfo.bestAskPrice &&
|
||||||
@@ -1295,6 +1304,7 @@ export const mapToMarketOrderParams = async (
|
|||||||
additionalEndPriceBuffer,
|
additionalEndPriceBuffer,
|
||||||
forceUpToSlippage: params.forceUpToSlippage,
|
forceUpToSlippage: params.forceUpToSlippage,
|
||||||
userOrderId: params.userOrderId,
|
userOrderId: params.userOrderId,
|
||||||
|
...conditionalParams,
|
||||||
},
|
},
|
||||||
estimatedPrices,
|
estimatedPrices,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user