Orca

/getprice

Returns the swap quotation for the given token pair.

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

Query Parameters

NameTypeDescription

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

Token amount for which the swap quotation is to be fetched.

https://api.expand.network/dex/getprice?path=So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amountIn=100000&dexId=2500

/getuserliquidity

Returns the balance of a particular token pair of an account.

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

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

dexId*

String

Refer to DEX ID page for details.

positionNFT*

String

LP token that represents a position in a pool.

https://api.expand.network/dex/getuserliquidity?dexId=2500&positionNFT=45z3G8PxyTuFa9tbr9QMmscGVHvZir4vQK1U5LRKeSQd

/getpoolliquidity

Returns the total liquidity for a specified pool.

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

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

poolAddress*

String

Pool address whose liquidity is to be fetched.

dexId*

String

Refer to DEX ID page for details.

https://api.expand.network/dex/getpoolliquidity?dexId=2500&poolAddress=Hp53XEtt4S8SvPCXarsLSdGfZBuUr5mMmZmX2DRNXQKp

/gettokenliquidity

Returns the individual token liquidity within the specified liquidity pool.

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

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

dexId*

String

Refer to DEX ID page for details.

poolAddress*

String

Pool address whose token liquidity is to be fetched.

https://api.expand.network/dex/gettokenliquidity?dexId=2500&poolAddress=8phK65jxmTPEN158xLgSr4oZvssw9SyTErpNZj3g7px4

/swap

Initiate a swap transaction on a specified DEX.

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

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

dexId*

String

Refer to the DEX ID page for details.

path*

Array

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

amountIn*

String

Amount of token to be swapped.

from*

String

Address of the sender of the token.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 10

closeWSolAccount

Boolean

By default, false. If true, will convert the entire WSOL token to SOL token.

{
  "dexId": "2500",
  "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
  "amountIn": "100000",
  "closeWSolAccount": false,
  "path": [
    "So11111111111111111111111111111111111111112",
    "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  ]
}

With Slippage:

{
  "dexId": "2500",
  "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
  "amountIn": "100000",
  "slippage": "3",
  "path": [
    "So11111111111111111111111111111111111111112",
    "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  ]
}

/addliquidity

Add liquidity to a specified pool in a specified DEX.

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

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

dexId*

String

Refer to the DEX ID page for details.

path*

Array

Comma-separated values of token addresses, inside an array, which needs to be added to the pool.

amountIn*

Array

Comma-separated values of tokens amount, inside an array, which needs to be added to the pool.

from*

String

Address of the sender of the token.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 10

{
  "dexId": "2500",
  "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
  "amountIn": [
    "100000",
    "100000"
  ],
  "path": [
    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  ]
}

With Slippage:

{
  "dexId": "2500",
  "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
  "amountIn": [
    "100000",
    "100000"
  ],
  "slippage": "3",
  "path": [
    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  ]
}

/removeliquidity

Remove liquidity from a specified pool for a specified DEX.

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

Request Body

NameTypeDescription

rpc

String

dexId*

String

Refer to the DEX ID page for details.

path*

Array

Comma-separated values of token addresses, inside an array, which needs to be added to the pool.

from*

String

Address of the sender of the token.

liquidity*

String

Total amount of liquidity to be removed from the given pool.

positionNFT*

String

LP token that represents a position in a pool.

Slippage

String

Percentage of total value. By default, 1. 0 <= slippage value <= 10

{
    "dexId": "2500",
    "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
    "liquidity": "16056",
    "positionNFT": "2mMzQ1s29HkC2b5VWiwWdciy7TUo2jx5BV1F2aXNYA2q",
    "path": [
        "So11111111111111111111111111111111111111112",
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ]
}

With Slippage:

{
    "dexId": "2500",
    "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
    "liquidity": "16056",
    "positionNFT": "2mMzQ1s29HkC2b5VWiwWdciy7TUo2jx5BV1F2aXNYA2q",
    "path": [
        "So11111111111111111111111111111111111111112",
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ],
    "slippage": "10"
}

Last updated