expand.network
  • Overview
  • Getting Started
  • 🔑How do I get my API Key?
  • 📑List of All Endpoints
  • ⚙️SDK
    • Overview
    • Getting Started
  • ⛓️INTEGRATIONS
    • ⚡Blockchains
      • EVM based blockchains
        • Ethereum
        • Binance Smart Chain
        • Avalanche - C
        • Avalanche - P
        • Avalanche - X
        • Polygon
        • Cronos
        • Arbitrum
        • Fantom
        • Optimism
        • Base
        • zkSync Era
        • Mantle
      • Non-EVM based chains
        • Tron
        • Solana
        • Near
        • Algorand
        • Aptos
        • Sui
        • Starknet
        • TON
        • Cosmos Hub
        • Osmosis
        • Stacks
        • Bitcoin
        • Stellar
          • Stellar RWA
        • XRP Ledger
          • XRP Ledger RWA
    • ⚡Bridges
      • Stargate
      • Stargate V2
      • Squid Router
      • Squid Router V2
      • Allbridge Classic
      • Allbridge Core
    • ⚡DEX & DEX Aggregators
      • Uniswap V2
      • Uniswap V3
      • Uniswap X
      • Sushiswap V2
      • PancakeSwap V2
      • PancakeSwap V3
      • Aerodrome
      • Camelot V3
      • Curve V2
      • Balancer V2
      • STON.fi
      • Trader Joe
      • Orca
      • Raydium
      • SDEX
      • Cetus
      • REF Finance
      • Liquidswap
      • Sologenic
      • Alex
      • 0x (Aggregator)
      • 1inch (Aggregator)
      • Kyberswap (Aggregator)
        • Kyberswap ( Limit Order Endpoints )
      • Jupiter (Aggregator)
    • ⚡Derivatives
      • dYdX V4
    • ⚡Fungible Tokens
      • ERC20
      • WETH
    • ⚡Lending Protocols
      • Aave V2
      • Aave V3
      • Compound V2
      • Compound V3
      • Morpho
    • ⚡Yield Aggregators
      • Yearn Finance V2
      • Harvest Finance
      • Pendle
    • ⚡Liquid Staking
      • Chorus One
      • Lido V2
      • Stader
      • Benqi
      • Jito
      • EigenLayer
    • ⚡Non Fungible Tokens
      • ERC721
      • ERC1155
      • Metaplex
    • ⚡Oracles
      • ChainLink
      • WinkLink
      • Pyth Network
      • RedStone
    • ⚡Stablecoins
      • EVM
    • ⚡Synthetics
      • Synthetix
    • ⚡Supported Wallets
      • MPC Wallets
        • DFNS
        • FORDEFI
        • FIREBLOCKS
        • CIRCLE
      • HD Wallets
        • PHANTOM
        • COINBASE
        • TON Wallet
      • Wallet Connect v2
  • How To
    • Execute a Local Swap
    • Execute a Cross Chain Swap
    • Use Limit Orders
    • Lend and Borrow
    • Provision Liquidity
      • Adding Liquidity
      • Removing liquidity
    • Yield Farm
    • Use Our Transaction Decoder
    • Submit an RFQ
    • Subscribe to Events
    • Stream Data (WebSocket)
      • Stream Transaction
      • Stream Trade
      • Stream Gas
      • Stream Ticker Price
    • Source Pricing
    • Track Memecoins
    • Manage Token Approvals
  • Use Cases
    • Trade Reconciliation
    • Portfolio Management
    • Trading Features
    • On-Chain Data: DEX Liquidity Pool Forensics
    • Transaction and Pool Analysis
  • Account Abstraction
    • Overview
      • User Endpoints
      • Paymaster Endpoint
      • Bundler Endpoint
    • ⚙️SDK - Overview
  • Additional Info
    • Error Messages
    • Client-Side Security Essentials
    • Compute Unit Costs
    • API Metadata
    • Audit Certificate
    • Brand Assets
    • FAQs
    • Quicknode Marketplace
      • DEX
      • Lending Protocols
  • ID's
    • Chain IDs
    • Bridge IDs
      • Internal Chain IDs for Bridges
    • DEX IDs
    • Lending Protocol IDs
    • Yield Aggregator ID
    • Liquid Staking IDs
    • Oracle IDs
    • Stablecoin IDs
    • Derivatives IDs
    • Synthetics IDs
  • Mapping
    • Blockchains
    • DEXs
      • Uniswap V2
      • Uniswap V3
      • Sushiswap
      • PancakeSwap
      • Curve
      • Balancer
    • Lending Protocols
      • Aave
      • Compound
  • Protocol Spender
    • Spender list
