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

Refer to the DEX ID page for details.

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

/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

Refer to the DEX ID page for details.

https://api.expand.network/dex/getliquiditysources?dexId=1602

/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

Refer to the DEX ID page for details.

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"
}

With gasPriority:

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

With Slippage:

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

With ofacCheck:

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

Last updated