PolySwap: Automated DeFi Swaps Powered by Predictive Markets
This project will be developed by :
In this github organisation where there is already the code done during the hackathon : EthGlobalBangkok repositories · GitHub
Baptiste is a blockchain engineer and entrepreneur formerly cofounder and CTO of Nefture a web3 security startup. He has extensive experience in launching web3 projects and has won multiple hackathon prizes.
Lucas is a computer science student at EPITECH, passionate about web3, building blockchain projects beside school. He’s doing an internship at Kiln, leading player in the staking ecosystem. He’s motivated to build a significant project to build up his experience.
ETHGlobal project page with some pictures of the telegram mini app : PolySwap | ETHGlobal
Other: new use case using CoW Swap Smart orders
PolySwap allows for the automatic trigger of DeFi swaps based on predictive markets like Polymarket. The project was awarded during ETH Global Bangkok 2024 and its team is pushing for its development and release.
The value proposition is simple:
PolySwap enables web3 users to seamlessly automate trading execution based on real world predictions.
For the first version, we plan to deploy the protocol on Polygon POS to have native compatibility with Polymarket.
In upcoming versions, we plan on expanding deployments to all CoW compatible chains using cross-chain messaging technologies like LayerZero read for example in order to connect a swap on any chain with any prediction market.
We also plan on creating a widget that could directly be integrated in various apps frontend like Polymarket or wallets.
This project bridges DeFi automation with real-world predictive markets, offering users a powerful tool to manage risk and make smarter market decisions. With a simple frontend interface, it’s accessible to anyone.
This DeFi tool will allow CoW users to access a whole new way to automate their trading workflows with trustless prediction market triggers. PolySwap is a very good way to demonstrate the power of the CoW Swap modular intent based architecture, potentially drawing new eyes to the CoW ecosystem.
This grant aims at reaching a first functioning proof of concept version of the product deployed on Polygon. The goal is to test the use case, get feedback on the UX and gauge initial market traction. The learnings from this first iteration will allow us to plan a second iteration that would also include a security audit.
| Milestone | Due Date | payment | | --- | --- | --- | | PolySwap IConditionalOrder contracts development and deployment | 2 weeks | 2k xDAI + 750 CoW | | Frontend dapp design | 3 weeks | 500 xDAI + 500 CoW | | Dapp development and deployment | 6 weeks | 3.5k xDAI + 1.5k CoW |
Implement an IConditionalOrderGenerator smart contract capable of interpreting the staticInput of a ComposableCow order and verifying whether the prediction market trigger has been met.
The prediction market trigger is defined by a target price for a specific outcome token. However, this price is not stored on-chain. Instead, we can simulate this behavior by creating a Polymarket order at the target price and checking on-chain whether it has been fulfilled.
This allows us to determine whether the market price has reached the specified threshold.
The getTradeableOrder(...) function will accept the Polymarket order hash as part of the staticInput, and the verify(...) function will call getOrderStatus(orderHash) from the Polymarket CTFExchange contract.
It will check that:
This ensures the order was filled and not just cancelled.
Finally, the contract will be deployed on Polygon.
Stack: Foundry
Design a user experience that clearly communicates how to create, track, and modify swap intents based on prediction market triggers.
Pages:
Stack: Figma
Convert the Figma design into a fully functional Next.js application. Use Wagmi.sh for wallet connection, and implement a backend service with a database to index and serve relevant on-chain data.
When a Polyswap order is created:
Stack: Next.js, Wagmi.sh, Node.js, PostgreSQL
We propose that milestone payments be released upon each milestone’s approval.
This funding would allow us to support the necessary development time to achieve completion of this project’s first proof of concept version. Reaching this first milestone would then open us to many other grant opportunities with different chains, prediction market solutions and other compatible web3 projects.
gno:0x20D3Ab73226A5121Da6F2a33C8F78538f4F8D30a
Alex Viñas
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.