When market volatility ramps up, we often look to CD, one of the most common fixed-income staples available at just about any banks around the street corner. However, such a crucial primitive has been missing in the DeFi world until now. We have seen in the past two years many money markets and high yield DeFi products coming onto the scene. Not all money markets are created equal, with different curves and different risk profile. Compound variable rate as of today is 10%, DyDx is 11.5% whereas Nuo is 18.5%. Each of these rates is shifting dynamically, DyDx shifted from 12% to 22% in 12 hours whereas Compound shifted between 5% to 16% in one months. Some of us may want the best variable rate across different product at any moment in time, but the majority of the world wants stability.
What it does
Buying a CD on CD-RW is as simple as depositing your DAI into CD-RW generates CD token, a fixed rate token in the form of ERC721 generated upon deposit that provides investors the simplest access to a fixed rate return against a variety of protocols that provide variable interest rate. We allow anyone to be a banker and earn the best variable rate available. To create CD-RW, we wrote a “Bank” smart contract in order to escrow funds to back up the Certificate of Deposit issued, and “CDRW” smart contract for minting of the CD token that represent the CDs. We enable optimizing of yields across multiple yield generating protocols via a number of adaptors of all yield generating protocols and a rebalancing protocol that moves funds across these adaptors. Here is an example: “CD Buyer” deposits 100 DAI into a “Bank” for 1y. If the "Bank" has a 1y rate for 5% th “Bank” The bank effectively deposits 5 DAI worth of cDAI into an “escrow account”. The interest will be released to the “CD Buyer” at the end of the 1y. If the “CD Buyer” wants to redeem their CD before the 1y is up, they will have to forfeit a portion of the interest earned. For example, if the CD Buyer wants to redeem his CD after 6m, he would normally be due 102.5 DAI, but might receive only 101.5 DAI instead, paying a 1 DAI penalty. This penalty can be set as a % of accrued interest. In the example above, a penalty of 13% of the 2.5 DAI of accrued interest is assessed (1 DAI/2.5 DAI = 40%). “Bank” deposits the 105 DAI into Compound to earn variable interest. “Bank” collects the difference between the variable interest it earns from Compound and the fixed interest that it pays to the “CD Buyer”. “Bank” makes money if the amount of interest it pays the CD Buyer is less than the amount of interest it earns from Compound on 105 DAI.
How I built it
We used ERC721 to represent to CD. Build the “Bank” contract Build the interface for the CD Buyer to buy a CD from the Bank. If there’s not enough money in the bank to support more interest, then CD-RW stops issuing CDs until more funds are deposited into the DAO that governs the bank.
What determines the rates you get? Currently multiple "banks" will submit rates via an onchain oracle.
How to interact with CDRW? Web interface ENS Domain (deposit.eth) https://manager.ens.domains/name/deposit.eth Sponsors used Provable Things to enable bankers to stream rates to depositors ENS to provide a direct but human friendly path to deposit Torus to onboard users with a familiar login experience Components of a CD
Challenges I ran into
Accomplishments that I'm proud of
Build a crucial financial primitive for DeFi.