# vcNOTE and cRWAToken ## Overview Vivacity is a Compound V2 based lending protocol that enables users to borrow cNOTE against RWA assets. Generally, Vivacity will have two types of users: **1. users seeking leverage on RWA assets** and **2. users who want to lend their cNOTE** to earn yield. User 1 will primarily supply RWA assets (represented by ERC20s) to Vivacity and borrow `cNOTE`. User 2 will supply their `cNOTE` to Vivacity so it can be borrowed by user 1. When `cNOTE` is supplied to Vivacity, users will receive `vcNOTE` (viva-cNOTE). When RWA tokens are supplied to Vivacity, users will receive `cRWATokens`. #### IMPORTANT: - `cNOTE` will have a collateral factor of 0. This means `cNOTE` cannot be used as collateral and users who supply it **cannot borrow against it** - RWA tokens will have a borrow cap of 1. This means that RWA tokens **cannot be borrowed** by anyone. It can only be supplied and used as collateral. ## vcNOTE (viva-cNOTE) `vcNOTE` is the [cToken](https://docs.compound.finance/v2/ctokens/) that users receive for supplying [cNOTE](https://docs.canto.io/overview/note#usdcnote). `vcNOTE` is a CErc20Delegate with added functionality to integrate with Canto's Neofinance Coordinator. `vcNOTE` overrides all cToken functions that lead to a balance change so that the Neofinance Coordinator can track user positions. The overriden functions are: - `mintInternal()` - `redeemInternal()` - `redeemUnderlyingInternal()` - `seizeInternal()` - `transferTokens()` Contracts that `vcNOTE` inherit have been modified so that the functions listed above can be overrided. #### cNOTE Oracle The `cNOTE` oracle is used to determine the price of `cNOTE`. Because `cNOTE` is a repricing token based on the interest rate of supplying/borrowing NOTE in the Canto Lending Market, the price of `cNOTE` will naturally go up over time. `NOTE` is pegged to 1 dollar at all times in the Canto Lending Market. Hence, to get the USD price of `cNOTE`, the oracle looks at the exchange rate between `cNOTE` <=> `NOTE`. ## cRWAToken `cRWAToken` is the cToken that users receive for supplying RWA tokens. There can be multiple different types of RWA tokens supplied to Vivacity. Each one will produce a different `cRWAToken`. For example, let's say there are 2 RWA tokens available to collateralize in Vivacity: TBill and SME When a user supplies and collateralizes TBill token, they will receive cTBill (which would be a token of type `cRWAToken`). If the user supplies SME token, they would receive cSME (again, a `cRWAToken`). #### Whitelists `cRWAToken` are different from regular cTokens in that they cannot be transfered and only whitelisted users are able to own them. Whitelists come from the RWA token issuers themselves. When a user KYCs with the RWA issuer, they will be added to the whitelist which allows them to own the RWA token. Vivacity looks at this whitelist to determine who can own the `cRWAToken`. This means that only other whitelisted users are able to own and liquidate `cRWATokens`. As mentioned previously, the transfer function for `cRWATokens` has been disabled. #### Oracles The Vivacity comptroller must know the price of the RWA tokens in order to calculate an account's standing. Each RWA issuer will publish prices of RWA Tokens to an oracle contract on chain. The comptroller looks at `PriceOracleRouter.sol` to get the price of each cRWAToken. `PriceOracleRouter` will route each cRWAToken to the correct price oracle. It is expected that the price oracle for each cRWAToken will be provided and managed by the RWA issuers themselves.