pub async fn get_decrease_spot_position_quote(
decrease_amount: u64,
collateral_token: u8,
leverage: f64,
slippage_tolerance_bps: Option<u16>,
position_token: u8,
position_amount: u64,
position_debt: u64,
mint_a: Pubkey,
mint_b: Pubkey,
fusion_pool: FusionPoolFacade,
tick_arrays: Option<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).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.fusion_pool: Fusion pool.tick_arrays: Optional five tick arrays around the current pool price. If not provided, the quote will be calculated using the Jupiter Aggregator.
§Returns
DecreaseSpotPositionQuoteResult: quote result