Function jet_margin::jet_margin::register_position
source · [−]pub fn register_position(
ctx: Context<'_, '_, '_, '_, RegisterPosition<'_>>
) -> Result<()>
Expand description
Register a position for deposits of tokens returned by adapter programs (e.g. margin-pool).
This will create a token account to hold the adapter provided tokens which represent a user’s deposit with that adapter.
This instruction may fail if the account has reached it’s maximum number of positions.
Accounts
Name | Type | Description |
authority | signer | The authority that can change the margin account. |
payer | signer | The address paying for rent. |
margin_account | writable | The margin account to register position type with. |
position_token_mint | read_only | The mint for the position token being registered. |
metadata | read_only | The metadata account that references the correct oracle for the token. |
token_account | writable | The token account to store hold the position assets in the custody of the margin account. |
token_program | read_only | The spl token program. |
rent | read_only | The rent sysvar. The rent to open the account. |
system_program | read_only | The system native program. |
Events
Event Name | Description |
events::PositionRegistered | Marks the registration of the position. |