Grant Application: CoW AMM Expansion
Grant Title:
CoW AMM Expansion
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] MilkmApp : a Safe App designed for creating and managing Milkman orders within the CoW ecosystem. It empowers DAOs to sell tokens while deferring the price determination to execution time, leveraging price checkers for optimal pricing strategies.
- [CoW] Python SDK (ongoing): we’re helping CoW put together a Python SDK to provide for developers for querying on-chain data, managing orders, and integrating with the CoW Protocol’s smart contracts.
- [CoW] Stop-Loss (closing): a Safe app UI to allow for multisig wallets to fully manage stop-loss orders.
- [CoW] Have I been MEV’d (ongoing): a set of bots and a dashboard integrated with ZeroMEV API to help the web3 community to be aware of MEV losses.
Grant Category:
User interface and user experience (UI/UX)
Grant Description:
Following the successful deployment of the CoW AMM Deployer Safe Application, which received positive community and committee feedback, we identified several enhancement opportunities:
- Additional price oracles: Currently, the app relies solely on two audited price oracles (Uniswap V2 and Balancer). Some users are reporting that are missing extra price oracles (example). Additionally, a Chainlink Oracle was developed by one user that needed tokens that weren’t supported by the available options. To support a wider range of tokens and provide more reliable pricing options, we plan to integrate Chainlink, SushiSwap, Uni V3, Pyth, and Balancer Composable Stable Pools oracles.
- Introduce New Pool Invariants: We will add the Constant Weighted Product invariant to offer users more flexibility in liquidity provision ratios.
- User flow: Currently, users must first create a new Safe Wallet before transferring funds to begin using the CoW AMM Deployer. This isn’t the default flow to provide liquidity into pools and can cause issues for the users as reported here. This is going to be solved by integrating the new standalone version of the contracts being desenvolved by the CoW Team. Also, this will allow multiple AMM positions for the same wallet leading to an improvement of the CoW AMM Manager page to track multiple AMMs.
- Balancing liquidity flow: As mentioned in this post and also executed here, balance the liquidity to add it on the CoW AMM isn’t so easy. The best solution is to use TWAP to do it.
Grant Goals and Impact:
Our grant aims to further enhance the CoW AMM Deployer Safe Application developed by us, focusing on specific areas for improvement. By incorporating additional price oracles, including the Chainlink Oracle, and expanding to support new oracles such as SushiSwap, Uni V3, and Balancer Composable Stable Pools, we aim to increase the range of supported pricing data. This initiative not only strengthens the infrastructure but also increases the range of tokens supported.
Additionally, we plan to optimize the user experience by introducing a Constant Weighted Product invariant, making the application independent of the Safe environment, and refactoring the flow for large amounts of tokens. These changes will simplify the process for users, making it easier and more efficient to access and use the CoW AMM. Overall, our grant is geared towards making the CoW AMM Deployer Safe Application more effective and impactful, attracting more liquidity to the CoW Protocol and protecting more users from LVR.
Milestones:
Milestone | Due Date | Payment |
---|---|---|
CoW AMM Oracles | 3.5 weeks | 7k xDAI + 7.25k COW |
Weighted Product Constant | 5 weeks | 10k xDAI + 10.25k COW |
Standalone Contract Integration | 3 weeks | 6k xDAI + 6.25k COW |
TWAP for token balancing | 3 weeks | 6k xDAI + 6.25k COW |
CoW AMM Oracles:
Development of the contracts and full integration with the CoW AMM Deployer APP for the following price oracles:
- Chainlink;
- SushiSwap (using the already Uni v2 contract and integrating with the App);
- Uniswap V3;
- Balancer Composable Stable Pool;
- Pyth;
- RedStone.
Weighted Pool Invariant
The only invariant available for the CoW AMM is the Constant Product. This means that regular users have to be exposed to a 50/50 proportion of each token. With the Constant Weighted Product contract, users would be able to provide liquidity in any proportion of each token.
This milestone also covers the integration of the new pool invariant into the CoW AMM Deployer.
One open item we’d be seeking help from CoW’s team concerns who to call for auditing. Balancer has launched a program to support the developer ecossystem with Certora, who has audited other Balacer contracts. We’d love to understand whether you’d be open to setting up a similar program to help developers get audited from the same teams who have reviewed CoW’s contracts and are thus familiar with your codebase.
Standalone Contract Integration:
CoW team is working on a standalone version of the contracts, which will make possible a smoothier experience for users.
This milestone will include a release of the CoW AMM Deployer for the standalone contract version. This will allow:
- Refactoring to use standalone contracts version (1 week)
- App refactoring to work inside and outside Safe (1 week)
- Refactoring of the “CoW AMM Manager Page” to multiple pools. (1 week)
TWAP for token balancing
CoW AMM can be also used by DAOs (or whales) who want to invest a large amount of tokens. However, these tokens might be not on the right balance that you want to invest in the CoW AMM. With this feature, we will add an additional option so that you can balance your tokens before creating your AMM, using a programmatic order that combines the CoW AMM with TWAP.
Funding Request:
We suggest releasing milestone payments upon the approval of each milestone. All COW payment can be vested over 1 year.
Budget Breakdown:
The budget includes the hourly rates of a developer during the execution and a project manager on a need basis. It also includes the diluted maintenance costs for 1 year. The budget doesn’t cover contract audit 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 during PRs as well;
- We’re happy to answer any questions and are open to feedback about this proposal;
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.