pub struct OpenPerpArgs {
/// Long or Short.
pub side: Side,
/// Taken from the account's deposits, in the pool's quote token.
pub margin: u64,
/// Drawn from Lend: the quote token for a long, the base token for a short.
pub borrow: u64,
/// The least the opening swap must return.
pub min_out: u64,
}
open_range
pub struct OpenRangeArgs {
pub tick_lower: i32,
pub tick_upper: i32,
/// Margin taken from the account's deposits, per pool token.
pub margin_base: u64,
pub margin_quote: u64,
/// Borrowed from Lend, per pool token. Zero for an unleveraged range.
pub borrow_base: u64,
pub borrow_quote: u64,
/// The least liquidity the range must mint.
pub min_liquidity: u128,
}
Every instruction that reads a reserve first brings its indexes up to the current slot, so a transaction never needs a separate refresh step and always sees current debt.