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
  • /getprice
  • /getliquiditysources
  • /swap
  1. INTEGRATIONS
  2. DEX & DEX Aggregators

0x (Aggregator)

/getprice

Returns the best swap quotation for the given token pair.

GET https://api.expand.network/dex/getprice

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

path*

String

Comma separated values of token addresses whose price is to be fetched.

amountIn*

String

Amount of token.

https://api.expand.network/dex/getprice?dexId=1600&path=0xdac17f958d2ee523a2206206994597c13d831ec7%2C0x6B175474E89094C44Da98b954EedeAC495271d0F&amountIn=10000000000000
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "10000000000000",
        "path": [
            "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "0x6B175474E89094C44Da98b954EedeAC495271d0F"
        ],
        "amountsOut": [
            "10000000000000",
            "9980737729411015490500127"
        ]
    }
}

/getliquiditysources

Get the liquidity sources for the specified dex aggregator(on the basis of chain), supported by expand.network.

GET https://api.expand.network/dex/getliquiditysources

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

https://api.expand.network/dex/getliquiditysources?dexId=1602
{
    "status": 200,
    "msg": "success",
    "data": [
        "0x_RFQ",
        "ApeSwap",
        "Balancer_V2",
        "Curve",
        "DODO_V2",
        "Dfyn",
        "Meshswap",
        "Polycat",
        "QuickSwap_V2",
        "QuickSwap_V3",
        "Retro",
        "Stepn",
        "SushiSwap",
        "SushiSwap_V3",
        "Synapse",
        "Uniswap_V2",
        "Uniswap_V3",
        "WOOFi_V2",
        "WaultSwap",
        "Wrapped_USDM"
    ]
}

/swap

Initiate a swap transaction on the DEX providing best swap quote.

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

Request Body

Name
Type
Description

dexId*

String

path*

Array

Comma-separated values of token addresses, inside an array, to swap.

amountIn*

String

Amount of token to be swapped.

amountOutMin

String

Minimum amount accepted as the result of swap.

from*

String

Address of the sender of the token.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

rpc

String

Remote procedural call URL.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 100

gasPriority

String

low, medium, or high.

ofacCheck

Boolean

if true,provides insights of the contract and tokens involved in the transaction. By Default, false Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet

{
    "dexId": "1600",
    "amountIn": "1000000000000000000",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ],
    "to": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "gas": "990089"
}
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
        "to": "0x70bf6634ee8cb27d04478f184b9b8bb13e5f4710",
        "value": "0",
        "gas": "990089",
        "data": "0x1fff991f0000000000000000000000006afb0df2f5ab5012568991549544dbc44dfb6483000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f150000000000000000000000000000000000000000000000000000000000000000a02f9702771d7e08c60d140fc3a1a0780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000000c4339a023000000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f6e72db5454dd049d0788e411b06cfaf16853042000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a4d92aadfb00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f41c8ae0cd7b8d6179a1b999436fda67d84362e6ba4dfe7ce386e8a5967a333324d41000000000000000000000000000000000000000000000000000000006746fc36000000000000000000000000b02f39e382c90160eb816de5e0e428ac771d77b50000000000000000000000000000000000000000000000000000000000000120000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000411c0eaf75a50eec050bea87df0f50e8e9045e4ee0e983e6ebec5d37ecd154b1b61d0752a856a866e1872bc913dd8619a88c497b133138503e8b892aa85c4ef822b70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffc1fb425e00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f47100000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000006e898131631616b1779bad70bc17000000000000000000000000000000000000000000000000000000006746fd2200000000000000000000000000000000000000000000000000000000000000c0",
        "estimationCheck": true,
        "referenceId": "6331a5b9fe3a4360b1dd5a3b0e76fd88"
    }
}

With gasPriority:

{
    "dexId": "1600",
    "amountIn": "1000000000000000000",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ],
    "to": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "gas": "990089",
    "gasPriority": "low"
}

With gasPriority:

