Safe Composable Conditional Orders
Grant Title: Safe Composable Conditional Orders
Author:
- GitHub: mfw78 (mfw78) · GitHub (see also rndlabs · GitHub).
- Gitcoin: https://gitcoin.co/mfw78
- Mirror: mfw78.eth
About You:
- Experience 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.
- cowswap-twap-orders: GitHub - rndlabs/cowswap-twap-orders: 🐄🐮 Time-weighted average price orders for CoW Protocol - implementing TWAP orders for Safe trading via Cowswap API.
Grant category: Protocol Order Flow / Developer Tools
Grant Description:
Problem: With the limitless options available for EIP-1271 orders, there becomes a need to develop a standard by which orders can inherit from, such as to reduce the number of contract deployments required, increase gas efficiency and smooth the UX.
For example, the recent Cowswap TWAP Orders while providing an innovative method for storing only a signature of the TWAP and therefore providing gas efficiency, this method requires a new Fallback handler for each type of conditional order.
Solution: Implement a “Conditional Order Router” Fallback handler, with Conditional Orders being summarised in a merkle tree, whose root is signed by the Safe to assert truthfulness. This method would allow limitless simultaneous conditional orders meeting innumerable use cases.
Grant Goals and impact
- Increase CoW protocol utility through composable DeFi-market unique order types.
- Reduce UX friction for multiple conditional order types.
Milestones:
- Implement a
MerkleConditionalOrderFallbackHandler
contract that provides stock Safe functionality, while allowing authorisation of limitless types of conditional orders. - Update TWAP orders:
a. Add support for new Merkle Tree storage.
b. Add support for Milkman price checkers. - Adapt
PerpetualStableSwap
andTradeAboveThreshold
for Merkle Tree storage (implementation of these conditional order types out of scope for audit). - Revise the Tenderly Web3 Action to support composable conditional orders.
- Revise the
CLI
tool to allow creation of composable conditional orders (eg. create TWAP andTradeAboveThreshold
).
Grant Timeline:
Phase 1: 4 weeks FTE.
Note 1: Full-Time Equivalent (FTE) corresponds to 40 hrs / week
Note 2: The above timelines do not make for allowances / timing associated with audit completion.
Funding Request:
Phase 1: $10,000.
Payment terms: Half paid up-front at the commencement of each phase 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