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

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more

Deserialize this instance from a slice of bytes.

Serialize this instance into a vector of bytes.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.