A software designer website

Plutus: Pioneers Program 4th cohort - Lecture 9 - Stablecoin

Gautier DI FOLCO April 30, 2023 [HaskellBlockchain] #haskell #cardano #smart contracts

Today's lecture aims to be a wrap-up of previous lectures by implementing a stablecoin.

It's supposed to be the indexed (i.e. synchronized) representation of a real-world currency.

Cardano already hosts multiple stablecoins indexed on the USD: DJED and USDA.

This lecture will present an over-collateralized algorithmic stablecoin which uses a liquidation mechanism to incentivise stability. Which can be broke down as follows:

Conceptually, it takes:

To deploy the Oracle, we should:

Then we should deploy the collateral validator and minting policy as reference scripts in the same transaction.

Moreover, we need a smart contract which allows updating the conversion rate, meaning:

Then comes the user stable coin minting, which is a transaction containing:

Burning stablecoin takes a transaction which unlock collaterals and mint stablecoins based:

However, liquidating a other user's stablecoin is slightly different as it takes:

Doing so gives you access to the other user's collateral.

If we follows a complete example:

Back to top