Grant Title:
CoW AMM LP Oracle
Author:
@bleu @yvesfracari @ribeirojose @mendesfabio
About You:
bleu collaborates with companies and DAOs as a web3 technology and user experience partner. We’re passionate about bridging the experience gap we see in blockchain and web3.
Additional Links:
Our work for CoW so far:
- [CoW] AMM Deployer: a Safe app to deploy new CoW AMM pools from a Safe Wallet.
- [CoW] CoW Hooks dApps (ongoing): a set of hooks dapps to (to be launched) CoWSwap Hooks Store. Also, we helped the CoWSwap team to develop the store focusing mainly on the hooks simulation feature.
- [CoW] Python SDK (ongoing): we’re helping CoW put together a Python SDK to provide for developers for query on-chain data, managing orders, and integrating with the CoW Protocol’s smart contracts.
- [CoW] Stop-Loss: a safe app UI that allows multisig wallets to fully manage stop-loss orders.
- [CoW] Have I been MEV’d: a suite of bots and a web application integrated with the ZeroMEV API to inform the Web3 community about potential MEV losses.
Grant Category:
Integrations and protocol order flow:
Grant Description:
As presented on this RFG, the grant is related to the creation of a set of smart contracts to create CoW AMM LP oracles. The LP token price is determined by the total number of underlying tokens on the pool, the total number of pool tokens, and each underlying token price. However, to keep the price oracle more resilient to manipulations we will use the proposed solution of considering that the pool is perfectly balanced instead of using the actual instant balances. In that sense we can say that the expected balance of a pool is determined by:
The price of the LP token is defined by the total expected value held by the pool and divided by the supply of the LP tokens. In that sense, the CoW AMM Oracle will also implement the Chainlink Aggregator V3 Interface and allow an owner to change the Oracle address.
To understand more about the grant, we started to develop it here considering only 50/50 pools and with simple tests.
Grant Goals and Impact:
This grant aims to build a secure price tracking system for CoW AMM LP tokens that can resist manipulation attempts. This would open up the possibility of LP tokens being safely used as collateral in lending markets and other DeFi applications, potentially accruing new utility for LP tokens.
Milestones:
Milestone | Time Estimate | Payment (12.5k xDAI + 12.5k COW vested) |
---|---|---|
Oracle development | 3 weeks | 7.5k xDAI + 7.5k COW Vested |
Oracle review and documentation | ~2 weeks after audit result | 5k xDAI + 5k COW Vested |
Oracle development
Core CoW AMM LP Oracle development, including automated tests mainly related to tentatives of oracle manipulation to ensure it is robust. Also, a factory will be developed to facilitate the creation of new oracles in the future. This milestone will be considered done when we send the contracts to CoW and co-select audit teams to review the Oracle contract.
Oracle review and documentation
This milestone includes the solution of all audit feedback. This milestone also includes the writing of the contract’s technical documentation highlighting passive use cases in a README in the git repo.
We propose that milestone payments be released upon each milestone’s approval.
Budget Breakdown:
The budget includes the hourly rates of a developer during the execution and a project manager on a need basis. The xDAI part of the budget shall be paid after each milestone’s completion and the COW shall be vested over 1 year to cover diluted maintenance and related costs for the same period.
The budget doesn’t include audit-related or deployment costs.
Gnosis Chain Address (to receive the grant):
0x554866e3654E8485928334e7F91B5AfC37D18e04
Other Information:
- All the code will be open-source from day 0. We’re open to feedback;
- We’re happy to answer any questions and are open to feedback about this proposal;
- To explore the viability of this proposal and give a glimpse of what we’re envisioning, we developed a PoC of the contracts here.
Terms and Conditions:
By submitting this grant application, I acknowledge and agree to be bound by the CoW DAO Participation Agreement and the CoW Grant Terms and Conditions.