Powered by GitBook
On this page
  • Step 1: Request for quote
  • Step 2: Generate the signature off-chain
  • Step 3: Execute the transaction
  1. How To

Submit an RFQ

PreviousUse Our Transaction DecoderNextSubscribe to Events

Last updated 1 year ago

RFQ works when a buyer invites sellers to bid on specific amount of an asset. The buyer then uses these bids to determine the best available price and service level. The sellers use automated, programmatic response software to quote at their fair value price.

Step 1: Request for quote

To initiate a swap, first determine if the DEX has the necessary allowance to access the tokens.

API URL:


Sample Request:

{
    "dexId": "1900",
    "amountIn": "100000",
    "path": [
        "0xe0C9275E44Ea80eF17579d33c55136b7DA269aEb",
        "0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1"
    ],
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "decayStartTime": "1707110948",
    "decayEndTime": "1707113948",
    "amountOutMin": "10000000000",
    "deadline": "1707313948"
}

Sample Response:

{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "domain": {
            "name": "Permit2",
            "chainId": "1",
            "verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
        },
        "types": {
            "PermitWitnessTransferFrom": [
                {
                    "name": "permitted",
                    "type": "TokenPermissions"
                },
                {
                    "name": "spender",
                    "type": "address"
                },
                {
                    "name": "nonce",
                    "type": "uint256"
                },
                {
                    "name": "deadline",
                    "type": "uint256"
                },
                {
                    "name": "witness",
                    "type": "ExclusiveDutchOrder"
                }
            ],
            "TokenPermissions": [
                {
                    "name": "token",
                    "type": "address"
                },
                {
                    "name": "amount",
                    "type": "uint256"
                }
            ],
            "ExclusiveDutchOrder": [
                {
                    "name": "info",
                    "type": "OrderInfo"
                },
                {
                    "name": "decayStartTime",
                    "type": "uint256"
                },
                {
                    "name": "decayEndTime",
                    "type": "uint256"
                },
                {
                    "name": "exclusiveFiller",
                    "type": "address"
                },
                {
                    "name": "exclusivityOverrideBps",
                    "type": "uint256"
                },
                {
                    "name": "inputToken",
                    "type": "address"
                },
                {
                    "name": "inputStartAmount",
                    "type": "uint256"
                },
                {
                    "name": "inputEndAmount",
                    "type": "uint256"
                },
                {
                    "name": "outputs",
                    "type": "DutchOutput[]"
                }
            ],
            "OrderInfo": [
                {
                    "name": "reactor",
                    "type": "address"
                },
                {
                    "name": "swapper",
                    "type": "address"
                },
                {
                    "name": "nonce",
                    "type": "uint256"
                },
                {
                    "name": "deadline",
                    "type": "uint256"
                },
                {
                    "name": "additionalValidationContract",
                    "type": "address"
                },
                {
                    "name": "additionalValidationData",
                    "type": "bytes"
                }
            ],
            "DutchOutput": [
                {
                    "name": "token",
                    "type": "address"
                },
                {
                    "name": "startAmount",
                    "type": "uint256"
                },
                {
                    "name": "endAmount",
                    "type": "uint256"
                },
                {
                    "name": "recipient",
                    "type": "address"
                }
            ]
        },
        "values": {
            "permitted": {
                "token": "0xe0C9275E44Ea80eF17579d33c55136b7DA269aEb",
                "amount": {
                    "type": "BigNumber",
                    "hex": "0x0186a0"
                }
            },
            "spender": "0x6000da47483062A0D734Ba3dc7576Ce6A0B645C4",
            "nonce": {
                "type": "BigNumber",
                "hex": "0x01"
            },
            "deadline": "1707313948",
            "witness": {
                "info": {
                    "reactor": "0x6000da47483062A0D734Ba3dc7576Ce6A0B645C4",
                    "swapper": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
                    "nonce": {
                        "type": "BigNumber",
                        "hex": "0x01"
                    },
                    "deadline": "1707313948",
                    "additionalValidationContract": "0x0000000000000000000000000000000000000000",
                    "additionalValidationData": "0x"
                },
                "decayStartTime": "1707110948",
                "decayEndTime": "1707113948",
                "exclusiveFiller": "0x0000000000000000000000000000000000000000",
                "exclusivityOverrideBps": {
                    "type": "BigNumber",
                    "hex": "0x00"
                },
                "inputToken": "0xe0C9275E44Ea80eF17579d33c55136b7DA269aEb",
                "inputStartAmount": {
                    "type": "BigNumber",
                    "hex": "0x0186a0"
                },
                "inputEndAmount": {
                    "type": "BigNumber",
                    "hex": "0x0186a0"
                },
                "outputs": [
                    {
                        "token": "0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1",
                        "startAmount": {
                            "type": "BigNumber",
                            "hex": "0x02363e7f00"
                        },
                        "endAmount": {
                            "type": "BigNumber",
                            "hex": "0x02363e7f00"
                        },
                        "recipient": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994"
                    }
                ]
            }
        },
        "serializedOrder": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000065c072240000000000000000000000000000000000000000000000000000000065c07ddc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0c9275e44ea80ef17579d33c55136b7da269aeb00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000006000da47483062a0d734ba3dc7576ce6a0b645c4000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000a15e551c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dfcea9088c8a88a76ff74892c1457c17dfeef9c100000000000000000000000000000000000000000000000000000002363e7f0000000000000000000000000000000000000000000000000000000002363e7f00000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994"
    }
}

