Satay Module
Overview
The satay::satay
module serves as the primary interface for interacting with vaults within the Satay protocol. It provides public entry functions that allow users to create and manage vaults, handle deposits and withdrawals, and integrate strategies.
Structs
The satay::satay
module does not define any new structs. Instead, it leverages existing structs from the satay::vault
and satay::strategy
modules to manage vaults and strategies.
Functions
The module primarily exposes public entry functions that facilitate various operations related to vault management.
create_vault(account: &signer, deposit_limit: Option<u64>, protocol_fee: Option<u64>, base_metadata: Object<Metadata>)
: Creates a new vault with the specified deposit limit, protocol fee, and base asset metadata.create_vault_with_coin<CoinType>(account: &signer, deposit_limit: Option<u64>, protocol_fee: Option<u64>)
: Creates a new vault for a specific coin type, wrapping the coin if necessary, and initializing it with a deposit limit and protocol fee.pause_vault(account: &signer, vault: Object<Vault>)
: Pauses the specified vault, preventing new deposits but allowing withdrawals.unpause_vault(account: &signer, vault: Object<Vault>)
: Unpauses the specified vault, allowing it to accept deposits again.add_strategy(account: &signer, vault: Object<Vault>, strategy: Object<Strategy>)
: Adds a new strategy to the specified vault for yield generation or management.remove_strategy(account: &signer, vault: Object<Vault>, strategy: Object<Strategy>, force: bool)
: Removes an existing strategy from the specified vault, with an option to force removal even if the strategy has outstanding debt.vault_deposit(account: &signer, vault: Object<Vault>, amount: u64)
: Deposits a specified amount of base assets into the vault, minting corresponding shares for the user.vault_deposit_coin<CoinType>(account: &signer, vault: Object<Vault>, amount: u64)
: Deposits a specified amount of a specific coin type into the vault, wrapping the coin and minting corresponding shares for the user.
Last updated