ADADAO Pre-Production Testnet v1.0 User’s Guide and Documentation
From the last 10 months Adadao team have been tirelessly working to deliver best version of everything that we have promised. Team have been committed to deliver a world-class cutting edge tech and mark its presence as one of the top DEFI in Cardano ecosystem.
We are super excited to announce that first version of adadao testnet to be released very soon. This testnet will be the first step towards our endeavor to build a one of the most innovative Stablecoin protocol ecosystem on Cardano.
This article will guide you through what to expect from this testnet and how to work with it.
AdaDAO stablecoin protocol is a service that lets users receive and spend AUSD stablecoin tokens. AUSD Stablecoins are special tokens which are pegged to USD price (1:1) and bailed by Ada over-collateral.
Current user guide is developed for the initial AdaDAO protocol testing version deployed to Pre-Production testnet. The protocol includes the following services:
- Borrowing service
- Deposit to StabilityPool service
- Management service
Current protocol version may be used for testing purposes only. The main goal is to test the user flow, detect and define probable problems, inform the developers about all detected problems, issues and proposals.
Please note that every transaction needs time to be completed, it may take up to 5-10 minutes in Pre-production testnet, so if you get the error like “Cannot read properties of undefined” this probably means that blockchain hasn’t seen the result of a previous transaction. Wait for a while and try again.
You may see the detailed description how to use the services and how to trace transactions in Pre-Production testnet below
Let’s get started
For now there are two ways to start working with the Protocol:
- You may set up Cardano-node, ChainIndex, Cardano-wallet, PAB and frontend on your machine, configure the actual parameters, create a new wallet with Cardano-wallet CLI and start PAB with the newly-created wallet passphrase. After it you may run frontend with the PAB, Cardano-node and Cardano-wallet parameters to get access to the protocol. The detailed instruction is out of scope of this document.
2. For simplifying the process we created a bunch of wallets on the server and provided information for logging in the system. So to start, you should just go to the (link TBA) and enter the given login and password for the desired role (manager-user or common user). User details will be shared later.
After logging in you get an access to the main page, that contains the current protocol configuration information (on the bottom), Deposit AUSD and Borrow AUSD services entry points (in the center) and maybe Management service entry point (out of scope as this is only for the team).
Current protocol configuration contains the following elements:
- Min Collateral Balance — minimal Ada collateral amount that can be deposited on a Vault. Vault collateral balance may be either equal to zero or equal or greater than Min Collateral Balance value. The parameter is set and changed by the Protocol manager (in future — by ADAO token holders).
- Min debt balance — minimal AUSD amount that may be borrowed from the system. Vault debt balance may be either equal to zero or equal or greater than Min debt balance value. The parameter is set and changed by the Protocol manager (in future — by ADAO token holders).
- Min AUSD to invest — minimal AUSD tokens amount that can be invested in Stability Pool. The parameter is set and changed by the Protocol manager (in future — by ADAO token holders).
- Exchange rate — current ADA/USD exchange rate information received from Oracle.
- LIQ ratio — collateral to debt ratio bottom line. If the collateral to debt ratio for a particular Vault becomes lower than LIQ ratio, this means that the Vault is under-collateralized, AUSD tokens, received by this Vault are not backed enough and must be liquidated. The parameter is set and changed by the Protocol manager (in future — by ADAO token holders).
- Stability Fee — fees that system receives when a user borrows AUSD tokens. The fees are taken once for every “borrow AUSD” action, no matter how long the borrower uses these AUSD tokens. The parameter is set and changed by the Protocol manager (in future — by ADAO token holders).
- Individual collateral to debt — acceptable collateral to debt ratio. The parameter is used for calculating the max AUSD tokens amount available for borrowing according to the deposited collateral amount. The parameter is set and changed by the Protocol manager (in future — by ADAO token holders).
Borrow AUSD service
Borrowing AUSD service is a service for getting AUSD tokens bailed by Ada collateral.
Create a vault
If there are no vaults bound to the current user (current wallet id) in the system, the first step is to create a new vault.
Note that creating a vault is a Cardano blockchain transaction so the transaction fee must be paid during this action. Also the minimal Ada amount (2 Ada) must be transferred from the current wallet to the Vault script. This minimal Ada amount remains locked on the script until closing the vault.
After creating a vault a new Vault script UTxO is created with zero debt datum.
The system sees the newly-opened vault as an inactive vault. To continue the user has to activate the vault — this means that the UTxO is verified by the system (UTxO value and Datum must be checked). As a result of the verification, a Vault verification token is minted and transferred to the Vault script UTxO. The verification is necessary because of the Cardano blockchain feature that arbitrary Datum and Value may be put on a newly-created UTxO. UTxO on-chain validation is available only for UTxO spending. (For the future protocol version we found the way to combine open vault and activate vault actions in one transaction).
Note that activating a vault is a Cardano blockchain transaction and transaction fees must be paid.
After activating the vault the following information is available:
- Collateral — Total Ada amount deposited as collateral to the particular Vault. Note, that the collateral amount may be either zero or equal or greater than the Min Collateral Balance defined in Protocol configuration.
- Able to withdraw — Unlocked Ada amount available to withdraw. Note, that after borrowing AUSD tokens, the part (or full) of deposited collateral becomes locked, the formula for calculating Ada collateral to lock is as follows:
locked collateral = D * ER * CTL, where
D — borrowed AUSD tokens amount
ER — exchange rate, provided by oracle
CTL — individual collateral to debt value, defined in protocol configuration
So Able to withdraw collateral amount is calculated according to the formula:
able to withdraw = total ADA collateral — locked collateral
- AUSD debt — total AUSD tokens amount borrowed from protocol by the current vault. Note, that the debt amount may be either zero or equal or greater than Min debt balance defined in Protocol configuration
- Able to borrow — AUSD tokens amount available for borrowing. The value is calculated according to the formula:
Able to borrow = C / (ER * CTL) — D, where
C — total deposited collateral
ER — exchange rate, provided by oracle
CTL — individual collateral to debt value, defined in protocol configuration
D — AUSD tokens amount borrowed by the current Vault
- Vault collateralization — collateral to debt relation for the particular vault. When Vault collateralization becomes below LIQ ratio defined in Protocol configuration, liquidation process for the Vault must be initiated — locked collateral amount becomes seized by the system and AUSD debt value becomes defined as zero.
Depositing collateral is the action for transferring Ada from the user’s wallet to the Vault script.
Total collateral amount after depositing must be equal or greater than the Min Collateral Balance defined in Protocol configuration.
Note that the Depositing collateral is a Cardano blockchain transaction and the transaction fees must be paid.
Withdrawing unlocked collateral is the action for transferring Ada from the Vault script to the user’s wallet.
The resulting Ada collateral amount must be zero or be equal or greater than the Min Collateral Balance defined in Protocol configuration.
Note that the Withdrawing unlocked collateral is a Cardano blockchain transaction so the transaction fees must be paid.
Borrowing AUSD tokens is an action for minting AUSD tokens and transferring them to the user’s wallet. The borrowed amount is also added to the debt value defined in the current Vault UTxO Datum.
After depositing 175 Ada and according to current exchange rate(this will vary as per the current ada price) it’s available to borrow 30 AUSD.
The resulting debt amount must be equal or greater than the Min debt balance value defined in the Protocol configuration.
Note that the Borrowing AUSD tokens is a Cardano blockchain transaction so the transaction fees must be paid.
Getting AUSD tokens from the transaction to the user’s wallet may take some time, please wait for several minutes (3–5 minutes) before using AUSD tokens supposed to be received after the transaction.
Repaying AUSD tokens is an action for burning AUSD tokens taken from the user’s wallet and subtracting burned amount from the debt value defined in the current Vault script UTxO Datum.
After borrowing 30 AUSD tokens, the debt filed has an updated value.
It’s available to repay the whole debt and just a part.
The repaying AUSD token amount cannot be greater than the borrowed amount. The resulting debt amount must be zero or be equal or greater than the Min debt balance value defined in the Protocol configuration.
Note that the Repaying AUSD tokens is a Cardano blockchain transaction so the transaction fees must be paid.
Closing Vault is an action for burning Vault system tokens and transferring locked minimal Ada amount (2 Ada) back to the user’s wallet. The Closing Vault action is available for the Vaults with no debt only.
If there is remaining collateral on it, it is transferred to the user’s wallet with minimal Ada amount. Closed Vault UTxO doesn’t exist anymore.
Note that the Closing Vault is a Cardano blockchain transaction so the transaction fees must be paid.
Deposit AUSD service
Deposit AUSD service is a service for putting AUSD tokens to Stability Pool and getting rewards for it. Stability Pool is a special system pool that provides funds for liquidation processes. The main goal for investing in Stability Pool is getting Ada rewards (up to 20% ADA rewards) for every liquidation. Each user who wants to take part in providing the ADADAO Stablecoin system with stability, may invest his AUSD funds to StabilityPool if the following conditions are complied:
- Provider has enough AUSD funds on his wallet
- Investing funds are equal or greater than minimal AUSD amount to invest (parameter set in Protocol configuration).
Each Provider may invest funds multiple times (with no limitations).
If there are no active investments in Stability Pool and no active Application tokens, you may see the empty balance.
All investments and application tokens are listed on this page (if they exist)
Depositing AUSD is an action for transferring AUSD tokens from a user’s wallet to Stability Pool script UTxO and creating a Receipt script UTxO which contains information about investment in its Datum.
The depositing amount must be equal or greater than the Min AUSD to invest value defined in Protocol configuration.
Note that the Repaying AUSD tokens is a Cardano blockchain transaction so the transaction fees must be paid. Also the minimal Ada amount (2 Ada) is transferred from the user’s wallet to the Receipt script UTxO and locked until the Receipt becomes closed.
Apply For Withdraw
Applying for withdrawal is an action for calculating the rewards amount, minting Application token and transferring it to the user’s wallet, changing the Receipt UTxO Datum according to the calculated rewards. There are two possible ways for withdrawing:
- Full withdraw (calculates the rewards amount and rest AUSD tokens and make Application token for withdrawing rewards and rest AUSD tokens both). After Full withdrawal the Receipt stops participating in liquidation processes and becomes available for closing. If there are no AUSD tokens left on a receipt, full withdraw is the only possible way to handle the receipt (even if you push the Withdraw Rewards button).
- Withdraw rewards (calculates the rewards and rest AUSD tokens and make Application token for withdrawing rewards only, the rest AUSD tokens are put to the Receipt UTxO Datum). After withdrawing rewards the Receipt continues to take part in liquidations.
Note that the Applying for Withdraw is a Cardano blockchain transaction so the transaction fees must be paid.
Receiving Rewards is an action for spending Application token from user’s wallet, burning it inside the transaction, transferring the corresponding Ada (and maybe AUSD) amount from Stability Pool to the user’s wallet.
Note that the Receiving Rewards action is a Cardano blockchain transaction so the transaction fees must be paid.
Closing Receipt is an action for burning Receipt system tokens and transferring minimal Ada amount from the Receipt script UTxO to the user’s wallet. Closing Receipt is available only for the Receipts without AUSD rest and ADA rewards. After Closing the Receipt UTxO doesn’t exist anymore.
Note that the Closing Receipt action is a Cardano blockchain transaction so the transaction fees must be paid.
Management service is available for the protocol manager only. Management service provides the manager with the ability to change protocol configuration (later the change configuration endpoint is supposed to be called automatically after ADAO tokens holders complete the voting process for protocol updating).
Updating protocol parameters is an action for changing Protocol script UTxO datum with new information.
Note that the Updating Parameters action is a Cardano blockchain transaction so the transaction fees must be paid.
Testnet transaction tracing
As the current Protocol version is deployed to Cardano Pre-Production testnet, all the transactions may be traced with Cardano Pre-Production explorer service. There is a suitable way to check transactions by script addresses and trace all the inputs, outputs and mintings. All the current system script addresses will be provided in next article when we announce the testnet date.
Please note, that after restarting the protocol, new system scripts are created, so new script addresses must be provided.