# **08. Deposits**
###### tags: `Done`, `UI`, `Functions`
**Purpose:**
* Understand the purpose of the Space: **Deposits**
* Understand how the deposits space functions from the **Action drawer**
Content:
> Definitions
> References
> Purpose & function
> Details
> Deposit Actions:
> >Liquid & Compound Actions
> >Collateral Actions
> Migrate Journey(s)
## Definitions
*Terms will be added as questions arise*
## References
* Compound tokens: https://hackmd.io/@3Fi-4-DeFi/3Fi-CompoundTokens
* Liquid tokens: https://hackmd.io/@3Fi-4-DeFi/3Fi-Liquid-Tokens
* 3Fi Collateral: https://hackmd.io/@3Fi-4-DeFi/3Fi-Collateral
* Emissions: https://hackmd.io/@3Fi-4-DeFi/3Fi-Emissions
## Purpose & Function

**Primary purpose** of the **Deposit** space is to provide a clean, holistic envorinment to monitor working assets within an asset stack.
Let's elaborate:
* Assets are groupped into the following categories:
* 3Fi Collateral
* These assets require an exchange of composable '**Compound**' assets to mint this asset type.
* These assets provide access to advanced protocol functionality such as Money Apps and Micro-Site Analytics.
* Compound deposits
* These assets are those targeted by the asset stack.
* These asset LP tokens are required to mint **Collateral** assets.
* Liquid deposits
* These assets are protocol LP positions that yield emissions which are then used to procure more '**Compound**' assets to boost '**Compound Deposit**' positions.
* There are several sub-groups within '**Liquid Deposits**', these are:
* '**Liquid Deposits**', which signify all compatible LP tokens from external protocols.
* '**Other liquid opportunities**', which is the same as '**Liquid Deposits**', however the name of the group changes once a user has begun depositing compatible LP tokens.
* '**My Liquid Deposits**', which signify all compatible LP tokens from external protocols which a user has deposited into 3.Finance.
* '**Liquidity I can deposit**', which signify all compatibile LP tokens from external protocols which I have in my connected wallet but have not yet deposited into 3.Finance.
* Users may deposit directly into **Compound** and **Liquid** deposit groups.
* Users may purchase **3Fi Collateral** from the open market, which will then reflect in this group or
* Users may use their composable **Compound** deposit LP positions to mint **3Fi Collateral**.
**Secondary purpose** of the **Deposit** space is to provide a structured approach to portfolio building.
Let's elaborate:
* Two key questions we sought to answer:
1. What should I buy?
2. How do I set realistic goals?
* We answered these questions by creating:
1. An asset-stack system that identifies strategic assets within an existing crypto narrative. As more narratives are identified, more asset-stacks will be created.
2. By taking a composable approach to protocol tokens and NFTs, we are establishing a standard that makes goal visualisation easy. As NFTs control a standard number of assets, their '**Day Rates**' with respect to emissions/rewards; can be easily tracked. This visibility of '**Day Rates**' then makes defining of ones goals easy.
## Details
> "Deep dive into the character of this pool.
Scan through the Emissions and APR breakdown, then dig into the detail of tabled data to find growth opportunities that improve portfolio efficiencies."

Left to right:
* Sample: Compound Group / Bent CDP selected.
* Sample: Liquid Group / Non-defined card.
**Deposit Details: Card Breakdown**
Top down:
* Beginning immediately below the help text; a (horizontal) list of emissions is visible. These emissions are paginated, showing up to five (5) at a time.
* A user may page through the emissions by selecting the previous or next cheverons found above and to the right of the emissions list.
* Directly below each emission is a percentage (%), this representis the proportion of value emitted in the form of the displayed token, in comparrison to the total emission value received.
* Ie. Token A = 50%, indicates that 50% of the derived value is received in the form of Token A.
* Below the emissions list is a table of data.
* The purpose of this table is to display the ratio between each of the compound assets and the selected emission from the emissions list.
* The data displayed in the table will update each time a different emission from the displayed emissions list is selected.
* The **1D** ratios are calculated by taking the current price of the selected emission and dividing it by each of the compound assets. This ratio then illustrates how many of the compound asset can be obtained with each emitted unit.
* The **30D, 90D and 180D** ratios are calculated by repeating the 1D calculation each 24hrs, storing that data, then dividing it by 30, 90 or 180 and storing the output as a moving average.
> **Notes:**
> The above is most useful when analysing '**Liquid Emissions**' as it is these that are used to purchase more compound assets.
> The above statement may result in the **'Compound Group'** detail drawers being rethought post MVP.
> **NOTE - The Deposit Details drawer is NOT the same as the Emissions Details drawer.**
> For details on the Emissions Details drawer, see: **09. Emissions.**
## Deposit Actions
### Liquid & Compound Actions

