Namespace: instructions
Functions
burnWriterForQuote
▸ Const
burnWriterForQuote(program
, size
, optionMarket
, writerTokenSrc
, writerQuoteDest
): TransactionInstruction
Burn WriterTokens to get the size * OptionMarket.quoteAmountPerContract
from the OptionMarket's quote asset pool. This instruction will fail if no one has exercised or the quote assets in the pool have already been claimed.
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for Psy American |
|
| The amount of WriterTokens to burn and retrieve the quote assets for |
| The deserialized OptionMarket data | |
|
| The SPL Token account that holds the WriterTokens |
|
| SPL Token account that is the destination for the quote assets |
Returns
TransactionInstruction
Defined in
instructions/burnWriterForQuote.ts:18
closePositionInstruction
▸ Const
closePositionInstruction(program
, size
, optionMarket
, writerTokenSrc
, optionTokenSrc
, underlyingAssetDest
): TransactionInstruction
Close size option positions by burning the OptionTokens and WriterTokens.
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for Psy American |
|
| The amount of OptionTokens and WriterTokens to burn |
| The OptionMarket the OptionTokens and WriterTokens belong to | |
|
| The SPL Token address that holds the WriterTokens |
|
| The SPL Token address that holds the OptionTokens |
|
| The SPL Token address destination for the returned underlying assets |
Returns
TransactionInstruction
Defined in
instructions/closePosition.ts:17
closePostExpirationInstruction
▸ Const
closePostExpirationInstruction(program
, size
, optionMarket
, writerTokenSrc
, underlyingAssetDest
): TransactionInstruction
After a market has expired, burn WriterTokens to get the underlying assets back from the contract(s).
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for Psy American |
|
| The amount of options to exercise |
| The OptionMarket data from the chain for the options to exercise | |
|
| The SPL Token address holding the WriterTokens |
|
| The SPL Token address where the underlying assets will be sent |
Returns
TransactionInstruction
Defined in
instructions/closePostExpiration.ts:17
exerciseOptionsInstruction
▸ Const
exerciseOptionsInstruction(program
, size
, optionMarket
, exerciserOptionTokenSrc
, underlyingAssetDest
, quoteAssetSrc
, opts?
): Promise
<TransactionInstruction
>
Exercise OptionTokens you're holding
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for Psy American |
|
| The amount of options to exercise |
| The OptionMarket data from the chain for the options to exercise | |
|
| The SPL Token address holding the OptionTokens |
|
| The SPL Token address where the underlying assets will be sent |
|
| The SPL Token address holding the quote asset used to exercise |
|
| |
|
| The authority account that owns the options |
Returns
Promise
<TransactionInstruction
>
Defined in
instructions/exerciseOptions.ts:21
exerciseOptionsV2Instruction
▸ Const
exerciseOptionsV2Instruction(program
, size
, optionMarket
, exerciserOptionTokenSrc
, underlyingAssetDest
, quoteAssetSrc
, opts?
): TransactionInstruction
Exercise OptionTokens you're holding without fees!
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for Psy American |
|
| The amount of options to exercise |
| The OptionMarket data from the chain for the options to exercise | |
|
| The SPL Token address holding the OptionTokens |
|
| The SPL Token address where the underlying assets will be sent |
|
| The SPL Token address holding the quote asset used to exercise |
|
| |
|
| The authority account that owns the options |
Returns
TransactionInstruction
Defined in
instructions/exerciseOptions.ts:85
initializeMarket
▸ Const
initializeMarket(program
, __namedParameters
): Promise
<Object
>
Initialize a new OptionMarket
Parameters
Name | Type | Description |
---|---|---|
|
| The Psy American program |
|
| - |
|
| The option market expiration timestamp in seconds |
|
| The quote amount per contract for the OptionMarket Strike price is derived from underlyingAmountPerContract & quoteAmountPerContract |
|
| The quote asset mint |
|
| The underlying amount per contract for the OptionMarket. * Strike price is derived from underlyingAmountPerContract & quoteAmountPerContract |
|
| The underlying mint address |
Returns
Promise
<Object
>
Defined in
instructions/initializeMarket.ts:30
initializeSerumMarket
▸ Const
initializeSerumMarket(program
, __namedParameters
): Promise
<Object
>
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Psy American Program |
|
| - |
|
| The address for the new Serum market's asks |
|
| The address for the new Serum market's bids |
|
| The address for the new Serum market's eventual Event Queue |
|
| The OptionMarket address that owns the OptionToken mint |
|
| The OptionToken's Mint address. This is the base token for the Serum market |
|
| Serum market's dust threshold for the price currency |
|
| Serum market's price currency lot size |
|
| The Serum's price currency mint |
|
| The Serum DEX program ID |
Returns
Promise
<Object
>
Defined in
instructions/initializeSerumMarket.ts:22
mintOptionInstruction
▸ Const
mintOptionInstruction(program
, minterOptionAcct
, minterWriterAcct
, minterUnderlyingAccount
, size
, optionMarket
): Promise
<Object
>
Create a TransactionInstruction for minting size option contracts
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for the PsyAmerican program and the minter as the provider wallet |
|
| Where the OptionTokens will be sent |
|
| Where the WriterTokens will be sent |
|
| Where the underlying asset tokens come from |
|
| The amount of contracts to mint |
| The OptionMarket data |
Returns
Promise
<Object
>
Defined in
instructions/mintOptions.ts:92
mintOptionV2Instruction
▸ Const
mintOptionV2Instruction(program
, minterOptionAcct
, minterWriterAcct
, minterUnderlyingAccount
, size
, optionMarket
): Promise
<Object
>
Create a TransactionInstruction for minting size option contracts using V2 instruction
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for the PsyAmerican program and the minter as the provider wallet |
|
| Where the OptionTokens will be sent |
|
| Where the WriterTokens will be sent |
|
| Where the underlying asset tokens come from |
|
| The amount of contracts to mint |
| The OptionMarket data |
Returns
Promise
<Object
>
Defined in
instructions/mintOptions.ts:156
mintOptionsTx
▸ Const
mintOptionsTx(program
, minterOptionAcct
, minterWriterAcct
, minterUnderlyingAccount
, size
, optionMarket
): Promise
<Object
>
Execute a transaction to mint size options
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for the PsyAmerican program and the minter as the provider wallet |
|
| Where the OptionTokens will be sent |
|
| Where the WriterTokens will be sent |
|
| Where the underlying asset tokens come from |
|
| The amount of contracts to mint |
| The OptionMarket data |
Returns
Promise
<Object
>
Defined in
Last updated