A Comprehensive Testing of 3A DAO lending protocol
What is 3A DAO?
3A DAO is a non-custodial, decentralized, and over-collateralized lending platform that enables users to borrow interest-free against their own tokens used as collateral. Loans are repaid in a Euro-pegged stablecoin called EURO3.
What makes 3A DAO unique?
The 3A protocol addresses four critical challenges for users and protocols:
On-demand, low-cost liquidity: Users can borrow against a wide range of tokens at a zero interest rate.
Deep liquidity on DEXs: Achieve substantial liquidity on decentralized exchanges without the need to incentivize or pay the other side of the liquidity pools.
Sustainable yields and cashback options: Users can enjoy consistent returns and cashback options in a secure and protected environment.
Treasuries management: Efficiently manage treasuries through smart capital allocation.
Please Note: 3A DAO Chosen BuildBear Sandbox for Beta Testing their Lending Protocol with their community. Read here
Testing 3A DAO
In this article, we’ll thoroughly test 3A DAO.
Why 3A DAO? 3A DAO operates based on market dynamics, offering various scenarios to simulate and assess its functionality. This flexibility makes it an ideal choice for BuildBear’s testing needs.
It’s crucial to emphasize that for a comprehensive review of 3A DAO, we must conduct tests covering all transaction types executed on the platform. This includes
(a) creating a vault,
(b) depositing and borrowing transactions,
© repayments, and more.
However, the primary focus is on evaluating the dApp’s performance by manipulating prices and data that impact computations. This test aims to be extensive, going beyond simple vault creation and borrowing; we aim to conduct edge-to-edge testing.
Recognizing the impracticality of testing on the Polygon Mainnet with real funds, we dismiss this option. While the Mumbai Testnet is available, it poses challenges such as time delays and the absence of real tokens.
Could we use local hardhat fork or anvil fork?
Certainly. However, this approach involves impersonating accounts, acquiring ERC20 tokens, and additional steps to monitor transactions and their outcomes. To streamline this process, we opted for BuildBear.io to create a Private Testnet mirroring the Polygon Mainnet. As premium users of BuildBear, the chainID we receive from BuildBear aligns with the forked chainID; for instance, our private testnet, named CONSERVATIVE EETH KOTH
shares the chainID 137
with the Polygon Mainnet
.
Note: Relying on BuildBear’s premium services enables us to efficiently utilize the 3A DAO front end. We have redirected some necessary requests to the public RPC on our BuildBear testnet.
Pre-testing setup: Utilizing the BuildBear Private Testnet Faucet to mint Matic and DAI tokens.
Transaction 1: Created a vault and deposited 10000 DAI without borrowing EURO3 tokens. Since I haven’t borrowed any tokens, the Health Factor is 100.
Please Note:
Health Factor (HF):
When HF hits 1, your vault is liquidated.
When HF > 1.5, your collateral is protected from redemptions.
Liquidation Threshold:
- Your vault will be liquidated when the value of your total collateral hits the Liquidation Threshold.
Fee:
- Part of your loan is sent to the cashback pool.
Total Debt:
- Total EURO3 tokens borrowed.
Total Collateral:
- Value of the total collateral tokens.
Transaction 2: Borrowed 8388 EURO3 Tokens against a Vault collateral of 10K DAI. My health factor reduced from 100% to 1.13%.
Transaction 3: Staked 8346 EURO3 Tokens for 36% A3A APR tokens and gained a 33.81% pool share.
The REAL Test
Advancing Time by a Year: (Using BuildBear utility tools, we successfully advanced time by one year, as illustrated below).
Executing Different Scenarios
To facilitate this, it’s crucial to have the following abilities:
The ability to modify the price of assets.
The ability to save the state of the Testnet at different points of testing, eliminating the need to create multiple Testnets for various scenarios. To achieve this, we utilized the BuildBear utility tool, as demonstrated below, to create a snapshot of the Testnet at the required points.
Case 1: The Price of the Tokens Remains Unchanged. Health Factor is Greater Than One.
We have received 37,627 A3A tokens for our 8346 EURO3 staked tokens for one year.
Subsequently, we unstaked the EURO3 tokens and used 8346 EURO3 tokens to unlock 10,000 DAI tokens in the vault.
Case 2: Price of the Tokens Changing and Health Factor Reduced to 1
As premium users, we utilized the BuildBear Utilities tool to decrease the DAI price from $1 to $0.5. After reducing the DAI price, the health Factor reduced to1, leading to liquidation of the vault. Being on our private Sandbox, we utilized the BuildBear Explorer to execute the liquidation function, as shown below where the
Investigating a few edge cases:
Scenario 1:
Let’s consider a malicious scenario where, for some reason, Chainlink oracle price feeds are not updated, and a malicious user is attempting to liquidate your vault. In this case, the liquidation function call will fail, as shown below.
Scenario 2:
Even though your health factor is greater then 1, a malicious user attempting to liquidate your vault will encounter a failure in the liquidation function call, as shown below.
Conclusion:
While analyzing various scenarios, everything appears to be in order. HOWEVER, IT IS CRUCIAL TO EMPHASIZE that if the Health Factor falls below 1, your vault will be liquidated.
These scenarios underscore the significance of closely monitoring market conditions and carefully assessing the potential risks and rewards associated with borrowing and lending activities on 3A DAO.
Overall, we are pleased with our experience using 3A DAO.
Information in this article shouldn’t be taken as Finance Advice.
Subscribe to my newsletter
Read articles from BuildBear directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
BuildBear
BuildBear
BuildBear is a platform for testing dApps at scale, for teams. It provides users with their own private Testnet to test their smart contracts and dApps, which can be forked from any EVM chain. It also provides a Faucet, Explorer, and RPC for testing purposes.