Dexlab Docs
DexlabCreate TokenPool/SwapMomeTelegram
  • ๐Ÿค˜Introducing
  • developer hub
    • ๐Ÿ—๏ธToken & Swap APIs
      • API Key Issuance Guide
      • Swap API
      • Token Creator API
  • PRODUCTS
    • ๐Ÿค–Dexlab Factory Bot
      • ๐Ÿ Getting Started
      • ๐Ÿ”Deposit Wallet
      • ๐Ÿ‘ฌReferral Reward
      • ๐Ÿ’ŽDRP Reward
      • ๐Ÿš€Token Launch
      • ๐Ÿ”„Trade(Buy/Sell)
      • ๐Ÿ”ŽToken Search & Trending
      • ๐ŸงฉPlayground
      • ๐Ÿ’ผMultiple Wallets
      • ๐ŸงชCopy & Trade Token
      • โš™๏ธBot Settings
    • ๐Ÿ”ฌ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
  • 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"
  }
}