Skip to main content

borrow

Function borrow 

Source
pub fn borrow(
    owner: Pubkey,
    borrow_reserve: &ReserveInfo,
    obligation: &ObligationInfo,
    obligation_reserves: &[ReserveInfo],
    user_destination_liquidity: Pubkey,
    liquidity_amount: u64,
    farms: Option<&FarmsAccounts>,
) -> Vec<Instruction>
Expand description

Build instructions to borrow liquidity from a reserve against an obligation.

obligation_reserves should contain ReserveInfo for every deposit and borrow reserve on the obligation. Any reserves not already refreshed by this helper are refreshed automatically so that refresh_obligation succeeds.

Returns: [refresh_other_reserves..., refresh_borrow_reserve, refresh_obligation, borrow_obligation_liquidity_v2]