> For the complete documentation index, see [llms.txt](https://smoove.gitbook.io/smoove-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smoove.gitbook.io/smoove-docs/technical/modules.md).

# Modules

## Overview

<figure><img src="https://474768303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqiGuRRhWkk6EY6AS1Odg%2Fuploads%2FSO3mD6ONg7BG64e24VaR%2Fimage.png?alt=media&amp;token=50599998-cb60-46c6-9f7b-1e5da12191df" alt=""><figcaption></figcaption></figure>

SMOOVE will be built in multiple iterations as Sui continues to improve with each update.&#x20;

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.&#x20;

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`&#x20;
* Transfers `TreasuryCap` to SMOOVE deployer upon initialisation
* No public functions

### smoove::smoosui

* Module to create $smooSUI
* Utilises `sui::coin`&#x20;
* Transfers `TreasuryCap` to SMOOVE deployer upon initialisation
* No public functions

### smoove::treasury\_manager

* Module to manage `TreasuryCap` for $mooSUI and $smooSUI
* Handles 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, 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

### smoove::price\_oracle

* 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

### 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 $mooSUI&#x20;
* `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&#x20;
* `liquid_staking_vault::withdraw_and_transfer` Entrypoint for `liquid_staking_vault::withdraw` which transfers $mooSUI to the caller directly
