Accounts required by the ActivateVault instruction
Activates the vault and as part of that mints numberOfShares to the {@link ActivateVaultInstructionAccounts.fractionTreasury}.
Unless provided the {@link ActivateVaultInstructionAccounts.fractionMintAuthority}
is derived from the vault
key
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
[PREFIX, PROGRAM_ID, vault_address]
)Creates a ActivateVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Accounts required by the AddSharesToTreasury instruction
Creates a AddSharesToTreasury instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Accounts required by the AddTokenToInactiveVault instruction
Creates the instruction which adds tokens configured via the SafetyDepositSetup to the vault.
NOTE: the instructions to initialize that safety deposit box need to be added to a transaction to run prior to this instruction, see SafetyDepositSetup.instructions and SafetyDepositSetup.signers.
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
[PREFIX, PROGRAM_ID, vault_address]
)[PREFIX, PROGRAM_ID, vault_address, tokenAccount.mint]
)The account to hold the data is created and data allocated
created via SafetyDepositSetup.create
funding the transaction
authority of the vault
Advanced version to add tokens to inactive vault. It requires all {@link accounts} to be set up properly
Please {@see addTokenToInactiveVault} for a more intuitive way to set up this instruction and required accounts.
Creates a AddTokenToInactiveVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Accounts required by the CombineVault instruction
Combines the vault and as part of that mints numberOfShares to the {@link CombineVaultInstructionAccounts.fractionTreasury}.
The {@link CombineVaultInstructionAccounts.fractionBurnAuthority} is derived from the vault
key
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
[PREFIX, PROGRAM_ID, vault_address]
)totalMarketCap = fractionMint.supply * externalPricing.pricePerShare
storedMarketCap = fractionTreasury.amount * externalPricing.pricePerShare
circulatingMarketCap = totalMarketCap - storedMarketCap
yourShareValue = outstandingShares.amount * externalPricing.pricePerShare
whatYouOwe = circulatingMarketCap - yourShareValue
use CombineVaultSetup methods to prepare it
Creates a CombineVault instruction.
that will be accessed while the instruction is processed
Creates the external price account needed for the initVault
instruction.
It uses QUOTE_MINT as its priceMint
.
A VaultSetup that has been completed, meaning all necessary accounts were either provided or have been created and initialized.
Accounts required by the InitVault instruction
Creates a InitVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Initializes the Vault.
When setting up the vault accounts via VaultSetup methods those conditions will be met.
All accounts holding data need to be initialized and rent exempt.
[PREFIX, PROGRAM_ID, vault_address]
)[PREFIX, PROGRAM_ID, vault_address]
)[PREFIX, PROGRAM_ID, vault_address]
)[PREFIX, PROGRAM_ID, vault_address]
)set it up via VaultSetup methods
Accounts required by the MintFractionalShares instruction
Creates a MintFractionalShares instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Accounts required by the RedeemShares instruction
Creates a RedeemShares instruction.
that will be accessed while the instruction is processed
Accounts required by the SetAuthority instruction
Creates a SetAuthority instruction.
that will be accessed while the instruction is processed
Accounts required by the UpdateExternalPriceAccount instruction
Creates a UpdateExternalPriceAccount instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Accounts required by the WithdrawSharesFromTreasury instruction
Creates a WithdrawSharesFromTreasury instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Accounts required by the WithdrawTokenFromSafetyDepositBox instruction
Creates a WithdrawTokenFromSafetyDepositBox instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Same as ActivateVaultInstructionAccounts except doesn't require fractionalMintAuthority as that will be derived before passing them to createActivateVaultInstruction.
Arguments used to create ExternalPriceAccount
Arguments used to create SafetyDepositBox
Arguments used to create Vault
Accounts required by the ActivateVault instruction
Accounts required by the AddSharesToTreasury instruction
Accounts required by the AddTokenToInactiveVault instruction
Accounts required by the CombineVault instruction
A VaultSetup that has been completed, meaning all necessary accounts were either provided or have been created and initialized.
Accounts required by the InitVault instruction
Accounts required by the MintFractionalShares instruction
Accounts required by the RedeemShares instruction
Accounts required by the SetAuthority instruction
Accounts required by the UpdateExternalPriceAccount instruction
Accounts required by the WithdrawSharesFromTreasury instruction
Accounts required by the WithdrawTokenFromSafetyDepositBox instruction
Activates the vault and as part of that mints numberOfShares to the {@link ActivateVaultInstructionAccounts.fractionTreasury}.
Unless provided the {@link ActivateVaultInstructionAccounts.fractionMintAuthority}
is derived from the vault
key
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
[PREFIX, PROGRAM_ID, vault_address]
)Creates a ActivateVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a AddSharesToTreasury instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a AddTokenToInactiveVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a CombineVault instruction.
that will be accessed while the instruction is processed
Creates the external price account needed for the initVault
instruction.
It uses QUOTE_MINT as its priceMint
.
Creates a InitVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a MintFractionalShares instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a RedeemShares instruction.
that will be accessed while the instruction is processed
Creates a SetAuthority instruction.
that will be accessed while the instruction is processed
Creates a UpdateExternalPriceAccount instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a WithdrawSharesFromTreasury instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a WithdrawTokenFromSafetyDepositBox instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Initializes the Vault.
When setting up the vault accounts via VaultSetup methods those conditions will be met.
All accounts holding data need to be initialized and rent exempt.
[PREFIX, PROGRAM_ID, vault_address]
)[PREFIX, PROGRAM_ID, vault_address]
)[PREFIX, PROGRAM_ID, vault_address]
)[PREFIX, PROGRAM_ID, vault_address]
)set it up via VaultSetup methods
Attempts to resolve a custom program error from the provided error code.
Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'.
Program address
Program publick key
Adds the specified amount of shares to the treasury.
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
NOTE: currently it seems impossible to setup the source account see ./test/add-shares-to-treasury.ts
Mints shares to the {@link MintFractionalSharesInstructionAccounts.fractionTreasury}.
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
Redeems the shares from the treasury.
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
NOTE: currently it seems impossible to add shares and thus redeeming is as well see: ./add-shares-to-treasury.ts ./test/add-shares-to-treasury.ts
Sets up a token account and required instructions that can be used as the {@link WithdrawSharesFromTreasuryInstructionAccounts.destination}.
Sets up a token account and required instructions that can be used as the {@link WithdrawSharesFromTreasuryInstructionAccounts.destination}.
Withdraw shares from the {@link WithdrawSharesFromTreasuryInstructionAccounts.fractionTreasury}.
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
set this up via setupWithdrawSharesDestinationAccount
needed to withdraw shares
NOTE: that the {@link WithdrawSharesFromTreasuryInstructionAccounts.transferAuthority} account is derived from the {@link WithdrawSharesFromTreasuryInstructionAccounts.vault} and does not need to be provided
// TODO(thlorenz): Update this fully Withdraw shares from the {@link WithdrawTokenFromSafetyDepositBox.store}.
Aside from the conditions outlined in detail in {@link InitVault.initVault} the following should hold:
set this up via setupWithdrawFromSafetyDestinationAccount
needed to withdraw
to withdraw
NOTE: that the {@link WithdrawTokenFromSafetyDepositBoxInstructionAccounts.transferAuthority} account is derived from the {@link WithdrawTokenFromSafetyDepositBoxInstructionAccounts.vault} and does not need to be provided
Accounts required by the ActivateVault instruction
Accounts required by the AddSharesToTreasury instruction
Accounts required by the AddTokenToInactiveVault instruction
Accounts required by the CombineVault instruction
Arguments used to create ExternalPriceAccount
Accounts required by the InitVault instruction
Accounts required by the MintFractionalShares instruction
Accounts required by the RedeemShares instruction
Arguments used to create SafetyDepositBox
Accounts required by the SetAuthority instruction
Accounts required by the UpdateExternalPriceAccount instruction
Arguments used to create Vault
Accounts required by the WithdrawSharesFromTreasury instruction
Accounts required by the WithdrawTokenFromSafetyDepositBox instruction
Program address
Program publick key
Creates a ActivateVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a AddSharesToTreasury instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a AddTokenToInactiveVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a CombineVault instruction.
that will be accessed while the instruction is processed
Creates a InitVault instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a MintFractionalShares instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a RedeemShares instruction.
that will be accessed while the instruction is processed
Creates a SetAuthority instruction.
that will be accessed while the instruction is processed
Creates a UpdateExternalPriceAccount instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a WithdrawSharesFromTreasury instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Creates a WithdrawTokenFromSafetyDepositBox instruction.
that will be accessed while the instruction is processed
to provide as instruction data to the program
Attempts to resolve a custom program error from the provided error code.
Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'.
Generated using TypeDoc
Same as ActivateVaultInstructionAccounts except doesn't require fractionalMintAuthority as that will be derived before passing them to createActivateVaultInstruction.
[writable] vault Initialized inactivated fractionalized token vault
[writable] fractionMint Fraction mint
[writable] fractionTreasury Fraction treasury
[] fractionalMintAuthority Fraction mint authority for the program seed of [PREFIX, program_id] (optional)
[signer] vaultAuthority Authority on the vault