Modules
Last updated
Last updated
SMOOVE will be built in multiple iterations as Sui continues to improve with each update.
For the initial launch, a primary wrapper [smoove::moo_wrapper]
will be used to manage the wrapping of $SUI into $mooSUI. The wrapper will also manage the delegation of $SUI with multiple validators to earn staking rewards, and the subsequent unwrapping of $mooSUI back into $SUI.
The liquid staking vault [smoove::liquid_staking_vault]
manages deposits of $mooSUI for yield generated from delegating, and mints $smooSUI based on the current oracle price [smoove::oracle]
as $smooSUI utilizes an accrual mechanism for the rewards. The vault also handles the minting of $mooSUI whenever the oracle price updates every epoch to ensure that the circulating supply of $mooSUI maintains parity with the total amount of $SUI managed by the SMOOVE protocol.
In order to allow for a seamless migration in future, the two coins $mooSUI and $smooSUI are deployed as separate modules [smoove::moosui
and smoove::smoosui]
. The respective TreasuryCaps are then transferred into a Treasury Manager [smoove::treasury_manager]
which is called by the wrapper and the vault when minting or burning of either token is required. This model allows the TreasuryCaps to be extracted at a later date and transferred to a future version of the protocol, allowing for an upgrade that does not require any form of user intervention.
This section briefly describes the modules in the smoove package, along with their purpose and public functions. An interfacing reference will be documented at a later date for developers to work with the modules directly.
Module to create $mooSUI
Utilises sui::coin
Transfers TreasuryCap
to SMOOVE deployer upon initialisation
No public functions
Module to create $smooSUI
Utilises sui::coin
Transfers TreasuryCap
to SMOOVE deployer upon initialisation
No public functions
Module to manage TreasuryCap
for $mooSUI and $smooSUI
Handles minting and burning of $mooSUI and $smooSUI
No public functions
Module to manage wrapping and unwrapping of SUI to $mooSUI
moo_wrapper::wrap
Receive $SUI, store as Balance, mint equal $mooSUI, return $mooSUI to caller, emit Wrapped{amount}
moo_wrapper::unwrap
Burn $mooSUI, returns equal $SUI to caller, emit Unwrapped{amount}
moo_wrapper::wrap_and_transfer
Entrypoint for moo_wrapper::wrap
which transfers $mooSUI to the caller directly
moo_wrapper::unwrap_and_transfer
Entrypoint for moo_wrapper::unwrap
which transfers SUI to the caller directly
Module to manage price of $smooSUI against $mooSUI
price_oracle::price
Return the current price of smooSUI:mooSUI
price_oracle::decimals
Return the decimal precision of the price
price_oracle::last_updated
Return the UNIX timestamp of the last price update
Module to manage deposits of $mooSUI and withdrawals of $smooSUI
Utilises smoove::price_oracle
to determine the price of $smooSUI against $mooSUI
liquid_staking_vault::deposit
Receives $mooSUI, store as Balance, mint $smooSUI, return $smooSUI to caller, emit Deposited{moosui, smoosui}
liquid_staking_vault::withdraw
Burn $smooSui, returns $mooSUI to caller, emit Withdrawn{moosui, smoosui}
liquid_staking_vault::deposit_and_transfer
Entrypoint for liquid_staking_vault::deposit
which transfers $smooSUI to the caller directly
liquid_staking_vault::withdraw_and_transfer
Entrypoint for liquid_staking_vault::withdraw
which transfers $mooSUI to the caller directly