(Above) Walkthrough and Connected views of a selected liquid card with action drawer revealed.

(Above) Walkthrough and Connected views of a selected compound card with action drawer revealed.
> Liquid and Compound action drawers share the same action activities.
> These action activities are:
> 1. Zap
> 2. Deposit and;
> 3. Withdraw
> **Action Drawer Rules:**
> When a liquid or compound card is selected:
> >If the connected wallet has no position within the selected pool, the default secondary tab to be pre-selected shall be: **Details**.
> >If the connected wallet has a position within the selected pool, the default secondary tab to be pre-selected shall be: **Actions**.
> >>When the action drawer is active, the default tirtiary tab to be pre-selected shall be: **Zap**.
#### 1. ZAP
> "‘Zap’ is a function that allows use of assets, not directly supported by this pool, to be deposited. To achieve this: assets are converted during transit into those assets that are supported."

From left to right:
* **No Supply** - Connected wallet does not hold any recognised assets.
* **Select Asset** - Connected wallet holds recognised assets, select one of these to proceed.
* **Ready State** - Recognised asset selected, awaiting user input on quantity to zap in.
* **Breach of Limit** - User input exceeds the wallet balance; user must amend input to proceed.
* **Executable State** - User input accepted, ZAP button activated. User needs to execute transaction to complete.
* **Sample: Resulting State** - On completion of transaction, drawer updates existing state to reflect new balances.
> **Notes:**
> Where possible, when zapping a balance into an LP position, we should be using the protocol targeted for deposit.
#### 2. DEPOSIT
> "‘Deposit’ is the most direct and efficient way to add assets to your position. However this function will only accept assets that directly relate to this pool."


From left to right & top to bottom:
* **No Supply** - Connected wallet does not hold any of the accepted direct deposit assets.
* **Flagged Supply** - One or more of the accepted direct deposit assets held by the connected wallet is flagged and requires acceptance of deposit terms to proceed.
* **Auto-Select Solo Asset** - Deposit terms accepted; auto-selects the flagged asset.
* **Solo Asset Ready State** - User has entered an accepted amount and now needs to submit and sign the transaction to proceed.
* **No Flagged Supply** - View when no flagged accepted direct deposit assets are detected.
* **Select 2 or More Assets** - User has selected multiple assets to deposit in a single transaction.
* **Migrate, w. Flagged Supply** - Migratable and flagged assets are detected.
* **Migrate, w. No Flagged Supply** - Migratable asset is detected.
* **Migrate Supply** - User accepts migrate prompt, asset list updates to reflect accepted assets that may be migrated.
* **Migrate Ready State** - User has entered an accepted amount of migratable asset and now needs to submit and sign the transaction to proceed.
> **Notes:**
> Standard error states also apply to the above but have not been presented here. See ZAP and WITHDRAW for standard error states such as: **Breach of Limit**.
> Learn more about migratable assets at the end of this document.
> **Action drawer customisations.**
> >Each of the compound deposit pools (CDPs), have the following customisations with respect to their action drawers:
> >> Curve CDP shall include within its **Help text** the following statement: 'Curve C.D.P deposits are staked in StakeDAO.'
> >> Convex CDP shall include within its **Help text** the following statement: 'Convex C.D.P deposits are staked in BentFinance.'
> >> Bent CDP shall include within its **Help text** the following statement: 'Bent C.D.P deposits are staked in BentFinance.'
#### WITHDRAW
> "‘Withdraw’ moves assets to the connected wallet. The withdraw function also provides format options for those tokens specific to this pool."

From left to right:
* **No Supply** - Connected wallet does not currently hold a position in the pool so there is nothing to withdraw.
* **Ready State** - Connected wallet holds a possition in the pool and awaits a withdraw option to be selected.
* **Breach of Limit** - User input exceeds the wallet balance; user must amend input to proceed.
* **Executable State** - User input accepted, WITHDRAW button activated. User needs to execute transaction to complete.
* **Sample: Resulting State** - On completion of transaction, drawer updates existing state to reflect new balances.
### Collateral Actions

