Function calculateTradeSlippage

  • Calculates avg/max slippage (price impact) for candidate trade

    Deprecated

    use calculateEstimatedPerpEntryPrice instead

    Returns

    [pctAvgSlippage, pctMaxSlippage, entryPrice, newPrice]

    'pctAvgSlippage' => the percentage change to entryPrice (average est slippage in execution) : Precision PRICE_PRECISION

    'pctMaxSlippage' => the percentage change to maxPrice (highest est slippage in execution) : Precision PRICE_PRECISION

    'entryPrice' => the average price of the trade : Precision PRICE_PRECISION

    'newPrice' => the price of the asset after the trade : Precision PRICE_PRECISION

    Parameters

    Returns [BN, BN, BN, BN]

Generated using TypeDoc