Modules
Overview
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.
Modules
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.
smoove::moosui
Module to create $mooSUI
Utilises
sui::coin
Transfers
TreasuryCap
to SMOOVE deployer upon initialisationNo public functions
smoove::smoosui
Module to create $smooSUI
Utilises
sui::coin
Transfers
TreasuryCap
to SMOOVE deployer upon initialisationNo public functions
smoove::treasury_manager
Module to manage
TreasuryCap
for $mooSUI and $smooSUIHandles minting and burning of $mooSUI and $smooSUI
No public functions
smoove::moo_wrapper
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, emitWrapped{amount}
moo_wrapper::unwrap
Burn $mooSUI, returns equal $SUI to caller, emitUnwrapped{amount}
moo_wrapper::wrap_and_transfer
Entrypoint formoo_wrapper::wrap
which transfers $mooSUI to the caller directlymoo_wrapper::unwrap_and_transfer
Entrypoint formoo_wrapper::unwrap
which transfers SUI to the caller directly
smoove::price_oracle
Module to manage price of $smooSUI against $mooSUI
price_oracle::price
Return the current price of smooSUI:mooSUIprice_oracle::decimals
Return the decimal precision of the priceprice_oracle::last_updated
Return the UNIX timestamp of the last price update
smoove::liquid_staking_vault
Module to manage deposits of $mooSUI and withdrawals of $smooSUI
Utilises
smoove::price_oracle
to determine the price of $smooSUI against $mooSUIliquid_staking_vault::deposit
Receives $mooSUI, store as Balance, mint $smooSUI, return $smooSUI to caller, emitDeposited{moosui, smoosui}
liquid_staking_vault::withdraw
Burn $smooSui, returns $mooSUI to caller, emitWithdrawn{moosui, smoosui}
liquid_staking_vault::deposit_and_transfer
Entrypoint forliquid_staking_vault::deposit
which transfers $smooSUI to the caller directlyliquid_staking_vault::withdraw_and_transfer
Entrypoint forliquid_staking_vault::withdraw
which transfers $mooSUI to the caller directly
Last updated