Tokenized CDP (collateralized debt position) that is fungible and tradable on decentralized exchanges.
This project aims to solve two DeFi lending problems: over-collateralization and illiquidity, by creating a shared and tokenized CDP - tCDP. Similar to most of the lending protocols, tCDP requires users to deposit collateral before borrowing. The difference is tCDP's users are sharing a huge position, rather than owning CDP individually. That makes tCDP fungible and tradable. Also, tCDP rebalances itself automatically. Users don't need to worry about liquidation any more. The position gets deleverage/leverage whenever the collateralization ratio falls out from the given range. Furthermore, tCDP is platform-agnostic, it can rely on any lending protocol that supports ETH deposit and DAI borrowings, such as MakerDAO, Compound, and AAVE, and it always chooses the one with the best funding rate. For traditional CDP settlement, users need to first repay debt then draw collateral. For tCDP, since it is an ERC20 token, users may directly sell it to DEXes for the position's residual value. Trading tCDP is like trading a bundle of assets and debt.
How it's made
The contract is deployed on mainnet. (NOT audited yet!) We use Compound and AAVE as underlying lending platforms. The DApp forwards ETH to one of the platforms and borrows DAI out. To calculate the collateralization ratio, tCDP collects price feed from Compound and AAVE's oracle. It uses Kyber Network as an onchain liquidity aggregator for rebalancing, and dYdX flashloan for migrating position between two platforms. The frontend is built with web3-react. We use Ganache to create mainnet fork and run tests.