CoW Protocol
The following guide explains how to use Liquorice quotes to settle trades on CoW swap
Last updated
The following guide explains how to use Liquorice quotes to settle trades on CoW swap
Last updated
From the perspective of Liquorice, trade is performed with the CoW’s GPv2Settlement contract, not directly with the trader.
Therefore, a solver must first and foremost provide the in both trader and effectiveTrader fields of the RFQ message.
CoW settlement signature
During the settlement process, funds from the trader are transferred to the GPv2Settlement contract.
To assemble trades[] argument solver would need to use data from signed CoW’s trader order and configure flags argument according to the trader's signed GPv2Order
However, when creating a GPv2Order to pass it for trader's signature, certain flags should comply with the following:
If the selected kind is GPv2Order.KIND_SELL
Otherwise, if kind is GPv2Order.KIND_BUY, then
CoW’s GPv2Settlement.settle function receives interactions in the following format:
This format reflects that inside CoW’s settlement there are 3 groups of interactions
To interact with LiquoriceSettlement solver should use the second group (index [][1] of array)
Here is what should be contained inside this array:
Approval
When performing the trade, Liquorice Balance Manager contract must have a baseToken approval given by the GPv2Settlement contract.
Interaction with LiquoriceSettlement
To make interaction with LiquoriceSettlement solver would need to use the following field from API:
baseToken
baseTokenAmount
tx
Solidity example
Remaining arguments such as signature and order provided as is.