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
executor
must be a signer, and must be either the owner of the GLV deposit or aORDER_KEEPER
in the store - The
store
must be properly initialized - The
owner
must be the owner of the GLV deposit - The
glv_deposit
must be:- Properly initialized
- Owned by the
owner
andstore
- In cancelled or executed state if the
executor
is not theowner
- Token mint account requirements:
- All tokens must be valid and recorded in the
glv_deposit
initial_long_token
must be provided if initial long amount > 0initial_short_token
must 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