Sometimes being unsatisfied with the current stablecoins (DAI, USDC, USDT and etc.), you come across the need of creating your own one.
Not only is there a way to create the decentralized stablecoin, but to get it with the following benefits:
- Positive interest yield
- Your own :)
To create it you will need only 3 components.
- The first component you will need is perpetual contracts on dYdX
What is dYdX?
dYdX is a decentralized trading platform that currently supports margin trading, spot trading, lending, and borrowing. dYdX runs on smart contracts on the Ethereum blockchain and allows users to trade with no intermediaries.
What are perpetual contracts?
Perpetual Contract Markets exist on the dYdX Perpetual Contracts Protocol. They are synthetic trading markets on Ethereum that allow for exposure to arbitrary liquid assets using ERC-20 tokens as collateral. More…
What are the funding payments?
Perpetual contracts are inspired by traditional futures contracts but differ in that there is no expiry date and therefore no final settlement or delivery. Funding payments are therefore used to incentivize the price of the perpetual to trade at the price of the underlying. More…
2.Secondly, you will need Paraswap
- And the last component of your own stablecoin is renBTC
What is renBTC?
Any asset minted on Ethereum by RenVM is a 1:1 backed ERC-20. This means that if you have 1 renBTC (an ERC-20), you can always redeem it for 1 BTC. It’s a direct supply peg. renBTC isn’t synthetic, it doesn’t rely on a liquidation mechanism, and it’s not the price of Bitcoin on Ethereum. It is a one to one representation of Bitcoin on Ethereum that can be redeemed for BTC at any time, in any amount. More…
After having figured out the main components, let’s start creating our own decentralized stablecoin.
Let’s say we have $20,000 and we want to create $20,000 stablecoins. For convenience, let’s imagine the price of Bitcoin is $10,000.
We divide our funds into 2 parts of $10,000:
- Open a short position on dYdX (BTC-USDC perpetual contract)
- Buy 1 renBTC for $10,000
As a result, we get the position:
The total value of the position will always be $20,000 + Funding payments for short BTC on dYdX.
At the moment the 8H funding rate is 0.0163% for BTC-USDC
This means if the rates do not change, during the year you will earn:
0.0163*3*365=17,84% for your short position
Total position size is $20,000
Total APY is $1784/20000*100=8.92%
Now you can mint $20,000 of your stablecoins against the collateral of your position.
Here is a simplified smart contract architecture allowing you to mint your own stablecoin.
- Alice sends ETH to the smart contract
- Smart contract make exchange ETH to renBTC & USDC
- Smart contract open short position on dYdX
- Smart contract mints stablecoins and send them to Alice.
- Alice sends stablecoins to the smart contract
- Smart contract close short position on dYdX
- Smart contract make exchange renBTC & USDC to ETH
- Smart contract burn stablecoins and sends ETH to Alice
- In case of the margin call on the dYdX, smart contract sells part of renBTC
- Smart contract open a short position on the dYdX again
A smart contract needs a decentralized oracle to check the prices. (Chainlink)
This way you can create your own smart contract creating stablecoins.
Please retweet if you enjoyed it :)
HodlTree is a second-generation decentralized lending protocol. Our mission is to provide significantly improved interest rates for ETH & BTC with a targeted rate of around 8–20% APY and expand the list of coins in the nearest future. We are developing a decentralized solution for cryptocurrency holders where they can earn money without losing control over their coins.
The scale of a stablecoin depends on liquidity in BTC-USDC perpetual contract.
Slippage is possible.
Funding payments can be negative.
The Content is for informational purposes only, you should not consider any such information or other material as legal, tax, investment, financial, or other advice.