CobaltX Docs
  • ✌️Welcome to CobaltX
  • CobaltX
  • Getting Started
    • SPL Wallet
      • Buying and selling digital assets
    • How-to guides
    • Best practices
    • FAQ
  • Traders
    • Swapping
      • Swap FAQ
    • Trade API
  • Liquidity providers
    • Providing Concentrated Liquidity (CLMM)
      • Intro on Concentrated Liquidity
      • Estimated APR Calculations
    • Liquidity providing FAQ
  • POOL CREATION
    • Creating a CLMM Pool
    • Pool creation FAQ
  • CobaltX Token
    • 🧬CobaltX Token
    • CobaltX Tokens Buybacks
  • Protocol
    • 🧬The CobaltX Protocol
    • Developers
      • Addresses
      • APIs
    • Security
      • Access Controls
  • UPDATES
    • Token-2022 Support
  • Learn more
    • Twitter
Powered by GitBook
On this page
  • Get quote parameters
  • Post parameters
  1. Traders

Trade API

CobaltX trade API is the fastest and easiest way to interact with CobaltX liquidity. It allows you to swap for any asset with 2 requests and a signature.

Get quote parameters

Parameter
Type
Required
Description

inputMint

string

yes

Input token mint address

outputMint

string

yes

Output token mint address

amount

number

yes

Either inputAmount or outpoutAmount depending on the swap mode.

slippageBps

number

yes

Slippage tolerance in base points (0.01%).

Post parameters

Parameter
Parameter
Required
Description

version

string

yes

Use 'V0' for versioned transaction, and 'LEGACY' for legacy transaction.

wrapEth

boolean

no

Need to be true to accept ETH as inputToken.

unwrapEth

boolean

no

Need to set to true to unwrap wSol received as outputToken.

computeUnitPriceMicroLamports

string

yes

You can type it in manually or use CobaltX priority fee API to set an automatic amount with 'String(data.data.default.h)'. The 'h' here stands for high priority.

'vh' for very high and 'm' for medium are also accepted value.

wallet

string

yes

pubkey

inputTokenAccount

string

no

default to ATA

outpoutTokenAccount

string

no

default to ATA

PreviousSwap FAQNextProviding Concentrated Liquidity (CLMM)

Last updated 4 months ago