Enum psyoptions::instruction::OptionsInstruction[][src]

#[repr(C)]
pub enum OptionsInstruction {
    InitializeMarket {
        underlying_amount_per_contract: u64,
        quote_amount_per_contract: u64,
        expiration_unix_timestamp: UnixTimestamp,
        bump_seed: u8,
    },
    MintCoveredCall {},
    ExerciseCoveredCall {},
    ClosePostExpiration {},
    ClosePosition {},
    ExchangeWriterTokenForQuote {},
}
Expand description

Instructions supported by the Options program

Variants

InitializeMarket

Initializes a new OptionMarket

Accounts expected by this instruction:

  1. [] Underlying Asset Mint
  2. [] Quote Asset Mint
  3. [writeable] Option Mint (uninitialized)
  4. [writeable] Writer Token Mint (uninitialized)
  5. [writeable] Option Market
  6. [] Option Mint Authority
  7. [writeable] Underlying Asset Pool (uninitialized)
  8. [writeable] Quote Asset Pool (uninitialized)
  9. [] Fee Owner Account - should match declaration in fees.rs
  10. [] Mint Fee Key - An SPL Token account that recieves fees in the underlying asset
  11. [] Rent Sysvar
  12. [] SPL Token Program Account
  13. [] System Program
  14. [] SPL Associated Token Program Account
Show fields

Fields of InitializeMarket

underlying_amount_per_contract: u64

The amount of the underlying asset that derives a single contract

quote_amount_per_contract: u64

Pre-computed quote amount for the new market, equal to strike price * amount_per_contract

expiration_unix_timestamp: UnixTimestamp

The Unix timestamp at which the contracts in this market expire

bump_seed: u8

Bump Seed for the Program Derived Address

MintCoveredCall

Mints an Options token to represent a Covered Call

  1. [writeable] Funding Account
  2. [writeable] Option Mint
  3. [writeable] Destination account for minted Option
  4. [writeable] Writer Token Mint
  5. [writeable] Destination account for minted Writer Token
  6. [writeable] Source account for OptionWriter’s underlying asset
  7. [writeable] Destination account for underlying asset pool
  8. [writeable] OptionMarket data account
  9. [writeable] Mint fee account (associated token address derived from the fee_owner_key)
  10. [] Fee owner key
  11. [signer] Authority account for underlying asset source
  12. [] SPL Token Program
  13. [] Program Derived Address for the authority over the Option Mint
  14. [] SysVar clock account
  15. [] System Program account
Show fields

Fields of MintCoveredCall

ExerciseCoveredCall

Exercise an Options token representing a Covered Call

  1. [] Sysvar clock
  2. [] SPL Token Program
  3. [] Option Market
  4. [writeable] Exerciser Quote Asset Source
  5. [signer] Exerciser Authority
  6. [writeable] Exerciser Underlying Asset Source
  7. [writeable] Underlying Asset Pool
  8. [writeable] Quote Asset Pool
  9. [] Option Mint Authority
  10. [writeable] Option Mint
  11. [writeable] Option Token Account
  12. [signer] Option Token Account Authority
Show fields

Fields of ExerciseCoveredCall

ClosePostExpiration

Close a single option contract post expiration. Transfers the underlying asset back to the Option Writer

  1. [] Option Market
  2. [] Option Mint
  3. [] Option Mint Authority
  4. [writeable] Writer Token Mint
  5. [writeable] Writer Token Source (to be burned)
  6. [signer] Writer Token Source Authority
  7. [writeable] Option Writer Underlying Asset Destination
  8. [writeable] Underlying Asset Pool
  9. [] Sysvar clock
  10. [] SPL Token Program
Show fields

Fields of ClosePostExpiration

ClosePosition

Close a single option contract prior to expiration. Burns the option token and the writer token and returns the underlying asset back to the writer (or address specified).

  1. [] SPL Token porgram
  2. [] Option Market
  3. [writable] Option Mint
  4. [] Option Mint Authority
  5. [writable] Option Token Source
  6. [signer] Option Token Source Authority
  7. [writable] Writer Token Mint
  8. [writable] Writer Token Source
  9. [] Writer Token Source Authority
  10. [writable] Underlying Asset Destination
  11. [writable] Underlying Asset Pool
Show fields

Fields of ClosePosition

ExchangeWriterTokenForQuote

Allow a user to exchange their Writer Token for Quote Asset. Burns the Writer Token and transfers the Quote Asset amount relative to the option market

  1. [] Option Market
  2. [] Option Mint
  3. [] Option Market Authority
  4. [writeable] Writer Token Mint
  5. [writeable] Writer Token Source (to be burned)
  6. [signer] Writer Token Source Authority
  7. [writeable] Quote Asset Destination
  8. [writeable] Quote Asset Pool
  9. [] SPL token program
Show fields

Fields of ExchangeWriterTokenForQuote

Implementations

Unpacks a byte buffer into a TokenInstruction.

Packs a OptionInstruction into a byte buffer.

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.