Module jet_margin::jet_margin
source · [−]Expand description
This crate documents the instructions used in the margin
program of the
jet-v2 repo.
Handler functions are described for each instruction well as struct parameters (and their types and descriptions are listed) and any handler function parameters aside from parameters that exist in every instruction handler function.
Accounts associated with events emitted for the purposes of data logging are also included.
Functions
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.
Perform an action by invoking other programs, allowing them to alter
the balances of the token accounts belonging to this margin account.
Allow governing address to transfer any position from one margin account to another
Close a user’s margin account
Close out a position, removing it from the account.
Set the configuration for an adapter.
Set the configuration for a liquidator.
Set the configuration for a token, which allows it to be used as a position in a margin
account.
Create a new margin account for a user
Create a new account for holding SPL token deposits directly by a margin account.
Begin liquidating an account
End the liquidation state for an account
Perform an action by invoking another program, for the purposes of
liquidating a margin account.
Refresh the price/balance for a deposit position
Update the config for a token position stored in the margin account,
in the case where the token config has changed after the position was
created.
Update the metadata for a position stored in the margin account,
in the case where the metadata has changed after the position was
created.
Register a position for deposits of tokens returned by adapter programs (e.g. margin-pool).
Transfer tokens into or out of a token account being used for deposits.
Update the balance of a position stored in the margin account to match the actual
stored by the SPL token account.
Verify that the account is healthy, by validating the collateralization
ration is above the minimum.