Step 2: Generate the signature off-chain

This is an off-chain process that the user needs to perform at their end.


Sample Request:

const { ethers } = require('ethers');    
const provider = new ethers.providers.JsonRpcProvider("https://mainnet.infura.io/v3/<rpc key>");

const signer = new ethers.Wallet('<private key>', provider);
const signature = await signer._signTypedData(domain, types, values);

Expand.network will soon support publishing orders on Uniswap X.

Step 3: Execute the transaction

This can be done using the following API endpoint:


Sample Request:

{
    "dexId": "1900",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "173376",
    "signature": "0xc2f9557dcc27ff17ecf91211a6a0af6ead44acf6a7d7322d0f40afefca596a843b5d95698332867a11eb3a3f9984ac3639581b765138fc0cc88322a889dffd1d1b",
    "serializedOrder": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000065c072240000000000000000000000000000000000000000000000000000000065c07ddc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0c9275e44ea80ef17579d33c55136b7da269aeb00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000006000da47483062a0d734ba3dc7576ce6a0b645c4000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000a15e551c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dfcea9088c8a88a76ff74892c1457c17dfeef9c100000000000000000000000000000000000000000000000000000002363e7f0000000000000000000000000000000000000000000000000000000002363e7f00000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994"
}

Sample Response:

{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x6000da47483062A0D734Ba3dc7576Ce6A0B645C4",
        "gas": "173376",
        "value": "0",
        "data": "0x3f62192e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000006515b768000000000000000000000000000000000000000000000000000000006516e43000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000006000da47483062a0d734ba3dc7576ce6a0b645c400000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b0c82c8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000000000041c2f9557dcc27ff17ecf91211a6a0af6ead44acf6a7d7322d0f40afefca596a843b5d95698332867a11eb3a3f9984ac3639581b765138fc0cc88322a889dffd1d1b00000000000000000000000000000000000000000000000000000000000000"
    }
}

API URL:

https://api.expand.network/dex/createorder
https://api.expand.network/dex/swap