Grant Application - PolySwap

Grant Application: PolySwap

PolySwap: Automated DeFi Swaps Powered by Predictive Markets


Author:

This project will be develop by :

In this github organisation where there is already the code done during the hackathon : EthGlobalBangkok repositories · GitHub


About You:

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.


Additional Links:

ETHGlobal project page with some pictures of the telegram mini app : PolySwap | ETHGlobal


Grant Category:

Other: new use case using CoW Swap Smart orders


Grant Description:

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:

  1. the user selects a prediction market. For example, the winner of a presidential election or the performance of a new “state of the art” AI model,
  2. they then create a PolySwap order through CoW to trigger a swap in the conditions where the selected market’s odds reach a certain threshold,
  3. once the condition is achieved on-chain, solvers can execute the swap autonomously without the need for the user’s input

PolySwap enables web3 users to seamlessly automate trading execution based on real world predictions.

For the first version, because CoW Swap smart orders aren’t compatible with Polygon yet, we are using the prediction market limitless on Base.

We plan to deploy the second version of the protocol on Polygon POS once CoW is deployed there.
In upcoming versions, we plan on expanding deployments to all CoW compatible chains using cross-chain messaging technologies.


Grant Goals and Impact:

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. :rocket:

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.


Milestones:

Please identify the key milestones that will help track the progress of your grant. Use the provided table as a summary and expand on each milestone description and deliverables below.

Milestone Due Date payment
PolySwap contracts development and deployment 6 weeks 4k xDAI + 1k CoW
Open source solver 6 weeks 500 xDAI + 500 CoW
Frontend dapp design 3 weeks 250 xDAI + 250 CoW
Dapp development and deployment 6 weeks 250 xDAI + 250 CoW

Contracts development and deployment (6 weeks)

Create a smart contract able to read a CoW intent, verify that the prediction market’s trigger was achieved, and execute the swap through CoW swap.
Deploy the contract on Base.

Open source solver (1 week)

The PolySwap solver will continuously monitor prediction market outcomes and, once predefined conditions are met, trigger the execution of a corresponding CoW Swap intent. It validates both market resolution and swap parameters, ensuring seamless, trustless automation of conditional DeFi trades through the CoW Protocol infrastructure.

dApp development (3 weeks)

  1. design

Design a user experience capable of clearly conveying how to create, track and modify prediction market based swap intents.

  1. development

Integrate the design as a NextJS web application, integrate wagmi.sh for wallet connection, create a backend and database to index and serve on-chain data.


Funding Request:

We propose that milestone payments be released upon each milestone’s approval.


Budget Breakdown:

This funding would allow us to support the necessary development time to achieve completion of this project’s. Reaching this first milestone would then open us to many other development opportunities with different chains, prediction market solutions and other compatible web3 projects.


Gnosis Chain Address (to receive the grant):

gno:0x20D3Ab73226A5121Da6F2a33C8F78538f4F8D30a

Other Information:

  • All the code will be open sourced and is already
  • Feel free to provide any other trigger for the swap or something else that you think about and that can be added in the grant
  • We’re happy to answer any questions and are open to feedback about this proposal

Referral:

Alex Viñas


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.

Hi! Thanks for the grant application :folded_hands:

For a better analysis of the scope, can you please elaborate on a few points:

  1. What is meant by “Open source solver”?
  2. Can you please elaborate on how the smart contracts / general user flow will fit together?

It would be helpful if you had a minor sketch of how various components interact, so that we can be sure what everyone is talking about and this will enable a better analysis / feedback on the grant application :folded_hands:

2 Likes

Thanks for the feedback!

To clarify, when we refer to the “solver” in the context of PolySwap, we’re not referring to a full-fledged CoW Protocol solver that participates in batch auctions, but rather to an off-chain trigger executor that monitors prediction market outcomes and executes user intents once predefined conditions are met.

The PolySwap solver continuously listens to both:

  1. Prediction market contracts (e.g., Limitless on Base) to detect when an outcome threshold is reached,
  2. User-submitted intents.

When a condition is fulfilled, the PolySwap solver verifies the outcome by reading on-chain data from the prediction market, validates the user’s intent parameters (e.g., expiry, approvals, slippage), and then triggers the PolySwap smart contract to commit the corresponding CoW Swap order on-chain. This ensures that the swap is only made available to CoW solvers once the user-defined market condition is provably satisfied, enabling secure and trustless execution through the CoW Protocol infrastructure.

We plan to open-source this component for transparency and decentralization, and we’re also considering implementing it as a plugin, extension, or fork of the official CoW Swap solver client to stay aligned with existing infrastructure. This would enable smoother integration and potentially broader adoption within the CoW ecosystem.