(Above) Walkthrough and Connected views of a selected collateral card with action drawer revealed.
> There are two types of Collateral action drawers, one focuses on the 3Fi token and the other on 3Fi NFTs. Their respective action activities are as follows:
> **3Fi Token:**
> >1. Mint
> >2. Burn and;
> >3. NFTs
> **3Fi NFTs:**
> >1. Merge and;
> >2. Burn
> **Action Drawer Rules:**
> When a collateral card is selected:
> >If the connected wallet has no position within the selected pool, the default secondary tab to be pre-selected shall be: **Details**.
> >If the connected wallet has a position within the selected pool, the default secondary tab to be pre-selected shall be: **Actions**.
> >>When the action drawer is active, the default tirtiary tab to be pre-selected shall be: **Zap**.
> **Notes:**
> 3Fi NFT cards are not visible until a wallet is connected.
> 3Fi NFT cards are not visible if there are no positions held.
#### 3Fi Tokens / MINT
"Use Compound L.P positions to mint 3Fi tokens.
3Fi tokens maintain all emission accruals and gain governance and voting rights over 3.Finance."
**Purpose for activity:**
* Allow users who have invested in the ecosystem to aquire governance rights over the 3.Finance protocol.


From left to right, top down:
* **No Supply** - Connected wallet does not hold any position in either of the accepted and required assets.
* **Half Supply = Convex C.D.P** - Connected wallet holds one of the two accepted and required assets.
* **Half Supply = Bent C.D.P** - Connected wallet holds one of the two accepted and required assets.
* **Ready State** - Connected wallet holds both accepted and required assets and awaits a '**mint**' amount to be entered.
* **Breach of Limit** - User input exceeds the mint limit, based upon the connected wallets existing positions in the accepted and required assets. User must amend input to proceed.
* **Executable State** - User input accepted, MINT 3Fi TOKENS button activated. User needs to execute transaction to complete.
* **Sample: Resulting State** - On completion of transaction, action drawer and 'linked' cards updates existing state to reflect new balances.
> **Notes:**
> When a user selects the 3Fi Token Card, the following will occur:
> * The default view will be set to '**MINT**'.
> * The 3Fi Token Card will transition to its '**Select**' state.
> * When '**MINT**' is active: the **Indicator** (White arrow) on the 3Fi Token card, will be directed towards the card.
> * In the Compound Deposit group:
> > * The Convex CDP Card will transition to its '**Highlighted**' state.
> > * The Bent CDP Card will transition to its '**Highlighted**' state.
> > * When '**MINT**' is active: the **Indicator** (White arrow) on both the CDP cards, will be directed towards the action drawer.
> The above CDPs are '**Highlighted**' because it is their positions that determin wether the user may progress with respect to minting 3Fi Tokens.
> '**Highlighted**' cards reference (with respect to MINT) what assets are required to proceed.
#### 3Fi Tokens / BURN
"Burn 3Fi tokens to retrieve Compound L.P positions. Note: Governance and voting rights will be lost."
**Purpose for activity:**
* Allow users who have attained governance rights over the 3.Finance protocol to retrieve their investments.

From left to right:
* **No Supply** - Connected wallet does not hold any position in the accepted and required assets.
* **Ready State** - Connected wallet holds the accepted and required asset and awaits a '**burn**' amount to be entered.
* **Breach of Limit** - User input exceeds the burn limit, based upon the connected wallets existing positions in the accepted and required asset. User must amend input to proceed.
* **Executable State** - User input accepted, BURN 3Fi TOKENS button activated. User needs to execute transaction to complete.
* **Sample: Resulting State** - On completion of transaction, action drawer and 'linked' cards updates existing state to reflect new balances.
> **Notes:**
> When a user selects the 3Fi Token Card, the following will occur:
> * The default view will be set to '**MINT**'.
> * The user will select '**BURN**'.
> * The 3Fi Token Card will transition to its '**Select**' state.
> * When '**BURN**' is active: the **Indicator** (White arrow) on the 3Fi Token card, will be directed towards the action drawer.
> * In the Compound Deposit group:
> > * The Convex CDP Card will transition to its '**Highlighted**' state.
> > * The Bent CDP Card will transition to its '**Highlighted**' state.
> > * When '**BURN**' is active: the **Indicator** (White arrow) on both the CDP cards, will be directed towards each of their respective cards.
> The above CDPs are '**Highlighted**' because those assets will be returned once the user has completed the burn process.
> '**Highlighted**' cards reference (with respect to BURN) what assets will be released back to the connected wallet.
#### 3Fi Tokens / NFTs
"Use 3Fi tokens and Curve C.D.P L.P positions to mint 3Fi NFTs. 3Fi NFTs simplify harvest activity, gain access to communal harvest incentives and receive a share of protocol revenue."
**Purpose for activity:**
* Allow users who have attained governance rights over the 3.Finance protocol to further aquire rights to protocol revenue share.


