Alchemist

Alchemists are the smart contract center of the Alchemix protocol. The AlchemistV2.sol contract powers the Alchemist. Alchemists accept yield-bearing assets as collateral (and can accept underlying collateral as deposits as well, which are converted to yield tokens). An Alchemist may contain multiple yield strategies, but may only issue one alAsset (i.e., the alUSD alchemist issues alUSD, but has yield strategies and accepts yield bearing tokens for USDC, USDT, and DAI). Below is an example of how it works with the stablecoin DAI and the Alchemix synthetic stablecoin, alUSD, using the yearn.finance DAI yVault vault. The system works the same for other accepted stablecoins, as well as ETH (and associated yield tokens) and alETH:

  1. User deposits yvDAI into the Alchemist (if user deposits DAI, the Alchemist will first deposit the DAI in Yearn to obtain yvDAI, then accept the deposit.)

  2. User borrows alUSD worth up to 50% of the amount of deposited collateral. Loans will have an absolute minimum 200% collateralization ratio. This means for every 2 DAI a user deposits, the user may borrow up to 1 alUSD.

  3. The yield that accrues to the yvDAI is periodically harvested to repay the debts of depositors. With each harvest, the user's account will be credited a proportional share of the harvest, thus reducing user's debt. If you have deposited DAI, but have not borrowed alUSD, the harvest will increase your alUSD borrow limit.

  4. As yield is harvested, it is transferred to the Transmuter contract.

  5. As the protocol pays down the user's debt, the user can withdraw increasing amounts of DAI from the Alchemist, or the user can re-up their alUSD loan, while always maintaining a minimum 200% collateralization ratio.

  6. At any time the user can repay any portion or all of their debt in order to unlock their collateral. DAI, USDC, and USDT are alUSD are treated as 1:1 by the Alchemist for repayment and self-liquidation. As such, alUSD debt can be repaid with alUSD and/or DAI, USDC, and USDT. Repaying debt with alUSD is also a price-restoring mechanism, because when alUSD price is under $1, users can buy it from AMMs and pay off their debt at a discount.

  7. At any time, you can liquidate a portion or all of your collateral. The contract will repay your alUSD debt using the DAI from your yvDAI collateral.

Essentially, the Alchemists give users a flexible line of credit for their future yield. Users can enter and exit anytime without committing to long lockups. There will never be a liquidation of a user's collateral unless they do it themselves because their debt will only ever go down.

Alchemix value the safety of users' deposits more highly than anything else. Alchemix has undergone multiple audits and carries ongoing bug bounties. While Alchemix does undergo security reviews and audits, there is no guarantee that something bad will not happen. Two additional security measures exist to protect the Alchemical synthetic tokens.

Firstly, there is a limit on how much of each accepted underlying collateral can be deposited into Alchemix to mint alAssets. This limit depends on the level of technical, market, and legal risk for a given asset. Secondly, the Alchemist limits the damage that can be done through the Maximum Loss, Repay Cap, and Liquidate Cap parameters.

ThemaximumLoss looks at the price of a yield token in units of the underlying token. If that falls below the specified maximumLoss (typically between 1 and 25 bps), then various functions associated with the yield token are shut down - specifically liquidate, deposit, depositUnderlying, withdrawUnderlying, withdrawUnderlyingFrom and harvest. Note that in this scenario, the user is still able to withdraw the yield token - just not the underlying collateral. For example, the user can withdraw yDAI, but not DAI.

The Repay Cap and Liquidate Cap are in place to prevent significant arbitrage movements if an underlying collateral asset were to depeg. This gives sentinels time to react to market events. The limits are time-based:

  • Repay Cap - The quantity of debt that can be repaid over a set duration of time. It could specify for example that “10k ETH can be repaid every 10 minutes.”

  • Liquidate Cap - The quantity of an asset that can be liquidated over a set duration of time. It could specify for example that “10k ETH can be liquidated every 10 minutes.”

Repay and Liquidate caps are currently only set for stablecoin collateral, as they are designed to be stably pegged to USD. They are not required for ETH, as ETH is a standalone asset with a floating price.

These security measures will not completely prevent the damage from a stablecoin losing its peg or becoming devalued, but they will protect much of the Alchemist synthetic token's value and backing.

Last updated