Function calculateTargetPriceTrade

  • calculateTargetPriceTrade simple function for finding arbitraging trades

    Deprecated

    Returns

    trade direction/size in order to push price to a targetPrice,

    [ direction => direction of trade required, PositionDirection tradeSize => size of trade required, TODO-PRECISION entryPrice => the entry price for the trade, PRICE_PRECISION targetPrice => the target price PRICE_PRECISION ]

    Parameters

    • market: PerpMarketAccount
    • targetPrice: BN
    • pct: BN = MAXPCT

      optional default is 100% gap filling, can set smaller.

    • outputAssetType: AssetType = 'quote'

      which asset to trade.

    • Optional oraclePriceData: OraclePriceData
    • useSpread: boolean = true

      whether or not to consider the spread when calculating the trade size

    Returns [PositionDirection, BN, BN, BN]

Generated using TypeDoc