Skip to content

2. Honzon Stablecoin

Bette edited this page Feb 11, 2020 · 10 revisions

1. Overview

The Honzon Protocol is a set of mechanisms to manage aUSD loans with multiple collaterals, monitor and adjust stability of aUSD based on various risk parameters such as collateral ratio, interest rates, debt level etc. We outline a user guide per below to use the Honzon protocol.

2. Guide

[TODO] Get test tokens

  1. Check Required Collateral Ratio
  2. Check Token Prices
  3. Create a Self Serviced Loan for aUSD
  4. Check Loan
  5. Withdraw Residual Collateral & Payback Loan
  6. Liquidate

Mandala Test Network available test tokens

Currency ID Symbol Description
0 ACA Acala network token for fees, rewards etc.
1 aUSD Acala USD stablecoin
2 DOT Polkadot network token DOT
3 BTC Bitcoin

2.1. Via Polkadot UI

2.1.1. Check Required Collateral Ratio

collateral ratio Use Chain state -> cdpEngine -> requiredCollateralRatio to check required collateral ratio for a given token.

On Mandala Test Network, DOT at 160%, and BTC at 150%.

2.1.2. Check Token Prices

check price Use Chain state -> oracle -> values to check price for a given token. Convert the hex value to number.

2.1.3. Create a Self Serviced Loan for aUSD

create loan Use Extrinsics -> honzon -> updateVault to loan out aUSD.

  • currency_id: asset used as collateral
  • collateral: amount to deposit as collateral for this loan
  • debit: the amount to loan out, note this is not aUSD amount, but a debit unit to account for aUSD owed plus accumulated interest etc.

To get debit to aUSD exchange rate, use Chain state -> cdpEngine -> debitExchangeRate. debit rate On Mandala Test Network, the debit to aUSD exchange rate starts at 0.1.

As for the above aUSD example

  • 1 DOT is deposited as collateral for the loan
  • 1500 debit units equivalent to 150.736577445027942000 aUSD will be loaned out
  • with DOT value at about $300, the actual collateral ratio was about 199.02%

2.1.4. Check Loan Status

Check Loan Use Chain state -> loan -> collaterals to check collaterals locked in the loan.

Use Chain state -> loan -> debits to check amount owing, again this is not aUSD amount, but a debit unit to account for aUSD owed plus accumulated interest etc. See above section for obtaining debit to aUSD exchange rate.

2.1.5. Withdraw Residual Collateral & Payback Loan

Withdraw Payback Use Extrinsics -> honzon -> updateVault to withdraw collateral and/or payback aUSD loan.

  • collateral: a negative amount means a withdraw
  • debit: a negative amount means paying back aUSD, again this is not aUSD amount, but a debit unit to account for aUSD owed plus accumulated interest etc. See above section for obtaining debit to aUSD exchange rate.

2.1.6. Liquidate

liquidate Use Extrinsics -> honzon -> liquidate to liquidate a loan at danger.

If a loan is unsafe, that is the collateral ratio of this loan is below the liquidation ratio, then it is deem to be liquidated by anyone with a reward.

Use Extrinsics -> honzon -> liquidationPenalty to check penalty.

As an example, the liquidation ratio is 10%. It is applied on top of the debit amount and paid to the liquidator.

liquidation ratio Use Chain state -> cdpEngine -> liquidationRatio to check.

2.2. Via Acala DApp (Coming soon)

2.3. SDK (Coming soon)

2.4. Check Transaction Details

For Mandala Test Network, you can use Polkascan to check transaction details, and perform various queries.

polkascan

Clone this wiki locally