Function jet_margin::jet_margin::accounting_invoke
source · [−]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
Name | Type | Description |
margin_account | writable | The margin account to proxy an action for. |
adapter_program | read_only | The program to be invoked. |
adapter_metadata | read_only | The metadata about the proxy program. |
Events
Name | Description |
events::AccountingInvokeBegin | Signify 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::AccountingInvokeEnd | Signify that the accounting invocation process has ended. |