Fury Docs
GithubAnnouncements
  • Introduction
  • Raze.bot
    • Solana UI
  • FURY API
    • Getting Started
  • Overview & Protocols
  • Token Management
  • Wallet Operations
  • Bundler e Cleaner
  • PnL calculator
  • Generate public key mint
  • FURY SDK
    • SDK for Python
    • SDK for Rust
    • SDK for TypeScript
Powered by GitBook
LogoLogo

Untitled

  • Website
On this page
  • Overview & Protocols
  • Understanding Protocols
  • Buy Tokens (POST /api/tokens/buy)
  • Sell Tokens (POST /api/tokens/sell)

Overview & Protocols

Overview & Protocols

Fury integrates with several popular Solana Decentralized Exchanges (DEXs) and aggregators, allowing you to execute trades programmatically. Supported platforms include:

  • Jupiter: A leading swap aggregator, ideal for finding the best price across multiple liquidity sources, including complex token-to-token swaps.

  • Raydium

  • Pump.fun

  • Moonshot

  • PumpSwap

You can specify which protocol to use for your buy/sell operations via the protocol parameter in the request body.

Understanding Protocols

The protocol parameter is crucial for directing your trades:

  • "jupiter": Recommended for best-price execution and handling swaps (SOL-Token, potentially Token-Token). Uses the Jupiter Aggregator V6 API.

  • "raydium": Executes trades directly against Raydium liquidity pools.

  • "pumpfun": Executes trades specifically on the Pump.fun platform.

  • "moonswap": Executes trades on Moonswap.

Choosing the right protocol depends on your specific needs (best price vs. specific platform interaction).

Buy Tokens (POST /api/tokens/buy)

This endpoint allows you to purchase tokens, typically using SOL as the input currency. Specify the wallet making the purchase, the token to buy, the amount of SOL to spend, slippage tolerance, and the desired trading protocol.

Request Endpoint: POST /api/tokens/buy

Request Body: application/json

{
  "walletAddress": "your_wallet_public_key",
  "tokenAddress": "mint_address_of_token_to_buy",
  "amount": 1.5, // Amount of SOL to spend
  "slippageBps": 50, // Slippage tolerance in basis points (e.g., 50 = 0.5%)
  "protocol": "jupiter", // e.g., 'jupiter', 'raydium', 'pumpfun', 'moonswap'
  "slippageMax": "true" // Strict slippage enforcement (boolean likely intended)
}

Note: When using protocol: "jupiter", Fury leverages Jupiter's aggregation to find the best rate. Success Response (200 OK): Returns transaction signatures.

{
  "success": true,
  "transactions": ["tx_sig_1", "tx_sig_2"]
}

Common Errors:

  • 400 Bad Request: Invalid parameters (missing fields, incorrect types).

  • 500 Internal Server Error: DEX interaction error, insufficient SOL balance, network issues.

Sell Tokens (POST /api/tokens/sell)

This endpoint sells a specified amount of a token from your wallet, typically receiving SOL in return. Specify the wallet, token, amount to sell, slippage, and protocol.

Request Endpoint: POST /api/tokens/sell

Request Body: application/json

{
  "walletAddress": "your_wallet_public_key",
  "tokenAddress": "mint_address_of_token_to_sell",
  "amount": 100.0, // Amount of the token to sell (raw amount)
  "slippageBps": 50,
  "protocol": "raydium", // Specify the target DEX/protocol
  "slippageMax": "true"
}

Note: Using protocol: "jupiter" allows selling into the best available liquidity across aggregated sources.

Success Response (200 OK): Returns transaction signatures.

{
  "success": true,
  "transactions": ["tx_sig_1"]
}

Common Errors:

  • 400 Bad Request: Invalid parameters.

  • 500 Internal Server Error: DEX interaction error, insufficient token balance.

PreviousGetting StartedNextToken Management

Last updated 1 month ago