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
  • Get Quotes
  • Get User Liquidity
  • Get Pool Liquidity
  • Swap
  • Add Liquidity
  • Remove Liquidity
  1. Additional Info
  2. Quicknode Marketplace

DEX

Get Quotes

The user will be able to get quotes of the specified token pair from different Dexs in an aggregated manner.

URL:

https://quicknode.expand.network/dex

Payload:

{
    "method": "en_getQuotes",
    "params": [
        {
            "path": [
                "0x6b175474e89094c44da98b954eedeac495271d0f",
                "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
            ],
            "amountIn": "1000000000000000"
        }
    ]
}
{
    "id": 1,
    "result": {
        "message": "success",
        "method": "en_getQuotes",
        "result": [
            {
                "dexId": "1300",
                "dexName": "UniswapV3",
                "value": "999"
            },
            {
                "dexId": "1500",
                "dexName": "CurveV2",
                "value": "999"
            },
            {
                "dexId": "1000",
                "dexName": "UniswapV2",
                "value": "997"
            },
            {
                "dexId": "1100",
                "dexName": "SushiswapV2",
                "value": "996"
            }
        ]
    },
    "jsonrpc": "2.0"
}

Get User Liquidity

The user will be able to get the balance of a particular token pair of an account.

URL:

https://quicknode.expand.network/dex

Payload:

{
    "method": "en_getUserLiquidity",
    "params": [
        {
            "tokenA": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "tokenB": "0x6b175474e89094c44da98b954eedeac495271d0f",
            "address": "0x6fb447ae94f5180254d436a693907a1f57696900"
        }
    ]
}
{
    "id": 1,
    "result": {
        "message": "success",
        "method": "en_getUserLiquidity",
        "result": {
            "pairAddress": "0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11",
            "liquidity": "2370404879481514",
            "tokenA": "109641696331105.2",
            "tokenB": "173027102912280350"
        }
    },
    "jsonrpc": "2.0"
}

Get Pool Liquidity

The user will be able to get the individual token liquidity within the specified liquidity pool.

URL:

https://quicknode.expand.network/dex

Payload:

{
    "method": "en_getPoolLiquidity",
    "params": [
        {
            "poolAddress": "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"
        }
    ]
}
{
    "id": 1,
    "result": {
        "message": "success",
        "method": "en_getPoolLiquidity",
        "result": {
            "totalLiquidity": "367337363162120717"
        }
    },
    "jsonrpc": "2.0"
}

Swap

The user will be able to swap tokens on different Dex.

Note: If the 'bestSwap' field is set to true, the prepared transaction will offer the optimal route for the swap.

Conversely, if the 'bestSwap' field is set to false, the prepared transaction will be sourced from multiple decentralized exchanges (DEXs), contingent on the availability of liquidity pools.

URL:

https://quicknode.expand.network/dex

Payload:

{
    "method": "en_swap",
    "params": [
        {
            "path": [
                "0x6b175474e89094c44da98b954eedeac495271d0f",
                "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
            ],
            "amountIn": "1000000000000000",
            "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
            "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
            "gas": "230000",
            "maxSlippage": "3",
            "bestSwap": true             
        }
    ]
}
//----------------------If bestSwap is true----------------------
{
    "id": 1,
    "result": {
        "message": "success",
        "method": "en_swap",
        "result": {
            "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
            "to": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
            "value": "0",
            "gas": "230000",
            "data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e4472b43f300000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000003e4000000000000000000000000000000000000000000000000000000000000008000000000000000000000000063056e00436da25bcf48a40dfbbdcc708935100600000000000000000000000000000000000000000000000000000000000000020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000"
        }
    },
    "jsonrpc": "2.0"
}

//----------------------If bestSwap is false----------------------
{
    "id": 1,
    "result": {
        "message": "success",
        "method": "en_swap",
        "result": {
            "UniswapV2": {
                "from": "0xfFb4264A596751a580F046193f43064839052d6c",
                "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
                "value": "0",
                "gas": "990000",
                "data": "0x38ed17390000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ffb4264a596751a580f046193f43064839052d6c0000000000000000000000000000000000000000000000000000018acb343dfd0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f"
            },
            "UniswapV3": {
                "from": "0xfFb4264A596751a580F046193f43064839052d6c",
                "to": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
                "value": "0",
                "gas": "990000",
                "data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e4472b43f30000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000ffb4264a596751a580f046193f43064839052d6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000"
            },
            "SushiswapV2": {
                "from": "0xfFb4264A596751a580F046193f43064839052d6c",
                "to": "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F",
                "value": "0",
                "gas": "990000",
                "data": "0x38ed17390000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ffb4264a596751a580f046193f43064839052d6c0000000000000000000000000000000000000000000000000000018acb343dfd0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f"
            }
        }
    },
    "jsonrpc": "2.0"
}

Add Liquidity

The user will be able to add liquidity on different Dex.

URL:

https://quicknode.expand.network/dex

Payload:

{
    "method": "en_addLiquidity",
    "params": [
        {
            "dexId": "1400",
            "amountIn": [
                "1000000000000000000",
                "1000000000000000000"
            ],
            "amountOut": "0",
            "path": [
                "0x6B175474E89094C44Da98b954EedeAC495271d0F",
                "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
            ],
            "fromInternalBalance": false,
            "to": "0xfFb4264A596751a580F046193f43064839052d6c",
            "deadline": "1694617738234",
            "from": "0xfFb4264A596751a580F046193f43064839052d6c",
            "gas": "230000"
        }
    ]
}
{
    "id": 1,
    "result": {
        "message": "success",
        "method": "en_addLiquidity",
        "result": {
            "from": "0xfFb4264A596751a580F046193f43064839052d6c",
            "to": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
            "value": "0",
            "gas": "230000",
            "data": "0xb95cac280b09dea16768f0799065c475be02919503cb2a3500020000000000000000001a000000000000000000000000ffb4264a596751a580f046193f43064839052d6c000000000000000000000000ffb4264a596751a580f046193f43064839052d6c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000de0b6b3a7640000"
        }
    },
    "jsonrpc": "2.0"
}

Remove Liquidity

The user will be able to remove liquidity on different Dex.

URL:

https://quicknode.expand.network/dex

Payload:

{
    "method": "en_removeLiquidity",
    "params": [
        {
            "dexId": "1400",
            "amountOut": [
                "91",
                "91"
            ],
            "path": [
                "0x6B175474E89094C44Da98b954EedeAC495271d0F",
                "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
            ],
            "amountIn": "147692016912345470",
            "toInternalBalance": false,
            "to": "0xfFb4264A596751a580F046193f43064839052d6c",
            "from": "0xfFb4264A596751a580F046193f43064839052d6c",
            "gas": "230000"
        }
    ]
}
{
    "id": 1,
    "result": {
        "message": "success",
        "method": "en_removeLiquidity",
        "result": {
            "from": "0xfFb4264A596751a580F046193f43064839052d6c",
            "to": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
            "value": "0",
            "gas": "230000",
            "data": "0x8bdb39130b09dea16768f0799065c475be02919503cb2a3500020000000000000000001a000000000000000000000000ffb4264a596751a580f046193f43064839052d6c000000000000000000000000ffb4264a596751a580f046193f43064839052d6c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000000000000005b00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000020cb51b5c38a97e"
        }
    },
    "jsonrpc": "2.0"
}
PreviousQuicknode MarketplaceNextLending Protocols

Last updated 10 months ago