Inspiration
Libree wants to enables DAOs to become more effective in DeFi. Currently most DAOs only include voting features and require the use of external and manual tools. This is why we have developed a DeFi AI plugin that allows DAOs to create a custom investment strategy in just a few clicks.
What it does
Our plug in allows the following: 1) The DAO fills in a form within the DAO with the following fields: investment goal e.g. "maximise returns with gaming tokens", their risk profile e.g. low risk, amount to invest e.g. 10,000USDC and token e.g. LINK, BTC and ETH. 2) Chat GPT comes back to the DAO with a proposed strategy that includes weights and a rational 3) The DAO reviews this proposal and approves it 4) The plugin executes all embedded proposal actions automatically without any further action from the DAO and persists the parameters on-chain 5) Chainlink Automation monitors these parameters on chain 6) Chainlink Functions makes a consultation to chat GPT to check if a rebalance is required 7) If chat GPT believes the benefits of a rebalance outperforms cost and risk then Chainlink Automates will rebalance the portfolio
All of these actions take place automatically without the need of the DAO to take any further action.
How we built it
Aragon plugin: This plugin is designed for the Aragon OSx platform and enables the extension of functionality and contracts within DAOs. By utilising this plugin, DAOs can establish strategies in their smart contracts and expose public functions that allow for treasury rebalancing when specific conditions are met. Chainlink Automation: A job within Chainlink automations is responsible for monitoring the conditions set for rebalancing, such as the strategy and rebalance period. When it detects that a rebalance is required, it triggers the rebalance function, which in turn calls the necessary Chainlink functions. Chainlink functions: These functions receive requests from the DAO contracts along with the parameters set for risk tolerance. Based on the current distribution of the treasury and the cost associated with rebalancing, these functions propose rebalance weights. The proposed weights are then sent back to the contract and executed using the Chainlink automation. In summary, the Aragon plugin allows DAOs to set rebalancing strategies and expose functions for treasury rebalancing. Chainlink automations monitor the conditions for rebalancing and trigger the rebalance function, which interacts with Chainlink functions to propose and execute rebalance weights based on the specified parameters.
Challenges we ran into
The most challenging aspect was retrieving the response from Chainlink functions callback and converting it into a Solidity object that could be used to automate the strategy. To address this, we are sending a string to the contracts containing the action to be taken, the reason, and the weights. We then parse this data in the contract, splitting all the data to apply the necessary conversions to obtain a Solidity object. The complexity of managing and converting this data in a blockchain context presented a significant hurdle, but we have devised a practical solution.
Accomplishments that we're proud of
We have successfully implemented artificial intelligence as a key component within a DAO, automating the entirety of the DAO's treasury management through a DeFi AI strategy. This has been accomplished by utilising Chainlink functions to establish communication between the AI model, ChatGPT, and the DAO. Messages sent and received via this connection translate into actions that activate within the smart contracts.
We take great pride in having developed a framework that enables DAOs to engage with AI and initiate actions executed on the blockchain. This achievement represents the seamless integration of AI and blockchain technology within a fully decentralised environment.
What we learned
During the execution of this project, we gained a more in-depth understanding of Chainlink products and their functionalities. We were astounded by how Chainlink functions could create a plethora of opportunities to automate actions within smart contracts. Furthermore, we acquired knowledge on how to interact with large language models and parse messages, all thanks to Langchain. This experience helped broaden our perspective on automation and AI, demonstrating how they could be utilised in enhancing decentralised systems.
What's next for Libree
Libree's mission is to enable DAOs to become more ingrained in the DeFi landscape. To this end, we are developing a suite of tools that will allow any DAO to transform into an investment club, equipped with everything needed to manage their assets in an open and equitable manner.
In this vision, we see Chainlink playing a pivotal role by providing the necessary infrastructure that allows DAOs to interact with off-chain data. Chainlink facilitates automation of complex functions using Chainlink's functions. This will drive our future developments as we strive to blend the capabilities of decentralised finance, autonomous organisations, and advanced AI.
Built With
- aragonosx
- chainlink-automations
- chainlinkfunctions
- nextjs
- openai
- solidity
Log in or sign up for Devpost to join the conversation.