pub fn accounting_invoke<'info>(
    ctx: Context<'_, '_, '_, 'info, AccountingInvoke<'info>>,
    data: Vec<u8>
) -> Result<()>
Expand description

Perform an action by invoking other programs, allowing them only to refresh the state of the margin account to be consistent with the actual underlying prices or positions, but not permitting new position changes.

This is a permissionless way of updating the value of positions on a margin account which require some adapter to provide the update. Unlike adapter_invoke, this instruction will not provider the margin account as a signer to invoked programs, and they thefore do not have authority to modify any token balances held by the account.

All extra accounts passed in are used as the input accounts when invoking the provided adapter porgram.

Parameters

  • data - The instruction data to pass to the adapter program

Accounts

NameTypeDescription
margin_accountwritableThe margin account to proxy an action for.
adapter_programread_onlyThe program to be invoked.
adapter_metadataread_onlyThe metadata about the proxy program.

Events

NameDescription
events::AccountingInvokeBeginSignify that the accounting invocation process has begun.
events::PositionEvent (Note that each single event represents an different adapter position)The PositionEvent marks the change in position.
events::AccountingInvokeEndSignify that the accounting invocation process has ended.