Release your own stablecoin on Tezos with Checker

By Arthur Guillon

A few months ago, we announced the first release of our pure-Ligo version of the Checker library. This library can be used to create synthetic tokens, such as stablecoins, which can be minted in a permissionless manner by depositing collateral. Checker offers a number of features: it supports various types of collaterals, automatic and decentralized rate adaptation, a built-in CFMM with rewards for liquidity providers, protection against oracle manipulation, and a batched auction mechanism for liquidations.

However, perhaps because of this complexity, it has not received the attention and usage it deserves. Marigold hopes to help new financial projects on Tezos by offering a more developer-friendly version of the library.

What are stablecoins?

In decentralized finance (DeFi), stablecoins are tokens used to represent low-volatility assets pegged (indexed) on real-world ones, such as currencies. By far, the most represented of these assets is the USD, but other currencies, such as the euro, or non-currency assets, such as gold, can be defined as well. In DeFi, stablecoins are, for instance, used by traders to close a trade (e.g., by taking their gains) without having to leave the blockchain and go back to a centralized exchange. They are also useful to represent and transfer value on-chain, but as of now they have not found real adoption for day-to-day usage.

There are many famous and infamous examples of stablecoins, which use various mechanisms to maintain the peg — or fail to do so. To keep things simple, let’s distinguish between fiat-backed stablecoins and crypto-backed stablecoins. The first category is deployed by companies that receive real, off-chain assets (such as USD) which they keep as collateral, and mint (or emit) a corresponding amount of tokens on-chain (such as USDT or USDC). In contrast, crypto-backed stablecoins are operated by on-chain protocols, which let users deposit cryptocurrencies as collateral and mint a quantity of coins.

What matters in both cases is how the stablecoins keep their peg to the asset they’re tracking. As their market value fluctuates, it is necessary to either mint new stablecoins and sell them to lower their value or repurchase them to restore their value and prevent a crash. When a fiat-backed stablecoin is cheaper than it should be, it’s easy to buy it at a discount (say $0.99), redeem it back to the company that minted it against collateral (say $1), and pocket the difference. Things are more challenging with crypto-backed stablecoins, as the value of cryptocurrencies is itself fluctuating and even tends to go down as well when large stablecoins lose their peg: even if you redeemed $1 worth of crypto, who is to say that it is still going to be worth as much when you sell it on an exchange? For this reason, crypto-backed stablecoins are over-collateralized: to mint $1 worth of stablecoin, a user needs to provide much more collateral, usually twice as much. That way, even if the collateral and the stablecoin both lose value, there is still an incentive to buy the latter to redeem it against the former, which could still be worth significantly more than $1.

To wrap things up, let’s say that you wanted to implement a USD stablecoin on Tezos, backed by XTZ coins. The bare minimum your protocol would need is the following:

  • a way of letting users deposit collateral (XTZ coins) in individual vaults;
  • a system to know the worth of the collateral contained in these vaults relative to USD, called an oracle;
  • an operation to mint new stablecoins from overcollateralized vaults;
  • an operation to redeem stablecoins against collateral for vaults that became undercollateralized, which is called liquidation.

There are many oracle solutions on Tezos which can be plugged into other smart contracts. Checker provides the rest of these operations and much more.

Checker, a generic “robocoin” implementation

Checker is not a new project: it was started in 2020, involving several Tezos organizations. It favours genericity and abstraction, allowing for tracking any off-chain asset as long as you can provide an oracle. For this reason, the official documentation keeps a rather abstract vocabulary, speaking, for instance, of kit for the minted asset and tok for the collateral.

If you want to know more about Checker, please read our blogpost on Marigold website :point_right: Release your own stablecoin on Tezos with Checker