Evaa Protocol:
Evaa is a decentralized financial protocol to enhance the lending and borrowing of digital assets in the DeFi space. It hinges on collateralization to ensure that loans are secure. When collateral value drops to a certain level, intervention becomes necessary.
Liquidation Bots:
In DeFi, quick market downturns can put loans at risk. Liquidation bots are automated tools that vigilantly monitor the market for these vulnerable positions on platforms like Evaa. Upon detection, they automatically initiate the liquidation process. This proactive approach is vital in preserving the integrity, stability, and trustworthiness of the lending ecosystem.
Hack-ton-berfest:
An iteration of the renowned Hacktoberfest, Hack-ton-berfest is a month-long ode to open-source software celebrated every October. Developers worldwide converge to enhance open-source projects, ensuring the software community continues to thrive and innovate. Link: https://society.ton.org/hack-ton-berfest-2023
Evaa Hackathon:
Running parallel to Hack-ton-berfest, the Evaa Hackathon zeroes in on the creation and enhancement of liquidation bots tailored for the Evaa ecosystem. It's a pedestal for developers to manifest their skills, bring value to the rapidly evolving DeFi space, and seize opportunities for rewards and acclaim. Link: https://evaa.gitbook.io/evaadev/
🌍 A Global Invitation:
We're reaching out to developers, DeFi enthusiasts, and innovative minds across the globe!
- Engage with the global open-source community via Hack-ton-berfest.
- Showcase your DeFi acumen and prowess through the Evaa Hackathon.
🔗 Deep Dive into DeFi:
Are you eager to unravel more about DeFi and our innovative protocol? Could you jump into the conversation on **Protocol Hub **? This hub is a nexus for vibrant discussions, creativity, and insights and serves as a direct channel to engage with the core Evaa team.
🚀 Join the Movement:
Don't let this golden opportunity slip away. Dive in, contribute, foster connections, and be a pivotal part of sculpting the financial future. Let's architect the next big thing in DeFi together in our Evaa Protocol Hub: https://t.me/EvaaProtocolHub
- Description: Retrieves wallet data, such as the balance.
- Usage:
myBalance.usdt = (await tonClient.runMethod(jettonWallets.usdt, 'get_wallet_data')).stack.readBigNumber();
- Arguments:
- Wallet address (e.g.,
jettonWallets.usdt
)
- Wallet address (e.g.,
- Return:
assetBalance = Uint(64);
- Description: Returns data about assets.
- Usage:
const assetsDataResult = await tonClient.runMethod(masterAddress, 'getAssetsData');
- Name: getAssetsData
- Arguments:
- Master address (e.g.,
masterAddress
)
- Master address (e.g.,
- Return:
[
Dict<key: int256, {
sRate = Uint(64);
bRate = Uint(64);
totalSupply = Uint(64);
totalBorrow = Uint(64);
lastAccural = Uint(32);
balance = Uint(64);
}>
]
- Description: Returns the asset configuration.
- Usage:
const assetConfigResult = await tonClient.runMethod(masterAddress, 'getAssetsConfig');
- Name: getAssetsConfig
- Arguments:
- Master address (e.g.,
masterAddress
)
- Master address (e.g.,
- Return:
[
Dict<key=tokenId: int256, {
oracle = slice;
decimals = Uint(8);
collateralFactor = Uint(16);
liquidationThreshold = Uint(16);
liquidationPenalty = Uint(16);
baseBorrowRate = Uint(64);
borrowRateSlopeLow = Uint(64);
borrowRateSlopeHigh = Uint(64);
supplyRateSlopeLow = Uint(64);
supplyRateSlopeHigh = Uint(64);
targeUtilization = Uint(64);
}>
]
- Description: Returns all user data related to the smart contract.
- Usage:
userDataResult = await tonClient.runMethodWithError(userContractAddress, 'getAllUserScData');
- Arguments:
- User smart contract address (e.g.,
userContractAddress
)
- User smart contract address (e.g.,
- Return:
[
Dict<key=: int256,{
codeVersion = Uint(64);
userAddress = Uint(64);
userPrincipals = {
ton?: Uint(64),
usdt?: Uint(64),
usdc?: Uint(64),
};
}>
]
If the loan asset is TON (TON Crystal), the following steps are performed:
- Set the liquidation opcode to
0x3
. - Store the query ID, which can be
0
. - Store the user's wallet address (not the user SC address). This address is used to calculate the user SC address.
- Store the ID of the token to be received. It's a SHA256 HASH derived from the Jetton wallet address of the EVAA master smart contract.
- Store the minimal amount of tokens required to satisfy the liquidation.
- Set a constant value of
-1
(can always be-1
). - Reference the
pricessCell
, which contains prices obtainable from the IOTA NFT. - Conclude the cell.
Amount to send: task.liquidationAmount
, minus 0.33
for blockchain fees. The EVAA smart contract will calculate the amount of collateral tokens to send back based on this number.
Destination address: evaaMaster
.
For loan assets other than TON, the following steps are performed:
- Set the jetton transfer opcode to
0xf8a7ea5
. - Store the query ID, which can be
0
. - Store the amount of jettons to send (The EVAA smart contract will calculate the amount of collateral tokens to send back based on this number).
- Store the address of the jetton receiver smart contract, which is the EVAA master.
- Store the address of the contract to receive leftover TONs.
- Set a bit to
0
. - Store the TON amount to forward in a token notification (Note: Clarification needed).
- Set another bit to
1
. - Reference a sub-cell, which replicates the TON liquidation logic.
- Conclude the main cell.
Amount to send: toNano('1')
for transaction chain fees (Note: Clarification needed).
Destination address: The Jetton wallet associated with the loan asset.
This code provides a clear explanation of the liquidation process, with detailed comments to understand each step.