Dexlab Docs
DexlabCreate TokenPool/SwapMomeTelegram
  • 🤘Introducing
  • PRODUCTS
    • 🔬Token Factory
      • 1️⃣Quick Token Creation Guide
      • 2️⃣Change Token Information (Update Metadata)
      • 3️⃣Manage Token (Burn, Mint, Revoke Freeze, Revoke Mint)
      • 4️⃣Token Hub – Manage & Explore
      • 💹Create OpenBook Market ID
      • ⁉️Token decimal guide
      • ⁉️Factory Fee
      • ⁉️How to check market ID?
      • ⁉️FAQ
      • Terms of service
    • 🤽‍♂️DEX(Swap/LP Pool)
      • 🔄Token Swap
      • 🔱Create Your Own Liquidity Pool – Easy & Fast!
      • ⚙️Provide & Manage Liquidity
    • 👼Mome Launchpad
    • 🔧SuperTools for XPLA
      • CW20 Token Creation
        • 1️⃣Instantiate (Minting)
        • 2️⃣Query Contract
        • 3️⃣Execute (Burn, Send, Logo Updated, etc)
        • ⚠️How to Get My CW20 Token Contract Address
      • CW721 Token Creation (NFT)
        • 1️⃣Instantiate (Minting)
        • 2️⃣Query Contract
        • 3️⃣Execute (Send, Transfer, Burn, etc)
        • ⚠️How to Check My CW721 on XPLA Explorer
    • 🔋SuperDEX for XPLA
      • BI/CI
      • Keplr Wallet Creation
    • 📋Terms of Service
    • 📖Platform Disclaimer
    • 📖SDK & API License Agreement
  • developer hub
    • 🏗️Token & Swap APIs
      • API Key Issuance Guide
      • Swap API
      • Token Creator API
    • Dexlab Factory Bot
  • ADDITIONAL RESOURCES
    • Twitter
    • Discord
    • Telegram
    • Medium
Powered by GitBook

© Copyright 2025 DEXLAB | All Rights Reserved

On this page
  1. developer hub
  2. Token & Swap APIs

Swap API

PreviousAPI Key Issuance GuideNextToken Creator API

Last updated 2 months ago

API Reference

Swap API is completely free and offers a highly intuitive and secure REST API.

As a powerful aggregator integrating various DEXs (Decentralized Exchanges) within the Solana ecosystem, Dexlab partners with the trusted global exchange, , to provide a stable and efficient trading environment.

Developers and project teams can leverage Dexlab Swap API to easily access liquidity, optimize trading routes, and experience cost savings with high trading performance.

The Open API is freely accessible with no restrictions. However, it is subject to a rate limit of 2 request per second (RPS) per IP, and the referral fee can be set up to a maximum of 3% (100 bps).

API Endpoint

All APIs are free to use, but the Pro API requires an API key(Free) issuance.

  • Open API: https://open-api.dexlab.space/

    • There is a rate limit of 10 RPS. If you need more, get a free API key.

  • Pro API( API key required ): https://pro-api.dexlab.space/

    • The rate limit is increased and free.

Token Swap

When using the Open API endpoint, the x-api-key is not required.

🏗️
Dexlab
OKX
Dexlab API Key Request
  • API Reference
  • API Endpoint
  • Token Swap
  • POST/dex/swap
post
Body
userWalletAddressstringRequired

The wallet address of the user initiating the swap.

amountstringRequired

The amount to swap. Must include precision (e.g., 1.00 USDT -> 1000000, 1.00 SOL -> 1000000000).

fromTokenAddressstringRequired

The public key of the token to swap from.

toTokenAddressstringRequired

The public key of the token to swap to.

slippageBpsnumber · max: 10000Required

The maximum acceptable slippage in bps (basis points). Default is 500 (5%).

referrerWalletAddressstringOptional

Optional wallet address to receive referrer fees.

referrerFeeBpsnumber · max: 300Optional

Optional referrer fee in bps (basis points). Range: 0-300 for Open API, For Pro API, the limit varies depending on the contract.

Responses
200
200 response
application/json
400
400 response
application/json
500
500 response
application/json
post
POST /dex/swap HTTP/1.1
Host: open-api.dexlab.space
Content-Type: application/json
Accept: */*
Content-Length: 160

{
  "userWalletAddress": "text",
  "amount": "text",
  "fromTokenAddress": "text",
  "toTokenAddress": "text",
  "slippageBps": 1,
  "referrerWalletAddress": "text",
  "referrerFeeBps": 1
}
{
  "data": {
    "bestRouter": {
      "router": "text",
      "subRouters": [
        {
          "protocol": [
            {
              "name": "text",
              "percent": "text"
            }
          ],
          "fromTokenAddress": "text",
          "toTokenAddress": "text"
        }
      ]
    },
    "requester": "text",
    "fromTokenAddress": "text",
    "toTokenAddress": "text",
    "fromTokenAmount": "text",
    "toTokenAmount": "text",
    "maxSpendAmount": "text",
    "minReceiveAmount": "text",
    "slippage": "text",
    "requestAmount": "text",
    "useBoost": true,
    "tx": "text"
  }
}