From left to right, top down:
* **No Supply** - Connected wallet does not hold any position in either of the accepted and required assets.
* **Half Supply = 3Fi Token** - Connected wallet holds one of the two accepted and required assets.
* **Half Supply = Curve C.D.P** - Connected wallet holds one of the two accepted and required assets.
* **Ready State** - Connected wallet holds both accepted and required assets and awaits a '**mint**' amount to be entered.
* **Insufficient Supply** - User has selected an NFT power-level to which they do not have the required quantity of assets to proceed.
* **Breach of Limit** - User input exceeds the mint limit, based upon the connected wallets existing positions in the accepted and required assets. User must amend input to proceed.
* **Executable State** - User input accepted, MINT 3Fi NFTs button activated. User needs to execute transaction to complete.
* **Sample: Resulting State** - On completion of transaction, action drawer and 'linked' cards updates existing state to reflect new balances.
>** Note:**
> On load, the lowest NFT power-level (ParAi), will be pre-selected by default.
> Users will have the option to select higher power-levels but they will only be able to mint them if they have the required asset balances.
#### 3Fi NFTs / MERGE
"Use ‘Merge’ to power up your NFT’s and release the artwork of the NFT being merged."
**Purpose for activity:**
* To allow users the opportunity to consolodate their NFT collection via power-ups.
* To allow users the opportunity to collect our exclusive NFT artwork.
* To allow users the opportunity to earn higher profit share rates.

> **Notes:**
> When a user wishes to merge NFTs, they will need to follow the following steps:
> * The user will select the NFT card they wish to merge.
> * On select, the action drawer will open with '**Merge**' preselected as default.
> * Within the (horizontal) list of NFT power-levels; all NFT power-levels from the selected NFT and lower will be inactive. That is to say: a user will not be able to select any of these NFTs because the merge process is power-up only.
> * The NFT power-level that will be selected by default will therefore be the selected NFT + 1 power level.
> * The user may select higher power-levels if they have enough NFTs to merge to a level beyond the next level.
> * IF the next power level = SorAi, on Merge, the user will receive the both MatAi and SorAi artwork as a separate and distinct non-asset backed NFTs. Ie. Merging 3 MatAi NFTs into 1 SorAi NFT will result in the user receiving:
> > 1x SorAi NFT
> > 1x SorAi Artwork NFT
> > 1x MatAi Artwork NFT
With the above notes in mind, from left to right:
* **Insufficient Supply** - User does not have enough of the selected NFT to merge into the selected power-level. (**Note**: this could be the next power-level or higer levels, depending on what is selected)
* **Ready State** - Connected wallet holds enough of the selected NFTs to meet the merge requirements of the selected NFT power-level.
* **Insufficient Supply** - *Repeat of above, this view however shows a power-level selected that is several levels higher.*
* **Breach of Limit** - User input exceeds the mint limit, based upon the connected wallets existing positions in the accepted and required assets. User must amend input to proceed.
* **Executable State** - User input accepted, MERGE button activated. User needs to execute transaction to complete.
* **Sample: Resulting State** - On completion of transaction, action drawer and 'linked' cards updates existing state to reflect new balances.
#### 3Fi NFTs / BURN
"Use ‘Burn’ to power down and release the underlying assets."
**Purpose for activity:**
* To provide users the ability to retrieve the underlying assets.

> **Notes:**
> On burn; the connected wallet will cease to receive profit share from the 3.Finance protocol with immediate effect.
> >Any unclaimed profit share prior to the burning of NFTs will be retrievable.
With the above notes in mind, from left to right:
* **Ready State** - Connected wallet holds enough of the selected NFTs to meet the burn requirements.
* **Breach of Limit** - User input exceeds the mint limit, based upon the connected wallets existing positions in the accepted and required assets. User must amend input to proceed.
* **Executable State** - User input accepted, BURN button activated. User needs to execute transaction to complete.
* **Sample: Resulting State** - On completion of transaction, action drawer and 'linked' cards updates existing state to reflect new balances.
## Migrate Deposits

