TWAP Orders
Grant Title: Time-Weighted Average Price (TWAP) Orders
Author:
- GitHub: mfw78 (mfw78) · GitHub (see also rndlabs · GitHub).
- Gitcoin: https://gitcoin.co/mfw78
About You:
- Experienced in technical systems analysis, design and implementation with a strong emphasis on risk management / gap analysis.
- Experienced technical writer in mission-critical, highly regulated, and technical industries.
- Actively independently developing with emerging decentralised technologies, including Swarm and Waku.
Additional Links:
- safe-cow: GitHub - rndlabs/safe-cow: Gasless EIP-1271 token swaps on Cowswap - implementing EIP-1271 signature aggregation for Safe trading via Cowswap API.
Grant category: Protocol Order Flow / Developer tools
Grant Description:
Problem: Currently DEX aggregators / AMM marketplaces only provide market and limit order types. Conversely, on a TradFi exchange, more advanced order types are available, providing utility to traders.
Solution: By making use of EIP-1271 smart contract orders, implement more advanced order types, with this grant specifically targetting TWAP (Time-weighted average price) orders.
Grant Goals and impact:
- Increase CoW protocol utility through DeFi-market unique order types (e.g dollar-cost averaging by use of TWAP orders).
- Increase concentration of orders by timing, leading to increased likelihood of CoWs.
Milestones:
Basic TWAP:
Basic TWAP logic would be implemented as multiple fixed size orders, with constant time spacing, enforcing a user-specified floor / ceiling price (sell / buy) as appropriate. Deliverables include:
- Implement a user-upgradeable proxy contract with TWAP logic. This would allow users to upgrade their deployed proxy’s implementation contract, yielding gas savings on token approvals, and contract deployments.
- Implement a factory contract for user’s to deploy contracts from (1).
- Comprehensive test suite for contracts.
- Example script for submitting TWAP orders off-chain to Cow protocol.
- Documentation for integrators / developers.
Grant Timeline:
Complete by end of January 2023.
Note: The above timelines do not make for allowances / timing associated with audit completion.
Funding Request:
$10,000. Half paid up-front ($5,000), with the remainder paid upon satisfactory completion of code as determined by the member(s) of the CoW team.
Budget Breakdown:
- $10k: development / labor cost.
This budget does not include any costs associated with audit by a 3rd party. It is expected that CoW would undertake the necessary steps / cost for audit. Any cost overruns associated with meeting the standards of an external audit (additional testing / code fixes) would be paid out of the development cost.
Gnosis Chain Address (to receive the grant):
0x070E0a700E36D303a0Ce3fe37976dD70974D7883
Other Information: As an active member of the CowDAO Grants Committee, I hereby refrain from voting / signing on this proposal so as to eliminate conflicts of interest. In determining the timelines associated with this Grant, I have taken into consideration workloads due to my position as a Committee member, 3rd party work, and allowed appropriate buffer to ensure the Grant Committee’s continuance.
Referral: N/A
Terms and conditions:
By applying for this grant, I agree to be bound by the CowDAO Participation Agreement and the COWDAO Grant Terms and Conditions