Algorand Bounties Algofi Recursive Borrowing
Q82. Let’s look at AlgoFi Recursive borrowing! This is where you supply the same asset you borrow. How many users are supplying and borrowing the same asset on AlgoFi ? What is the average amount of each asset being supplied for recursive borrowers? How much rewards did they receive in 2022 ? What is the percent of these users of total suppliers & borrowers ? Note any other interesting findings relating to AlgoFi recursive borrowing Tips https://docs.algofi.org/algofi-lending/master/depositing-funds https://docs.algofi.org/algofi-lending/master/borrowing-assets https://docs.algofi.org/algofi-lending/mainnet-contracts Tips: Check out the AlgoFi docs for more detail https://docs.algofi.org/protocol/mainnet-contracts -Each Market Address in the docs is the where a wallet will send and receive their assets when providing liquidity, borrowing, repay borrowing, and withdrawing liquidity. The same is with the corresponding Market App ID. Providing liquidity will be sent to the Market Address(in a axfer or pay transaction depending on the asset) and will share a group transaction with the Market App ID. The application call transaction with the Market App ID will have a transaction message of ‘Market: mt’(i.e. try_base64_decode_string(tx_message:txn:note::string) = ‘Market: mt’) When borrowing liquidity will be transferred to the wallet from the Market Address in an inner transaction. The parent transaction(shares the same tx_id with the inner transaction) will be an Application transaction and have a corresponding Market App ID to the asset. The parent application transaction will also have a transaction message of “Market: b” indicating a borrow(i.e. try_base64_decode_string(tx_message:txn:note::string) = ‘Market: b’) Repaying a borrowed loan will appear similar to a wallet providing liquidity, however, the application call transaction with the Market App ID will have a transaction message of ‘Market: rb’(i.e. try_base64_decode_string(tx_message:txn:note::string) = ‘Market: rb’) Finally withdrawing liquidity from AlgoFi will behave similar to the borrowing liquidity transactions except the parent application transaction will have a transaction message of “Market: rcu” indicating a borrow(i.e. try_base64_decode_string(tx_message:txn:note::string) = ‘Market: rcu’)