Instruction Mode API
Overview
- Partner code must be agreed upon in advance and passed through the header:
Partner-Code; - Currently supported chains: ETH, SOL, BNB chain, Base, Polygon, Arbitrum, Morph. Please notify us in advance for integration with other chains;
- Transaction fees:
- Currently, fees are collected in our contract and settled periodically;
- Custom fee collection addresses are under development;
HTTP Status Code Definitions
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 403 | Forbidden (Not whitelisted or signature error) |
| 429 | Too many requests (Rate limited) |
Quote API
Request Path: /bgw-pro/swapx/pro/quote
Request Method: POST
Request Parameters:
| Field Name | Field Type | Required | Description |
|---|---|---|---|
| fromSymbol | string | No | Source token name |
| fromContract | string | Yes | Source token contract address, pass empty string for native token |
| fromAmount | string | Yes | Quote amount (input amount) |
| fromChain | string | Yes | Source chain |
| toSymbol | string | No | Target token name |
| toContract | string | Yes | Target token contract address, pass empty string for native token |
| toChain | string | Yes | Target chain |
| fromAddress | string | No | Debit address, used for gas estimation. If not provided, a default address will be used for gas estimation |
| toAddress | string | No | Recipient address |
| txOrigin | string | No | Transaction initiator address passed to RFQ market makers to help them classify flow. Optional; falls back to fromAddress when omitted. See “About txOrigin” below. |
| estimateGas | bool | No | Whether to estimate gas, default is false. Should be used together with fromAddress |
| market | string | No | Specify quote channel, e.g., uniswap.v3, pancakeswap. All supported markets are used by default |
| feeRate | number | No | Fee rate in per mille (‰), defaults to channel-configured fee rate. Pass 0 for no fee; when non-zero, valid range is 0.001-0.2 |
| solMaxAccounts | string | No | Maximum number of accounts, unlimited by default. Only applicable to SOL chain (limiting accounts may affect price advantage) |
Request Example:
{
"fromSymbol": "USDT",
"fromContract": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"fromAmount": "1",
"fromChain": "sol",
"toSymbol": "USDC",
"fromAddress": "ApPjjUmJuraNuFZ2n41TBzdshd3pmDEQvH6hFukQ1Yv2",
"toChain": "sol",
"toContract": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"estimateGas": true,
"skipCache": true
}About txOrigin
When provided, txOrigin helps RFQ market makers better distinguish different kinds of trading flow in their routing and risk models.
- Why it can help. In line with common practice, market makers may use signals such as the transaction initiator to refine how they price flow. Supplying
txOrigincan make it clearer that a quote corresponds to end-user activity, which in some cases may support tighter pricing or more favorable quotes than when only generic contract or settlement addresses are visible. - If you omit it. Nothing breaks. When
txOriginis not sent, behavior falls back to existing defaults (for example, using the settlement-related address for context). Quotes remain valid; you may simply see less differentiation in how flow is classified upstream. - Recommendation. Integrating
txOriginwhere it fits your product is optional and can be rolled out gradually. If it aligns with your stack, passing it may improve how your users’ flow is represented to liquidity providers—if not, you can continue as before.
Response Description:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| status | number | Yes | Response code, 0 indicates success |
| data | object | Yes | - |
| toAmount | string | Yes | Output amount |
| market | string | Yes | Channel name |
| estimateRevert | bool | Yes | Whether the transaction is estimated to revert |
| slippage | string | Yes | Slippage |
| computeUnits | number | No | SOL chain tx compute unit consumption |
| gasLimit | number | No | Estimated gas limit |
Response Example:
{
"status": 0,
"data": {
"toAmount": "1.000972",
"market": "jupiter.router",
"slippage": "2",
"estimateRevert": true,
"gasLimit": 0,
"computeUnits": 650000
}
}Get Calldata API
Request Path: /bgw-pro/swapx/pro/swap
Request Method: POST
Request Parameters:
| Field Name | Field Type | Required | Description |
|---|---|---|---|
| fromSymbol | string | No | Source token name |
| fromContract | string | Yes | Source token contract address, pass empty string for native token |
| fromAmount | string | Yes | Sell amount (input amount) |
| fromChain | string | Yes | Source chain |
| toSymbol | string | No | Target token name |
| toContract | string | Yes | Target token contract address, pass empty string for native token |
| toChain | string | Yes | Target chain |
| toMinAmount | string | No | Minimum amount to receive. If not provided, calculated using slippage |
| fromAddress | string | Yes | Debit address |
| toAddress | string | Yes | Recipient address |
| txOrigin | string | No | Transaction initiator address passed to RFQ market makers to help them classify flow. Optional; falls back to fromAddress when omitted. See “About txOrigin” below. |
| slippage | number | No | Slippage in percentage (e.g., 1 means 1%), defaults to system-configured slippage |
| market | string | Yes | Optimal channel returned by the quote API |
| feeRate | number | No | Fee rate in per mille (‰), defaults to channel-configured fee rate. Pass 0 for no fee; when non-zero, valid range is 0.001-0.2 |
| executorAddress | string | No | Executor contract address. Required if transaction is not initiated by fromAddress |
| solMaxAccounts | string | No | Maximum number of accounts, unlimited by default. Only applicable to SOL chain |
| feePayer | string | No | Fee payer address. Defaults to using fromAddress to pay SOL chain account creation fees |
| deadline | number | No | Transaction expiration time in seconds; if omitted or 0, defaults by source chain fromChain: eth → 300s, other chains → 120s; maximum 10 minutes |
| protocols | string | No | Protocol list, defaults to all supported protocols |
| requestMod | string | No | Request mode, optional values are “simple” or “rich” |
Request Example:
{
"fromSymbol": "USDT",
"fromContract": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"fromAmount": "0.5",
"fromChain": "sol",
"toSymbol": "USDC",
"fromAddress": "ApPjjUmJuraNuFZ2n41TBzdshd3pmDEQvH6hFukQ1Yv2",
"toAddress": "ApPjjUmJuraNuFZ2n41TBzdshd3pmDEQvH6hFukQ1Yv2",
"toChain": "sol",
"toContract": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"slippage": 1,
"toMinAmount": "0.4",
"market": "bgw.aggregator"
}About txOrigin
When provided, txOrigin helps RFQ market makers better distinguish different kinds of trading flow in their routing and risk models.
- Why it can help. In line with common practice, market makers may use signals such as the transaction initiator to refine how they price flow. Supplying
txOrigincan make it clearer that a quote corresponds to end-user activity, which in some cases may support tighter pricing or more favorable quotes than when only generic contract or settlement addresses are visible. - If you omit it. Nothing breaks. When
txOriginis not sent, behavior falls back to existing defaults (for example, using the settlement-related address for context). Quotes remain valid; you may simply see less differentiation in how flow is classified upstream. - Recommendation. Integrating
txOriginwhere it fits your product is optional and can be rolled out gradually. If it aligns with your stack, passing it may improve how your users’ flow is represented to liquidity providers—if not, you can continue as before.
Response Description:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| status | number | Yes | Response code, 0 indicates success |
| data | object | Yes | - |
| id | string | Yes | Order ID |
| market | string | Yes | Channel name |
| contract | string | No | Contract address, returned for EVM chains |
| calldata | string | Yes | Calldata |
| deadline | number | Yes | Order timeout (seconds) |
| computeUnits | number | No | SOL chain tx compute unit consumption |
| addressLookupTableAccount | string[] | No | SOL only: Address Lookup Table pubkeys; use with instructionLists to build a versioned transaction |
| instructionLists | object[] | No | SOL only: instruction list; by default returns data you can use to assemble the on-chain transaction |
On Solana, calldata still returns serialized data; addressLookupTableAccount and instructionLists are for assembling the transaction on the client.
Response example (EVM):
{
"status": 0,
"error_code": 0,
"data": {
"id": "fbc288e957b14524b20ebcdd8a7fc740",
"market": "bgwevmaggregator",
"contract": "0x6D0034c7DA87e8f0526b21aa890d40A77C755B68",
"calldata": "0xd984396a000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000ff7d6a96ae471bbcd7713af9cb1feeb16cf56b41000000000000000000000000d8febd1c242a282f1b8226d34282942f6f63248b000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000001953035fe9b0ae410000000000000000000000000000000000000000000000000000000069bcec8600000000000000000000000000000000fbc288e957b14524b20ebcdd8a7fc7400000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e04ee3c15060ef3235618b11c4344303793eaac7310811765c0a4ad141864dfc0100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000041cfb144b7d769f5e777b9646b5a86936af75585cb0646c369a152b5db1fb1263f07a56f6728e5b5ff206a46fd9c644130234b9cd8458736b35bb8980760bada711c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d0034c7da87e8f0526b21aa890d40a77c755b6800000000000000000000000000000000000000000000000000000000000000000000000000000000000000007e58f160b5b77b8b24cd9900c09a3e730215ac4700000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000ae314e2a2172a039b26378814c252734f556a0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000006d0034c7da87e8f0526b21aa890d40a77c755b680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c9d8a69a6c4b84aa1999220e831be07f2ef96000000000000000000000000000ae314e2a2172a039b26378814c252734f556a000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d8febd1c242a282f1b8226d34282942f6f63248b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ce94aba9086f408b3f2af4e8b5ac1abc42f4da9a000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000ff7d6a96ae471bbcd7713af9cb1feeb16cf56b410000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000",
"deadline": 120,
"computeUnits": 650000
},
"msg": "success",
"title": "",
"timestamp": 1773988879125,
"trace": "Root=1-69bcec0e-5447a0b1395a5f57335d6a44"
}Response example (EVM, requestMod=rich):
{
"status": 0,
"error_code": 0,
"data": {
"id": "b03f0028797e4f8a946fa16594e9cf64",
"market": "bgwevmaggregator",
"deadline": 120,
"outAmount": "0.934866203718378777",
"minAmount": "0.1",
"slippage": "20.00",
"priceImpact": "0.0212",
"fromTokenPrice": "1",
"toTokenPrice": "0.10923653173754198",
"predeductAmount": "0",
"postdeductAmount": "0",
"routePath": [
{
"pool_addr": "0x575c0f239ebf129edc646b2874ca8eaf3b7fbf9b",
"label": "PancakeSwapV2",
"from_contract": "0x55d398326f99059ff775485246999027b3197955",
"to_contract": "0x0dcd05357b83bf100e668f152bf14bf96b679cd1",
"from_amount": "100000000000000000",
"to_amount": "275672358203408264939",
"percent": 100,
"from_decimal": 18,
"to_decimal": 18,
"block_height": "93961602"
},
{
"pool_addr": "0x1e94be8f95a44c4288ec32f149cbf2dc3f496851020bed33d6147398e698e862",
"label": "PancakeInfinityCl",
"from_contract": "0x0dcd05357b83bf100e668f152bf14bf96b679cd1",
"to_contract": "0xff7d6a96ae471bbcd7713af9cb1feeb16cf56b41",
"from_amount": "275672358203408264939",
"to_amount": "934866203718378777",
"percent": 100,
"from_decimal": 18,
"to_decimal": 18,
"block_height": "93955989"
}
],
"gasFee": {
"gasLimit": "493594",
"gasPrice": "0.0000000001875",
"gasFeeAmountInUsd": "0.0593523402691950396289125",
"gasTotalAmount": "0.000092548875",
"gasLevel": "fast",
"gasLevelInfos": {
"average": {
"gasPrice": "0.14375",
"weiDecimals": 9,
"gasLimit": "493594",
"baseFee": "0",
"priorityFee": "0",
"maxFeePerGas": "0",
"gasFeeRate": "0",
"info": [
{
"type": "basic",
"amount": "0.0000709541375",
"amountUSD": "0.04550346087304953038216625"
}
]
},
"fast": {
"gasPrice": "0.1875",
"weiDecimals": 9,
"gasLimit": "493594",
"baseFee": "0",
"priorityFee": "0",
"maxFeePerGas": "0",
"gasFeeRate": "0",
"info": [
{
"type": "basic",
"amount": "0.000092548875",
"amountUSD": "0.0593523402691950396289125"
}
]
},
"slow": {
"gasPrice": "0.125",
"weiDecimals": 9,
"gasLimit": "493594",
"baseFee": "0",
"priorityFee": "0",
"maxFeePerGas": "0",
"gasFeeRate": "0",
"info": [
{
"type": "basic",
"amount": "0.00006169925",
"amountUSD": "0.039568226846130026419275"
}
]
}
}
},
"swapFee": {
"swapType": 3,
"feeType": 0,
"feeRate": "0",
"feeChain": "bnb",
"feeSymbol": "USDT",
"feeContract": "0x55d398326f99059ff775485246999027b3197955",
"feeDecimals": 18,
"feeTokenPrice": "1",
"feeDueAmount": "0"
},
"swapTransaction": {
"chain": "bnb",
"symbol": "USDT",
"contract": "0x55d398326f99059ff775485246999027b3197955",
"from": "0xd8FeBD1C242a282f1b8226d34282942F6F63248b",
"to": "0x6D0034c7DA87e8f0526b21aa890d40A77C755B68",
"receiver": "0xd8FeBD1C242a282f1b8226d34282942F6F63248b",
"data": "0xd984396a000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000ff7d6a96ae471bbcd7713af9cb1feeb16cf56b41000000000000000000000000d8febd1c242a282f1b8226d34282942f6f63248b000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000cf94fdbf126e5190000000000000000000000000000000000000000000000000000000069e857ce00000000000000000000000000000000b03f0028797e4f8a946fa16594e9cf640000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e048d1e60dd41e321f791d2f9b4b42ebd8e07c9880c0f3acf723ca7de3f57937f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004182d3db9581f0088f75a0e6c6818f05cc10caa423724e961d6172d211799a6b0e73cd7ad65435d51d1f65a43f25044be9950abd2fabadc7025bb512c8824543391b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068d04638eb46cd37c7b4ae316ac1da4a330c75c60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000575c0f239ebf129edc646b2874ca8eaf3b7fbf9b00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000dcd05357b83bf100e668f152bf14bf96b679cd10000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000009c4000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d8febd1c242a282f1b8226d34282942f6f63248b00000000000000000000000068d04638eb46cd37c7b4ae316ac1da4a330c75c600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dcd05357b83bf100e668f152bf14bf96b679cd1000000000000000000000000ff7d6a96ae471bbcd7713af9cb1feeb16cf56b41000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000dcd05357b83bf100e668f152bf14bf96b679cd1000000000000000000000000ff7d6a96ae471bbcd7713af9cb1feeb16cf56b41000000000000000000000000000000000000000000000000000000000000029e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0ffb9c1ce1fe56963b0321b32e7a0302114058b0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"value": "0",
"gasAmount": "493594",
"gasAmountUsd": "0.0593523402691950396289125",
"gasPrice": "0.0000000001875"
}
},
"msg": "success",
"title": "",
"timestamp": 1776834391170,
"trace": "Root=1-69e85756-0f9dcd661f2489e8111c787d"
}Response example (Solana, with instruction list):
In the example below, each instructionLists entry’s accounts array is truncated to the first few items; production responses follow the actual swap route.
{
"status": 0,
"error_code": 0,
"data": {
"id": "6a49cf127d4c44daa9b31b379be26735",
"market": "jupiter",
"contract": "",
"calldata": "29WN6gXVcTCRZnFQxbG5ojxY3Q8vX5GJH9hFGU4VPVZegrcTroNpBuXrxCPLkPohU8rZBJQKGPREdy4oyZTGxrfrFZ4gbQiwxivqpxHgMHJ7Bs4unPDUEf7GzwcjNJp8jmN1hDyuatWt9SR5HAaBzgMkmEzR2tM57dhiKzabAxKAYaHbHrfTYaVdDoFx9MTRkVGqbjimAKL2ARMACLhbP73zcKBcyxB7exvhVd34KEGjBpht98fmQGfhSQf2wPg6oGEkyfDVGGiCF7UCQAfzg4o6pSNdrnZjzFh2URMtTL7eheU2evMzLFiLZFmoAs6vwtHD7yNLsqacWWTRG3QQA4kBSAg46kcszSVVUUztvdXp43c3e3XTjhYqDKYzz1RGHenGVXw4sQuqZQgC5McxAxthGEE8GtwzyDofbrdnKdPtHX1VXXUx6Mk3sqSKLVYLy198n17zf4L9qQqN2j6kN8kDFxyH3BPYoVrKu9LPdbZeHQxzDbZ7zBFAx3bzfto34ityKwQnairyDGaR7AJUF2VQc5awv1LvvvTxWhQNQUiTu1RDXX6UxhcLsnrsfVSgNmMSm2wDz71Z17ZmTXmLkUoNvovKAnP3J6RGBpSPhnxWM3sYKNKBqUrXTp3buGSRhKSkL1pSYeXBCM3Lw2bvP8kdgVLWyPQcy2xenHp3JzfWzJwVX4P3zafxiT3erdU9GFVU4pVkVsdPuA1Dkk6JgQxP9j5AbLjhnp5CXSpCF2kc1gJJNcRcyUiAoSNijjvn1iHEnpgrLtDKWWQr5sZyReBqG1v9QQNpg8CLfQ1t1i7Hs6fzanGDVsndVDDhgsFkgw8rRaHXvsv1bM687ZqyRET1gLJSv2FefZnfW22CQfem5mQ5EzQwgN9jjZa9KtCEq64FzYzAUV9xjn34TX6HVT5Lm4LuENVfFZzY3fC9bbdwXu8XdGMxb55nRYChvRDnJBnpbkHm6Ns6EpH5RkmTuRe3SyYEt1VyagaCJHBAjc6Nj1JnFhpDsTFxBe98Ncgy7oW6oaeUJJi1pkRX",
"deadline": 120,
"computeUnits": 650000,
"addressLookupTableAccount": [
"BDqppwFYeMpUicN9xbfoM7FgRnHVW1uTUtrGA7uG2vQg",
"6JjsmWMgQtjUrBmA1obh4NZpc2CPqLcQ9cRPd2C5WBoM",
"3PiDGEeehivGdhkmLt6Rzyo6mhmogYXtgAjurb25NxxW"
],
"instructionLists": [
{
"programId": "ComputeBudget111111111111111111111111111111",
"accounts": [
{
"pubkey": "jitodontfront111111111111111111BitgetWaLLet",
"isSigner": false,
"isWritable": false
}
],
"data": "AtDdBgA="
},
{
"programId": "ComputeBudget111111111111111111111111111111",
"accounts": [],
"data": "AzgBAwAAAAAA"
},
{
"programId": "JUPSjgjMFjU4453KMgxhqVmzep6W352bQpE4RsNqXAx",
"accounts": [
{
"pubkey": "4Hzo3UJyRq3La26EW8Ft2tUP9efwLoADbBRuQSDWY7ts",
"isSigner": false,
"isWritable": false
},
{
"pubkey": "ApPjjUmJuraNuFZ2n41TBzdshd3pmDEQvH6hFukQ1Yv2",
"isSigner": true,
"isWritable": true
},
{
"pubkey": "5qvgoghnGteY5GbA124TFD1numU7Vdf6ejKg8PhNN3XL",
"isSigner": false,
"isWritable": true
}
],
"data": "0ZhTk3z+2OkAIKEHAAAAAABdlwcAAAAAAGQAMgAAAAIAAAAaECcAAXYzrCwsepkElAEQJwEC"
}
]
},
"msg": "success",
"title": "",
"timestamp": 1773987742783,
"trace": "Root=1-69bce79d-502560c342f7fc8f60263650"
}Reverse Quote Swap API
The Reverse Quote Swap API combines quoting and transaction building into a single call, supporting two trading modes:
- exactIn: User specifies the input token amount, and the system calculates the expected output amount.
- minAmountOut: User specifies the desired minimum output token amount, and the system calculates the required input amount via reverse quoting. If the on-chain execution does not satisfy the amount, the transaction will revert.
Request Path: /bgw-pro/swapx/pro/swapr
Request Method: POST
Request Parameters:
| Field Name | Field Type | Required | Default | Description |
|---|---|---|---|---|
| fromChain | string | Yes | - | Chain identifier, e.g., sol, eth, bnb, base |
| fromContract | string | Yes | - | Source token contract address, pass empty string for native token |
| toContract | string | Yes | - | Target token contract address, pass empty string for native token |
| amount | string | Yes | - | Amount (in token decimals), meaning depends on requestMode |
| requestMode | string | Yes | - | Request mode: exactIn or minAmountOut |
| fromAddress | string | Yes | - | User wallet address (debit address), length 1-256 |
| toAddress | string | Yes | - | Recipient address, length 1-256 |
| slippage | string | No | "0.5" | Slippage tolerance percentage (e.g., "0.5" means 0.5%) |
| feeRate | float64 | Yes | - | Fee rate in per mille, must be 0 or between 0.001 and 0.2 |
| deadline | int | No | Per chain | Transaction expiration time in seconds; if omitted or 0, defaults by fromChain: eth → 600s, other chains → 300s; maximum 10 minutes |
| executorAddress | string | No | - | Executor contract address. Required if transaction is not initiated by fromAddress |
requestMode Description:
| Mode | amount Meaning | Description |
|---|---|---|
| exactIn | Input token amount | Forward quoting: given input, calculate output |
| minAmountOut | Desired minimum output token amount | Reverse quoting: given desired output, calculate required input |
Request Example (exactIn mode):
{
"fromChain": "bnb",
"fromContract": "0x55d398326f99059ff775485246999027b3197955",
"toContract": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
"amount": "1",
"requestMode": "exactIn",
"fromAddress": "0xd8FeBD1C242a282f1b8226d34282942F6F63248b",
"toAddress": "0xd8FeBD1C242a282f1b8226d34282942F6F63248b",
"slippage": "0.5",
"feeRate": 0.003
}Request Example (minAmountOut mode):
{
"fromChain": "bnb",
"fromContract": "0x55d398326f99059ff775485246999027b3197955",
"toContract": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
"amount": "1",
"requestMode": "minAmountOut",
"fromAddress": "0xd8FeBD1C242a282f1b8226d34282942F6F63248b",
"toAddress": "0xd8FeBD1C242a282f1b8226d34282942F6F63248b",
"slippage": "0.5",
"feeRate": 0.003
}Response Description:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| status | number | Yes | Response code, 0 indicates success |
| data | object | Yes | - |
| id | string | Yes | Order ID |
| amountIn | string | Yes | Input amount |
| expectedAmountOut | string | Yes | Expected output amount |
| minAmountOut | string | Yes | Minimum output amount |
| priceImpact | string | Yes | Price impact percentage |
| recommendSlippage | number | Yes | Recommended slippage |
| expiresAt | number | Yes | Expiration timestamp (unix seconds) |
| market | string | Yes | Channel name |
| txs | []object | Yes | Transaction list |
| fee | object | Yes | Fee details |
txs Array Elements:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| chainId | number | Yes | Chain ID |
| to | string | Yes | Target contract address |
| calldata | string | Yes | Transaction calldata |
| function | string | Yes | Function name |
| gasLimit | string | Yes | Gas limit |
| gasPrice | string | Yes | Gas price |
| nonce | number | Yes | Nonce |
| value | string | Yes | Transaction value |
fee Object:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| totalAmountInUsd | string | Yes | Total fee in USD |
| platformFee | object | Yes | Platform fee details |
| platformFee.amountInUsd | string | Yes | Platform fee in USD |
| platformFee.items | []object | Yes | Fee breakdown items |
Response Example:
{
"status": 0,
"data": {
"id": "2dde9b1da4044957aec42e9e93416717",
"amountIn": "1",
"expectedAmountOut": "0.9969249606918065",
"minAmountOut": "0.9919403358883475",
"priceImpact": "0.25",
"recommendSlippage": 1,
"expiresAt": 1770620790,
"market": "bgwevmaggregator",
"txs": [
{
"chainId": 56,
"to": "0x6D0034c7DA87e8f0526b21aa890d40a77C755B68",
"calldata": "0xd984396a...",
"function": "swap",
"gasLimit": "752325",
"gasPrice": "0.0000000001875",
"nonce": 235,
"value": "0"
}
],
"fee": {
"totalAmountInUsd": "0.003",
"platformFee": {
"amountInUsd": "0.003",
"items": [
{
"token": {
"chain": "bnb",
"address": "0x55d398326f99059ff775485246999027b3197955",
"symbol": "USDT",
"decimals": 18
},
"amount": "0.003",
"amountInUsd": "0.003"
}
]
}
}
}
}MEV Batch Send
Request Path: /bgw-pro/swapx/pro/send
Request Method: POST
Request Parameters:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| chain | string | Yes | Chain name, max 64 characters |
| txs | []object | Yes | Transaction list, max 100 items |
txs Array Elements:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Order ID, max 128 characters |
| chain | string | Yes | Chain name, max 64 characters |
| rawTx | string | Yes | Raw transaction data for on-chain submission, max 8192 characters |
| from | string | Yes | Order sender address, max 128 characters |
| nonce | number | Yes | Nonce, minimum value is 0 |
| provider | string | No | Send provider, max 128 characters |
Request Example:
{
"chain": "bnb",
"txs": [
{
"id": "34bbf08b6ca5bb9d19e2b0e9715d82f6",
"chain": "bnb",
"rawTx": "0xabc...",
"from": "0xabc",
"nonce": 1,
"provider": ""
}
]
}Response Description:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| status | number | Yes | Response code, 0 indicates success |
| data | []object | Yes | - |
| id | string | Yes | Order ID |
| txHash | string | Yes | Transaction hash |
| code | string | No | Response code, 0 indicates success |
| message | string | Yes | Error message |
Response Example:
{
"status": 0,
"data": {
"result": [
{
"id": "34bbf08b6ca5bb9d19e2b0e9715d82f6",
"code": 0,
"txHash": "2T4UR7tsgiPQsJuEYMwu8wNzukdjzoLgqTNBQ1KgL13nX7CUTQeEkNz8sEiGA35fCvt7MCNsgRGohFLg9dg932jr"
}
]
}
}Solana fee-exempt transaction signing (signBgwSolTx)
Use this endpoint when the integrator has built a fee-exempt Solana transaction from instructions on the client and needs a BGW cosignature before broadcasting. The response returns a serialized signed transaction.
Request Path: /bgw-pro/swapx/pro/signBgwSolTx
HTTP Method: POST
Request Parameters:
| Field Name | Field Type | Required | Description |
|---|---|---|---|
| chain | string | Yes | Chain identifier; always sol |
| transaction | string | Yes | Serialized Solana transaction (e.g. Base58); length 1–4096 characters |
Request Example:
{
"chain": "sol",
"transaction": "3TXwb8T2kyg7hY4DanwQ9m3UJGqUAJxxo99vevVQLSvNoCQFhmmjZyBBVkEhHGXe78hv9Z4W1jSgvV6PBHpCuD3vjuqcBshwnM6piPYwVLyS1Xyzv9t3VWHTqdhi61eWFbxfLauPBHZVpYQ7bMCQidMTFmnXnyyCEngraE85RgzxQe1mBbBhsHGcYyaTjszNtZkeMvTMitRQ8M6bxk31BdBUGssxyxKJFTCgtwxPDUL5vKjZ3gYHC2e7whhu2KMB9UcVkEUa9qSt1ztzq1xTGwsxEHVNWvecBPsbKKHZwwybXD8eY9QME3XaEgkw2gQvr4pEjtk8zxMJqschjG4NVyGjXLSUaKe71YkDR2uiJQ2UEA58hqDbrWWgYCT3fvVvwCTXUr7EBFPwyLDF2hgzdD3z1PsX9RAwdFCJhXv1iLaHrL9rtYVjPW83JXoQsHaTADF1kMmGAPXcTBCAGMyUrWzxv6zYp363bn51m9wdKPwJSm5DcX3tb6w7mo51JcVzFCE3z1H5KxbRGCZoc8hn6XQit831DAL15Vgr8m6bNuvRQGrQdFRVnAf8MsRrDQdPENgndXLnaJVpGjMjn4U832bPeMLKUfjKv9YwWtdaRXNf8SHifX7uj8sUsThaQM6kJ4WZiJWqhwEfEJQ4kVC6ZTLm5smiLqvgxmcNt6c55PzdEFSoanDSX8D9Ud8AmeK6oREWkqPCDnP7xJjMQCWUQxZTGwWw1gUqEtkp9a1nUkx8R2bfDa4oJ8gpWmDUiGCNxgitas9FSMtXHVtQuEKoNGTYoE2Bxu8MbVNtPJVMwfTw86wk8jsbxve4iJGN5oTnrarkPo2QJJTQZXG6kpWzPrtgHMLvJ6tTSNc19576habsqBY2GgdVHxib2SHJ8JbAfnk75THqwK65t2knb53hKGANwpP2rQBRcsiUXW6CeN7qcmRkdamncazebFwJYCG4CC6ZWKCxN2xMfSLiQgcemSCPPPzbN2u4Yd6pwdYwpgBzSumNiE"
}Response Description:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| status | number | Yes | Response code, 0 indicates success |
| error_code | number | No | Error code, 0 indicates success |
| data | object | Yes | Payload |
| data.transaction | string | Yes | Cosigned serialized Solana transaction |
| msg | string | No | Message |
| title | string | No | Title |
| timestamp | number | No | Timestamp |
| trace | string | No | Trace ID |
Response Example:
{
"status": 0,
"error_code": 0,
"data": {
"transaction": "3TXwb8T2kyg7hY4DanwQ9m3UJGqUAJxxo99vevVQLSvNoCQFhmmjZyBBVkEhHGXe78hv9Z4W1jSgvV6PBHpCuD3vjuqcBshwnM6piPYwVLyS1Xyzv9t3VWHTqdhi61eWFbxfLauPBHZVpYQ7bMCQidMTFmnXnyyCEngraE85RgzxQe1mBbBhsHGcYyaTjszNtZkeMvTMitRQ8M6bxk31BdBUGssxyxKJFTCgtwxPDUL5vKjZ3gYHC2e7whhu2KMB9UcVkEUa9qSt1ztzq1xTGwsxEHVNWvecBPsbKKHZwwybXD8eY9QME3XaEgkw2gQvr4pEjtk8zxMJqschjG4NVyGjXLSUaKe71YkDR2uiJQ2UEA58hqDbrWWgYCT3fvVvwCTXUr7EBFPwyLDF2hgzdD3z1PsX9RAwdFCJhXv1iLaHrL9rtYVjPW83JXoQsHaTADF1kMmGAPXcTBCAGMyUrWzxv6zYp363bn51m9wdKPwJSm5DcX3tb6w7mo51JcVzFCE3z1H5KxbRGCZoc8hn6XQit831DAL15Vgr8m6bNuvRQGrQdFRVnAf8MsRrDQdPENgndXLnaJVpGjMjn4U832bPeMLKUfjKv9YwWtdaRXNf8SHifX7uj8sUsThaQM6kJ4WZiJWqhwEfEJQ4kVC6ZTLm5smiLqvgxmcNt6c55PzdEFSoanDSX8D9Ud8AmeK6oREWkqPCDnP7xJjMQCWUQxZTGwWw1gUqEtkp9a1nUkx8R2bfDa4oJ8gpWmDUiGCNxgitas9FSMtXHVtQuEKoNGTYoE2Bxu8MbVNtPJVMwfTw86wk8jsbxve4iJGN5oTnrarkPo2QJJTQZXG6kpWzPrtgHMLvJ6tTSNc19576habsqBY2GgdVHxib2SHJ8JbAfnk75THqwK65t2knb53hKGANwpP2rQBRcsiUXW6CeN7qcmRkdamncazebFwJYCG4CC6ZWKCxN2xMfSLiQgcemSCPPPzbN2u4Yd6pwdYwpgBzSumNiE"
},
"msg": "success",
"title": "",
"timestamp": 1775188741824,
"trace": "Self=1-69cf3b05-05097b5d0904b9b205b0e724;Root=1-69cf3b05-5fe728c6465019be259385b1;9e6528829a451e1d"
}Aggregator Dual-Channel Mode
The aggregator supports two quoting channels: Fast Mode and Full Mode. Fast Mode is stable and efficient, suited for small-to-mid volume; Full Mode covers more RFQ sources with a wider quote space, ideal for large orders and best used alongside pre-execution simulation.
For a detailed introduction, see: Aggregator Dual-Channel Overview
Further Reading
- API Key Access Documentation: Authentication
- Market API Documentation: Market API


