Architecture
Last updated
Last updated
Vivacity Finance is a Compound V2 based lending protocol that enables users to borrow NOTE against a variety of assets, including Real World Assets (RWAs). It uses custom cToken implementations for NOTE (), RWAs (), and other collateral ().
Although NOTE is the asset supplied to and borrowed from Vivacity via the frontend interface, unborrowed NOTE is converted to cNOTE.
, the deposit token for NOTE in the Canto Lending Market, is the primary productive asset in the Canto neofinance ecosystem, and is eligible for Neofinance Coordinator incentives.
Since Vivacity only intends to enable borrowing of NOTE against crypto and RWAs, the following lending parameters are used:
NOTE has a collateral factor of 0. This means NOTE cannot be used as collateral and users who supply it cannot borrow against it.
Crypto and RWA tokens have a borrow cap of 1. This means that crypto and RWA tokens cannot be borrowed by anyone: they can only be supplied and used as collateral.
vcNOTE is the cToken that users receive for supplying NOTE. 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 Neofinance Coordinator can continuously track users' lending 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 overridden.
cNOTE is a repricing token based on the borrow and supply rates of NOTE on the Canto Lending Market. As a result, an oracle must be used to determine the price of cNOTE.
The VCNotePriceOracle.sol
contract achieves this by calling the exchangeRateStored()
function on the underlying cNOTE contract. This method is inherited from Compound V2's CToken.sol
, since the Canto Lending Market is also based on Compound V2.
cCrpytoToken is the cToken that users receive for supplying crypto tokens. Vivacity Finance will support multiple different crypto tokens, each of which is represented by a unique cToken instance.
For example, consider two tokens with lending markets on Vivacity: Canto and ETH:
When a user supplies Canto token, they receive cCanto.
When a user supplies ETH token, they receive cETH.
New cCryptoTokens are automatically created when the Vivacity Finance team enables lending markets for specific tokens deployed on Canto.
cRWAToken is the cToken that users receive for supplying RWA tokens. Vivacity Finance will support multiple different RWAs, each of which is represented by a unique cRWAToken instance.
For example, consider two RWAs with lending markets on Vivacity: TBill and SME:
When a user supplies TBill token, they receive cTBill.
When a user supplies SME token, they receive cSME.
New cRWATokens are automatically created when the Vivacity Finance team enables lending markets for specific RWA tokens deployed on Canto.
cRWATokens differ from regular cTokens in that 1. they cannot be transferred and 2. only whitelisted users are able to own them.
Whitelists are managed by RWA issuers themselves to comply with regulatory requirements. When a user KYCs with an RWA issuer, they are added to that issuer's whitelist(s), allowing them to own the RWA token.
Vivacity looks at these whitelists to determine who can own a cRWAToken. This means that only whitelisted users are able to own or liquidate cRWATokens.
The Vivacity comptroller must know the price of collateral assets in order to calculate an account's standing:
Pricing for RWA tokens is published by RWA issuers themselves to on-chain oracle contracts.
The comptroller looks at PriceOracleRouter.sol
to get the price of each cToken. This contract routes each token to its associated price oracle.
Pricing for other crypto assets is retrieved from .