This protocol is designed to automate the selection and rebalancing of yield-generating assets on Ethereum using Chainlink Functions and Chainlink Automation. It dynamically fetches the highest APY (Annual Percentage Yield) from leading lending protocols and triggers rebalancing in a core contract, ensuring optimal yield for users.
Yield optimization in DeFi is challenging due to the rapidly changing rates across protocols. Manually monitoring and reallocating funds is inefficient and error-prone. There is a need for a trustless, automated solution that continuously tracks yields and reallocates assets to maximize returns.
This protocol leverages Chainlink Functions and Automation to provide a fully automated, decentralized yield optimization system:
-
Automated Scheduling:
Chainlink Automation triggers the protocol at regular intervals (e.g., daily) to check if a rebalance is needed. -
Off-chain Data Fetching:
Using Chainlink Functions, the protocol fetches APY data from Defilama, filtering for eligible pools on Ethereum from protocols like Aave, Compound, and Spark. -
Selection Logic:
The fetched pools are filtered and sorted by APY. The pool with the highest APY is selected. -
On-chain Update:
The protocol decodes the result and updates the core contract with the new optimal asset, APY, and protocol. -
Rebalancing:
The core contract'striggerRebalance
function is called, reallocating funds to the new optimal yield source. -
Access Control:
Only the contract owner or the Chainlink Automation contract can trigger sensitive functions, ensuring security.
-
Network: Sepolia Testnet
Note: Due to the lack of real APY data APIs on testnets, this protocol demonstration uses mainnet data sources.. -
Eth Seploia Deployed Addresses:
- AegisCore Contract: 0xCd4A9CbA195675d04157f508543e8b6e002759bF
- Automation Contract: 0xb3e10fd45402C314c17da0bB253565D13370981a
- Other Relevant Contracts: 0x0Ce29C4222EDB06FA4f28Cf3a3029fa4175cfCDf