{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
        "to": "0x70bf6634ee8cb27d04478f184b9b8bb13e5f4710",
        "value": "0",
        "gas": "990089",
        "data": "0x1fff991f0000000000000000000000006afb0df2f5ab5012568991549544dbc44dfb6483000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f149d00000000000000000000000000000000000000000000000000000000000000a05cdc6e9f2b14a0d7cc1b3156a1a0780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000000c4339a023000000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f6e72db5454dd049d0788e411b06cfaf16853042000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a4d92aadfb00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f415a852e6ace002d4125cd21e106f3317701d66b58a997a8d61df24002dd60307010000000000000000000000000000000000000000000000000000000006746fc67000000000000000000000000ff8ba4d1fc3762f6154cc942ccf30049a2a0cec60000000000000000000000000000000000000000000000000000000000000120000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000419ccc5eddb539be5e34b28e24afca89a373efa80b2525595c5acf87c46170ea336d304d3ca5585e7e67ffe5df92ac91c7824d35881492c6c1aecef2518c9e48251c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffc1fb425e00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f47100000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000006e898131631616b1779bad70bc16000000000000000000000000000000000000000000000000000000006746fd3a00000000000000000000000000000000000000000000000000000000000000c0",
        "gasPrice": "13752602380",
        "estimationCheck": true,
        "referenceId": "5dc5e1e4455d4f978fa9fbb8e353fab0"
    }
}

With Slippage:

{
    "dexId": "1600",
    "amountIn": "1000000000000000",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ],
    "to": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "from": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "amountOutMin": "10000000",
    "gas": "990089",
    "gasPriority": "medium",
    "slippage": "8"
}

With Slippage:

{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
        "to": "0x70bf6634ee8cb27d04478f184b9b8bb13e5f4710",
        "value": "0",
        "gas": "990089",
        "data": "0x1fff991f00000000000000000000000022cf65ae3fa16d6379e72f4b4c2401c1b7c69731000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000039400000000000000000000000000000000000000000000000000000000000000a034705e63360d7c1d5877b9d4a1a07800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000000c4339a023000000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f6e72db5454dd049d0788e411b06cfaf168530420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016438c9c147000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000271000000000000000000000000014100f81e33c33ecc7cdac70181fb45b6e78569f000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000843df021240000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e48d68a15600000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c73a15fed60bf67631dc6cd7bc5b6e8da8190acf500000bb8dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e48d68a15600000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c73a15fed60bf67631dc6cd7bc5b6e8da8190acf5010001f4dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffc1fb425e00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f47100000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000006e898131631616b1779bad70bc24000000000000000000000000000000000000000000000000000000006746fd5200000000000000000000000000000000000000000000000000000000000000c0",
        "gasPrice": "16286719698",
        "estimationCheck": true,
        "referenceId": "34ca65823d7b4668934185e9298123f9"
    }
}

With ofacCheck:

{
    "dexId": "1600",
    "amountIn": "1000000000000000",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ],
    "to": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "from": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "amountOutMin": "10000000",
    "gas": "990089",
    "gasPriority": "medium",
    "slippage": "8",
    "ofacCheck": true
}

With ofacCheck:

{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
        "to": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
        "value": "0",
        "gas": "40000",
        "data": "0xede4edd00000000000000000000000005d3a536e4d6dbd6114cc1ead35777bab948e3643",
        "gasPrice": "499498318",
        "estimationCheck": true,
        "insights": {
            "asset": {
                "issues": [],
                "verdict": {
                    "code": 0,
                    "label": "NO_ISSUES"
                }
            },
            "to": {
                "issues": [],
                "verdict": {
                    "code": 0,
                    "label": "NO_ISSUES"
                }
            }
        },
        "referenceId": "e9bfe6229a844227a92a2f6669aa1da0"
    }
}
PreviousAlexNext1inch (Aggregator)

Last updated 1 month ago

Refer to the page for details.

Refer to the page for details.

Refer to the page for details.

⛓️
⚡
DEX ID
DEX ID
DEX ID