pub fn close_glv_deposit<'info>(
ctx: Context<'_, '_, 'info, 'info, CloseGlvDeposit<'info>>,
reason: String,
) -> Result<()>Expand description
Close GLV deposit.
§Accounts
See the documentation for the accounts.
§Arguments
reason: The reason for closing the GLV deposit.
§Errors
- The
executormust be a signer, and must be either the owner of the GLV deposit or aORDER_KEEPERin the store - The
storemust be properly initialized - The
ownermust be the owner of the GLV deposit - The
glv_depositmust be:- Properly initialized
- Owned by the
ownerandstore - In cancelled or executed state if the
executoris not theowner
- Token mint account requirements:
- All tokens must be valid and recorded in the
glv_deposit initial_long_tokenmust be provided if initial long amount > 0initial_short_tokenmust be provided if initial short amount > 0
- All tokens must be valid and recorded in the
- Escrow account requirements:
- Must correspond to their respective tokens
- Must be owned by the
glv_deposit - Must be recorded in the
glv_deposit
- The addresses of the ATAs must be valid associated token addresses derived from the respective tokens and
owner - All token programs must match their corresponding token accounts