Here is a diagram of the interactions:

Happy to clarify further if needed!
Thank you again for your time

1 Like

I think that the architecture still has some underlying issues / dependencies that are perhaps much more difficult than may be anticipated.

Getting any solver support is a very, very difficult undertaking, especially if it requires any nuanced handling. I understand that you need to have some mechanism that allows for the monitoring of the polyswap market place.

I think this area of “Polyswap Solver (Trigger Executor)” → Settles CoW Intent (as well as the Polyswap Smart Contract “Commits CoW intent”) needs very thorough explanation / architectural review to be able to satisfactorily determine whether the scope / architecture proposed is feasible and/or practicable.

Ultimately, if things are done with ERC-1271 orders and/or for example with the ComposableCoW framework, conditions (such as external dependencies on some prediction market) can be built into an order and then you merely just need some service running (such as the watch-tower that can monitor the order by polling on-chain and then submit it to the CoW Protocol API for inclusion in the auction).

I would encourage to review the above and revise the architecture as it doesn’t seem clear enough as currently presented.

1 Like

Thank you for the great feedback. After review, the ComposableCow framework is exactly what we need to make PolySwap work.

Here is the new diagram showing how the protocol would work:

New constraint

A new constraint inherited from this design is the need to limit usage of the protocol to Safe wallets following the current prerequisites for TWAPs.

Limitless state verification

On the side of checking limitless prediction market states, everything can be done on-chain, each market is represented by an ERC20 contract which has a public calcBuyAmount(uint256) read function. The ratio of input / output is a direct representation of the odds of the prediction market.

Updates on the grant proposal

These changes have an impact on the initial proposal we made. Here is the change log:

  • remove open source solver milestone (and funding)
  • rebalance development funding from the contract to the dApp

Updated version of the grant proposal :down_arrow:

Grant Description:

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:

  1. the user selects a prediction market. For example, the winner of a presidential election or the performance of a new “state of the art” AI model,
  2. they then create a PolySwap order through CoW to trigger a swap in the conditions where the selected market’s odds reach a certain threshold,
  3. once the condition is achieved on-chain, solvers can execute the swap autonomously without the need for the user’s input

PolySwap enables web3 users to seamlessly automate trading execution based on real world predictions.

For the first version, because CoW Swap smart orders aren’t compatible with Polygon yet, we are using the prediction market limitless on Base.

We plan to deploy the second version of the protocol on Polygon POS once CoW is deployed there.

In upcoming versions, we plan on expanding deployments to all CoW compatible chains using cross-chain messaging technologies.


Grant Goals and Impact:

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.


Milestones:

Please identify the key milestones that will help track the progress of your grant. Use the provided table as a summary and expand on each milestone description and deliverables below.

Milestone Due Date payment
PolySwap IConditionalOrder contracts development and deployment 2 weeks 1.5k xDAI + 500 CoW
Frontend dapp design 3 weeks 250 xDAI + 250 CoW
Dapp development and deployment 6 weeks 3k xDAI + 1k CoW

Contracts development and deployment (6 weeks)

Create a IConditionalOrder smart contract implementation able to interpret the staticInput of a ComposableCow order and to verify if the prediction market trigger was achieved or not.

Deploy the contract on Base.

dApp development (3 weeks)

  1. design

Design a user experience capable of clearly conveying how to create, track and modify prediction market based swap intents.

  1. development

Integrate the design as a NextJS web application, integrate wagmi.sh for wallet connection, create a backend and database to index and serve on-chain data.

This might not be enough though.
If the swap involves tokens that require solvers to integrate specific contract calls (or routes e.g. redeeming outcome tokens), then still there’s a need for special solver integration - regardless of how the conditional orders get indexed into the CoW orderbook.

But yeah generally I agree that a more detailed technical scope document is required.
I do think this could be a cool use case that demonstrates CoW’s programatic order capabilities

I’m not sure if our message from April 21st suits this need? If not, could you please guide us on which part needs more technical explanation?

In our case, it would be a simple read call that reverts if the prediction market condition set by the user is not met. In my understanding, this is exactly the type of use case conditional orders were designed for so we should not need any special solver integration.

Hey @Pybast @intermarch3 sorry for the late reply!
I think the use case is very cool, it demonstrates the unique capabilities of CoW conditional orders and could expose new appealing features for users.

I think the contract would require an audit that’s not included in this proposal and will add to the cost though.

Happy to hop on a call to flesh out the details, feel free to DM on TG @Che_gev