pub enum VaultInstruction {
InitVault(InitVaultArgs),
AddTokenToInactiveVault(AmountArgs),
ActivateVault(NumberOfShareArgs),
CombineVault,
RedeemShares,
WithdrawTokenFromSafetyDepositBox(AmountArgs),
MintFractionalShares(NumberOfShareArgs),
WithdrawSharesFromTreasury(NumberOfShareArgs),
AddSharesToTreasury(NumberOfShareArgs),
UpdateExternalPriceAccount(ExternalPriceAccount),
SetAuthority,
}
Expand description
Instructions supported by the Fraction program.
Variants
InitVault(InitVaultArgs)
Initialize a token vault, starts inactivate. Add tokens in subsequent instructions, then activate.
AddTokenToInactiveVault(AmountArgs)
Add a token to a inactive token vault
ActivateVault(NumberOfShareArgs)
Activates the vault, distributing initial shares into the fraction treasury. Tokens can no longer be removed in this state until Combination.
CombineVault
This act checks the external pricing oracle for permission to combine and the price of the circulating market cap to do so. If you can afford it, this amount is charged and placed into the redeem treasury for shareholders to redeem at a later time. The treasury then unlocks into Combine state and you can remove the tokens.
RedeemShares
If in the combine state, shareholders can hit this endpoint to burn shares in exchange for monies from the treasury. Once fractional supply is zero and all tokens have been removed this action will take vault to Deactivated
WithdrawTokenFromSafetyDepositBox(AmountArgs)
If in combine state, authority on vault can hit this to withdrawal some of a token type from a safety deposit box. Once fractional supply is zero and all tokens have been removed this action will take vault to Deactivated
MintFractionalShares(NumberOfShareArgs)
Self explanatory - mint more fractional shares if the vault is configured to allow such.
WithdrawSharesFromTreasury(NumberOfShareArgs)
Withdraws shares from the treasury to a desired account.
AddSharesToTreasury(NumberOfShareArgs)
Returns shares to the vault if you wish to remove them from circulation.
UpdateExternalPriceAccount(ExternalPriceAccount)
Helpful method that isn’t necessary to use for main users of the app, but allows one to create/update existing external price account fields if they are signers of this account. Useful for testing purposes, and the CLI makes use of it as well so that you can verify logic.
SetAuthority
Sets the authority of the vault to a new authority.
Trait Implementations
sourceimpl BorshDeserialize for VaultInstruction where
InitVaultArgs: BorshDeserialize,
AmountArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
AmountArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
ExternalPriceAccount: BorshDeserialize,
impl BorshDeserialize for VaultInstruction where
InitVaultArgs: BorshDeserialize,
AmountArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
AmountArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
NumberOfShareArgs: BorshDeserialize,
ExternalPriceAccount: BorshDeserialize,
sourceimpl BorshSerialize for VaultInstruction where
InitVaultArgs: BorshSerialize,
AmountArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
AmountArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
ExternalPriceAccount: BorshSerialize,
impl BorshSerialize for VaultInstruction where
InitVaultArgs: BorshSerialize,
AmountArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
AmountArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
NumberOfShareArgs: BorshSerialize,
ExternalPriceAccount: BorshSerialize,
sourceimpl Clone for VaultInstruction
impl Clone for VaultInstruction
sourcefn clone(&self) -> VaultInstruction
fn clone(&self) -> VaultInstruction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for VaultInstruction
impl Send for VaultInstruction
impl Sync for VaultInstruction
impl Unpin for VaultInstruction
impl UnwindSafe for VaultInstruction
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more