Skip to main content

token_trade

Execute buy or sell trades for tokens on the Odin platform.

Method Signature

Parameters

TradeRequest

TradeType

TradeAmount

  • btc: Amount in BTC (when buying tokens)
  • token: Amount in tokens (when selling tokens)

TradeSettings (Optional)

Response

TradeResponse

  • Success: { ok: null } - Trade executed successfully
  • Error: { err: string } - Error message describing what went wrong

Example Usage

Buy Tokens with BTC

Sell Tokens for BTC

With Slippage Settings