get_decrease_spot_position_quote

Function get_decrease_spot_position_quote 

Source
pub fn get_decrease_spot_position_quote(
    decrease_amount: u64,
    collateral_token: u8,
    leverage: f64,
    reduce_only: bool,
    slippage_tolerance_bps: Option<u16>,
    position_token: u8,
    position_amount: u64,
    position_debt: u64,
    protocol_fee_rate: u16,
    protocol_fee_rate_on_collateral: u16,
    fusion_pool: FusionPoolFacade,
    tick_arrays: TickArrays,
) -> Result<DecreaseSpotPositionQuoteResult, CoreError>
Expand description

Spot position decrease quote

§Parameters

  • decrease_amount: Position total decrease size in the collateral_token.
  • collateral_token: Collateral token.
  • leverage: Leverage (1.0 or higher).
  • reduce_only: Only allow reducing the existing position.
  • slippage_tolerance_bps: An optional slippage tolerance in basis points. Defaults to the global slippage tolerance if not provided.
  • position_token: Token of the existing position.
  • position_amount: Existing position amount in the position_token.
  • position_debt: Existing position debt in the token opposite to the position_token.
  • protocol_fee_rate: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
  • protocol_fee_rate_on_collateral: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
  • fusion_pool: Fusion pool.
  • tick_arrays: Five tick arrays around the current pool price.

§Returns

  • DecreaseSpotPositionQuoteResult: quote result