**Above:** View of both prompt types possible when a prospect migration is detected.
There are two instances where users will be able to migrate deposits:
1. **Seen above left:** When it is detected that a connected wallet holds an accepted token balance. (Including LP tokens)
* When detected:
* Display the prompt: "DEPOSIT BALANCE TO GAIN 3.FINANCE BENEFITS AND PROTOCOL UTILITY" in column 3 of the cards UI.
* IF the pool is a Compound deposit pool, display the prompt within column 3, but do not move the card into a different group or sub-group.
* IF the pool is a Liquid deposit pool, display the prompt within column 3 and move that pools card into a group titled: '**Liquidity I can deposit**'.
2. **Seen above right:** When it is detected that a connected wallet holds an accepted token position elsewhere in DeFi.
* When detected:
* Display the prompt: "REROUTE BALANCE TO GAIN 3.FINANCE BENEFITS AND PROTOCOL UTILITY" in column 3 of the cards UI.
* IF the pool is a Compound deposit pool, display the prompt within column 3, but do not move the card into a different group or sub-group.
* IF the pool is a Liquid deposit pool, display the prompt within column 3 and move that pools card into a group titled: '**Liquidity I can deposit**'.
> **Notes:**
> The above prompts should only be displayed while there is NO deposit in the pool.
> When a deposit has been made into a pool, do not continue to show the prompt here, otherwise we could be hiding card data for long periods. (We shall rely on the action drawer prompt to facilitate further migrations). For more details see below:


From left to right, top to bottom:
* **Curve CDP:**
* **Migrate, w. No Flagged Supply**
* **Migrate Supply**
> Having once again reviewed these designs, it is my belief that the default design; which is the '**accepted token list**' would for the Curve CDP, sufice.
> I believe this to be true, because within the accepted token list, includes each receipt token from Stake DAO, which; depositing such tokens would achieve the same end.
> To reitterate: I do not believe the added **'migrate'** prompt shown in these two drawers will be required.
* **Convex CDP:**
* **Migrate, w. No Flagged Supply**
* **Migrate Supply**
> Unlike the Curve CDP, I do believe the **'migrate'** prompt IS required with respect to the Convex CDP. This is because no receipt token is received when **bentCVX** is staked on Bent Finance. Thus:
> When accepted tokens are detected in the users wallet, there is no need to display the shown **'migrate'** prompt. However:
> When it is detected that a connected wallet has a staked position on Bent Finance / Single Sided bentCVX pool, the **'migrate'** prompt is to be displayed.
> >Selecting the prompt will reveal the connected wallets staked bentCVX position.
> >Entering an accepted amount will reveal the **'Reroute'** button.
> >Selecting the **Reroute** button and signing the subsequent transaction will withdraw the specified balance from the single sided bentCVX pool on Bent Finance, pass the bentCVX balance to 3.Finance.
> >3.Finance will then issue 3vlBCVX tokens in receipt of bentCVX tokens received and redeposit those received bentCVX tokens back into Bent Finance single sided pool.
* **Bent CDP:**
* **Migrate, w. No Flagged Supply**
* **Migrate Supply**
> Unlike the Curve CDP, I do believe the **'migrate'** prompt IS required with respect to the Bent CDP. This is because no receipt token is received when **weBENT** is staked on Bent Finance. Thus:
> When accepted tokens are detected in the users wallet, there is no need to display the shown **'migrate'** prompt. However:
> When it is detected that a connected wallet has a staked position on Bent Finance / weBENT pool, the **'migrate'** prompt is to be displayed.
> >Selecting the prompt will reveal the connected wallets staked weBENT position.
> >Entering an accepted amount will reveal the **'Reroute'** button.
> >Selecting the **Reroute** button and signing the subsequent transaction will withdraw the specified balance from the weBENT pool on Bent Finance, pass the BENT balance to 3.Finance.
> >3.Finance will then issue 3vlBENT tokens in receipt of BENT tokens received and redeposit those received BENT tokens back into Bent Finance weBENT pool.
>**Note:**
> Bent may releace weBENT tokens. If they do, the above Bent CDP notes would be obsolete and the Bent CDP will be inline with those notes described above for the Curve CDP.
END