Skip to Content
EnDocs
Trading API
Instruction Mode

Instruction Mode API

Overview

  1. Partner code must be agreed upon in advance and passed through the header: Partner-Code;
  2. Currently supported chains: ETH, SOL, BNB chain, Base, Polygon, Arbitrum, Morph. Please notify us in advance for integration with other chains;
  3. Transaction fees:
    • Currently, fees are collected in our contract and settled periodically;
    • Custom fee collection addresses are under development;

HTTP Status Code Definitions

Status CodeDescription
200Success
400Bad Request
403Forbidden (Not whitelisted or signature error)
429Too many requests (Rate limited)

Quote API

Request Path: /bgw-pro/swapx/pro/quote

Request Method: POST

Request Parameters:

Field NameField TypeRequiredDescription
fromSymbolstringNoSource token name
fromContractstringYesSource token contract address, pass empty string for native token
fromAmountstringYesQuote amount (input amount)
fromChainstringYesSource chain
toSymbolstringNoTarget token name
toContractstringYesTarget token contract address, pass empty string for native token
toChainstringYesTarget chain
fromAddressstringNoDebit address, used for gas estimation. If not provided, a default address will be used for gas estimation
toAddressstringNoRecipient address
txOriginstringNoTransaction initiator address passed to RFQ market makers to help them classify flow. Optional; falls back to fromAddress when omitted. See “About txOrigin” below.
estimateGasboolNoWhether to estimate gas, default is false. Should be used together with fromAddress
marketstringNoSpecify quote channel, e.g., uniswap.v3, pancakeswap. All supported markets are used by default
feeRatenumberNoFee 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
solMaxAccountsstringNoMaximum 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 txOrigin can 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 txOrigin is 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 txOrigin where 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 NameParameter TypeRequiredDescription
statusnumberYesResponse code, 0 indicates success
dataobjectYes-
toAmountstringYesOutput amount
marketstringYesChannel name
estimateRevertboolYesWhether the transaction is estimated to revert
slippagestringYesSlippage
computeUnitsnumberNoSOL chain tx compute unit consumption
gasLimitnumberNoEstimated 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 NameField TypeRequiredDescription
fromSymbolstringNoSource token name
fromContractstringYesSource token contract address, pass empty string for native token
fromAmountstringYesSell amount (input amount)
fromChainstringYesSource chain
toSymbolstringNoTarget token name
toContractstringYesTarget token contract address, pass empty string for native token
toChainstringYesTarget chain
toMinAmountstringNoMinimum amount to receive. If not provided, calculated using slippage
fromAddressstringYesDebit address
toAddressstringYesRecipient address
txOriginstringNoTransaction initiator address passed to RFQ market makers to help them classify flow. Optional; falls back to fromAddress when omitted. See “About txOrigin” below.
slippagenumberNoSlippage in percentage (e.g., 1 means 1%), defaults to system-configured slippage
marketstringYesOptimal channel returned by the quote API
feeRatenumberNoFee 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
executorAddressstringNoExecutor contract address. Required if transaction is not initiated by fromAddress
solMaxAccountsstringNoMaximum number of accounts, unlimited by default. Only applicable to SOL chain
feePayerstringNoFee payer address. Defaults to using fromAddress to pay SOL chain account creation fees
deadlinenumberNoTransaction expiration time in seconds; if omitted or 0, defaults by source chain fromChain: eth → 300s, other chains → 120s; maximum 10 minutes
protocolsstringNoProtocol list, defaults to all supported protocols
requestModstringNoRequest 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 txOrigin can 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 txOrigin is 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 txOrigin where 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 NameParameter TypeRequiredDescription
statusnumberYesResponse code, 0 indicates success
dataobjectYes-
idstringYesOrder ID
marketstringYesChannel name
contractstringNoContract address, returned for EVM chains
calldatastringYesCalldata
deadlinenumberYesOrder timeout (seconds)
computeUnitsnumberNoSOL chain tx compute unit consumption
addressLookupTableAccountstring[]NoSOL only: Address Lookup Table pubkeys; use with instructionLists to build a versioned transaction
instructionListsobject[]NoSOL 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 NameField TypeRequiredDefaultDescription
fromChainstringYes-Chain identifier, e.g., sol, eth, bnb, base
fromContractstringYes-Source token contract address, pass empty string for native token
toContractstringYes-Target token contract address, pass empty string for native token
amountstringYes-Amount (in token decimals), meaning depends on requestMode
requestModestringYes-Request mode: exactIn or minAmountOut
fromAddressstringYes-User wallet address (debit address), length 1-256
toAddressstringYes-Recipient address, length 1-256
slippagestringNo"0.5"Slippage tolerance percentage (e.g., "0.5" means 0.5%)
feeRatefloat64Yes-Fee rate in per mille, must be 0 or between 0.001 and 0.2
deadlineintNoPer chainTransaction expiration time in seconds; if omitted or 0, defaults by fromChain: eth → 600s, other chains → 300s; maximum 10 minutes
executorAddressstringNo-Executor contract address. Required if transaction is not initiated by fromAddress

requestMode Description:

Modeamount MeaningDescription
exactInInput token amountForward quoting: given input, calculate output
minAmountOutDesired minimum output token amountReverse 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 NameParameter TypeRequiredDescription
statusnumberYesResponse code, 0 indicates success
dataobjectYes-
idstringYesOrder ID
amountInstringYesInput amount
expectedAmountOutstringYesExpected output amount
minAmountOutstringYesMinimum output amount
priceImpactstringYesPrice impact percentage
recommendSlippagenumberYesRecommended slippage
expiresAtnumberYesExpiration timestamp (unix seconds)
marketstringYesChannel name
txs[]objectYesTransaction list
feeobjectYesFee details

txs Array Elements:

Parameter NameParameter TypeRequiredDescription
chainIdnumberYesChain ID
tostringYesTarget contract address
calldatastringYesTransaction calldata
functionstringYesFunction name
gasLimitstringYesGas limit
gasPricestringYesGas price
noncenumberYesNonce
valuestringYesTransaction value

fee Object:

Parameter NameParameter TypeRequiredDescription
totalAmountInUsdstringYesTotal fee in USD
platformFeeobjectYesPlatform fee details
platformFee.amountInUsdstringYesPlatform fee in USD
platformFee.items[]objectYesFee 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 NameParameter TypeRequiredDescription
chainstringYesChain name, max 64 characters
txs[]objectYesTransaction list, max 100 items

txs Array Elements:

Parameter NameParameter TypeRequiredDescription
idstringYesOrder ID, max 128 characters
chainstringYesChain name, max 64 characters
rawTxstringYesRaw transaction data for on-chain submission, max 8192 characters
fromstringYesOrder sender address, max 128 characters
noncenumberYesNonce, minimum value is 0
providerstringNoSend provider, max 128 characters

Request Example:

{ "chain": "bnb", "txs": [ { "id": "34bbf08b6ca5bb9d19e2b0e9715d82f6", "chain": "bnb", "rawTx": "0xabc...", "from": "0xabc", "nonce": 1, "provider": "" } ] }

Response Description:

Parameter NameParameter TypeRequiredDescription
statusnumberYesResponse code, 0 indicates success
data[]objectYes-
idstringYesOrder ID
txHashstringYesTransaction hash
codestringNoResponse code, 0 indicates success
messagestringYesError 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 NameField TypeRequiredDescription
chainstringYesChain identifier; always sol
transactionstringYesSerialized Solana transaction (e.g. Base58); length 1–4096 characters

Request Example:

{ "chain": "sol", "transaction": "3TXwb8T2kyg7hY4DanwQ9m3UJGqUAJxxo99vevVQLSvNoCQFhmmjZyBBVkEhHGXe78hv9Z4W1jSgvV6PBHpCuD3vjuqcBshwnM6piPYwVLyS1Xyzv9t3VWHTqdhi61eWFbxfLauPBHZVpYQ7bMCQidMTFmnXnyyCEngraE85RgzxQe1mBbBhsHGcYyaTjszNtZkeMvTMitRQ8M6bxk31BdBUGssxyxKJFTCgtwxPDUL5vKjZ3gYHC2e7whhu2KMB9UcVkEUa9qSt1ztzq1xTGwsxEHVNWvecBPsbKKHZwwybXD8eY9QME3XaEgkw2gQvr4pEjtk8zxMJqschjG4NVyGjXLSUaKe71YkDR2uiJQ2UEA58hqDbrWWgYCT3fvVvwCTXUr7EBFPwyLDF2hgzdD3z1PsX9RAwdFCJhXv1iLaHrL9rtYVjPW83JXoQsHaTADF1kMmGAPXcTBCAGMyUrWzxv6zYp363bn51m9wdKPwJSm5DcX3tb6w7mo51JcVzFCE3z1H5KxbRGCZoc8hn6XQit831DAL15Vgr8m6bNuvRQGrQdFRVnAf8MsRrDQdPENgndXLnaJVpGjMjn4U832bPeMLKUfjKv9YwWtdaRXNf8SHifX7uj8sUsThaQM6kJ4WZiJWqhwEfEJQ4kVC6ZTLm5smiLqvgxmcNt6c55PzdEFSoanDSX8D9Ud8AmeK6oREWkqPCDnP7xJjMQCWUQxZTGwWw1gUqEtkp9a1nUkx8R2bfDa4oJ8gpWmDUiGCNxgitas9FSMtXHVtQuEKoNGTYoE2Bxu8MbVNtPJVMwfTw86wk8jsbxve4iJGN5oTnrarkPo2QJJTQZXG6kpWzPrtgHMLvJ6tTSNc19576habsqBY2GgdVHxib2SHJ8JbAfnk75THqwK65t2knb53hKGANwpP2rQBRcsiUXW6CeN7qcmRkdamncazebFwJYCG4CC6ZWKCxN2xMfSLiQgcemSCPPPzbN2u4Yd6pwdYwpgBzSumNiE" }

Response Description:

Parameter NameParameter TypeRequiredDescription
statusnumberYesResponse code, 0 indicates success
error_codenumberNoError code, 0 indicates success
dataobjectYesPayload
data.transactionstringYesCosigned serialized Solana transaction
msgstringNoMessage
titlestringNoTitle
timestampnumberNoTimestamp
tracestringNoTrace 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

Last updated on