Closed
Conversation
MartinquaXD
reviewed
Mar 4, 2026
src/infra/dex/bitget/dto.rs
Outdated
Comment on lines
+64
to
+65
| /// Target chain name (same as from_chain for same-chain swaps). | ||
| pub to_chain: ChainName, |
Contributor
There was a problem hiding this comment.
Interesting! So in the cross chain version of cow protocol this solver could already be used. 🚀
MartinquaXD
approved these changes
Mar 4, 2026
Contributor
MartinquaXD
left a comment
There was a problem hiding this comment.
PR looks alright to me but it's always hard to know this definitively when integrating a new API. Can you run this a little bit on staging as a sanity check before merging?
fafk
reviewed
Mar 4, 2026
fafk
reviewed
Mar 4, 2026
fafk
reviewed
Mar 4, 2026
Contributor
Author
Yeah, as soon as the solver is whitelisted. Also, the approach was simplified and now it uses a single |
fafk
approved these changes
Mar 4, 2026
Contributor
Author
|
In favor of cowprotocol/services#4249 |
github-merge-queue bot
pushed a commit
to cowprotocol/services
that referenced
this pull request
Mar 11, 2026
This effectively replicates gnosis/solvers#203 # Summary - Add a new solver that integrates with the https://web3.bitget.com/en/docs/swap/ API to find swap routes, following existing patterns - ~~The Bitget API uses a two-step POST flow: `quote` (to get the optimal routing market and output amount) followed by `swap` (to get the on-chain calldata)~~ The BitGet team suggested using the `request_mod="rich"` param in the `/swap` API, which makes the response contain much more data, including the `outAmount`. - ~~To mitigate the race condition between `quote` and `swap` calls, slippage is applied to the quoted output and passed as `toMinAmount` to the swap endpoint, ensuring consistency between what the calldata enforces on-chain and what the solver reports~~ Not needed anymore because of the previous point - Only sell orders are supported - the Bitget API has no `exactOut` mode # Changes - Bitget API client and DTOs with HMAC-SHA256 request signing, base64 calldata decoding, typed ChainName enum, and serialize::U256 for amount fields - TOML config loading (endpoint, chain-id, api-key, api-secret) - E2E tests: market sell order, buy order rejection, insufficient liquidity, and out-of-price limit order - `config/example.bitget.toml` - Example configuration # How to test New unit and manual e2e tests (ignored by default).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Bitget API uses a two-step POST flow:The BitGet team suggested using thequote(to get the optimal routing market and output amount) followed byswap(to get the on-chain calldata)request_mod="rich"param in the/swapAPI, which makes the response contain much more data, including theoutAmount.To mitigate the race condition betweenNot needed anymore because of the previous pointquoteandswapcalls, slippage is applied to the quoted output and passed astoMinAmountto the swap endpoint, ensuring consistency between what the calldata enforces on-chain and what the solver reportsexactOutmodeChanges
config/example.bitget.toml- Example configurationHow to test
New unit and manual e2e tests (ignored by default).