bloXroute Documentation
WebsiteBlogTwitterDiscord
  • Welcome to bloXroute
  • Introduction
    • Why Use bloXroute?
    • Products
    • Create An Account
    • Technical Support
  • SOLANA
    • Trader API
      • Introduction
        • Regions
        • Authorization
        • Rate Limits
        • Tip and Tipping Addresses
      • Quick Start
        • Transaction Submission
        • Front-Running Protection & Transaction Bundle
        • Go SDK
        • Python SDK
        • Typescript SDK
        • Rust SDK
      • API Endpoints
        • Core Endpoints
          • submit
          • submit-paladin
          • submit-batch
          • balance
          • rate-limit
          • transaction
          • priority-fee
          • GetPriorityFeeStream
          • GetBundleTipStream
          • submit-snipe
        • Pump.fun
          • quotes
          • swap
          • swap-sol
          • GetPumpFunNewTokensStream
          • GetPumpFunSwapsStream
          • GetPumpFunAMMSwapsStream
        • Raydium
          • quotes
          • pools
          • pool-reserves
          • swap
          • cpmm-swap
          • clmm-swap
          • route-swap
          • GetPoolReservesStream
          • GetSwapsStream
          • GetNewRaydiumPoolsStream
          • GetNewRaydiumPoolsByTransactionStream
        • Jupiter
          • quotes
          • swap
          • swap-instructions
          • route-swap
        • Openbook
          • markets
          • orderbooks/{market}
          • depth/{market}
          • tickers/{market}
          • open-orders/{market}
          • unsettled/{market}
          • place
          • replace
          • cancel
          • settle
          • GetOrderbooksStream
          • GetTickersStream
      • Best Performance for Landing Transactions
      • Support
        • API Health
        • Contact us
        • Suggestions
        • Wiki
          • Terms & Concepts
          • Resources
    • Optimized Feed Relay (OFR)
      • Transaction Streamer
      • Gateway and OFR Requirements
      • Gateway and OFR Setup
      • Gateway Startup Arguments
      • OFR performance
      • Logging
      • Submitting Transaction
      • Upgrading Gateway
      • Troubleshooting
  • BSC & ETH
    • EVM Blockchain Distribution Network (BDN)
      • How to Connect
      • The bloXroute Gateway
        • Local Gateway
          • Installation and Startup
            • Authentication & Certificates
            • Requirements
            • Supported Clients
            • GitHub repository option
            • Docker container option
            • Startup Script
            • Startup Arguments
          • General Connectivity Troubleshooting
          • Logging
          • Upgrading your Gateway
        • Add Your Gateway as a Trusted Peer to Your Execution Layer Client
        • Connecting Your Gateway with the Consensus Layer
      • IPs & Relays
        • Relays IPs
        • Private Relays
        • Cloud-API IPs
          • ⏩Reducing Latencies using the BDN
    • APIs
      • Authorization
      • Check Transaction Quota
      • Submit a Transaction
        • Raw Transaction Construction
        • Tx-Validation
        • Batch Transaction
      • Private Transactions
        • ETH Private Transactions
        • BSC Private Transactions
      • Transaction Bundles
        • Bundle Simulation
        • Bundle Validation
        • Bundle Submission
          • BSC Bundle Submission
            • List of BSC Validators
          • ETH Bundle Submission
          • Bundle Submission with Gateway
        • Bundle Tracking
          • BSC Bundle-Trace
          • ETH Bundle-Trace
          • ETH Bundle Inclusion Status
        • Bundle Refunds
          • Priority Fee Refund
          • Bundle Refund
          • Latest Bundle Refunds
      • Backrun Arbitrage
        • BackRunMe: Bundle Submission
          • BSC submit arbOnly
          • ETH submit arbOnly
            • blxr_info
            • ETH arbOnly Simulation
      • Token Launch Sniping
      • Other Utilities
        • List of bloXroute Builders
        • List of External Builders
        • Tx-Trace
        • Ping
    • Streams
      • Requirements
      • Subscription limits
      • Working With Streams
        • Creating a Subscription
          • Websocket
          • gRPC
        • Handling the Notification
          • Websocket
          • gRPC
        • Cancelling a Subscription
          • Websocket
          • gRPC
        • Local Node Validation
      • newTxs and pendingTxs
        • Filters
        • Raw TX Reconstruction
      • BackRunMe: arbOnlyMEV
        • ETH arbOnlyMEV
        • BSC arbOnlyMEV
      • transactionStatus
      • txReceipts
      • newBlocks
      • bdnBlocks
      • ethOnBlock
      • MEVBlockValue
      • MEVNextProposerInfo
    • Block Builders and Validators
      • Validator Gateway
      • MEV Relay (For Validators)
      • Block Submission
      • Proposer MEV-Protect
      • Compliance Lists
      • Preconfirmations
    • Protect RPCs
      • ETH Protect RPC
      • ETH Gas Protect RPC
      • BSC Protect RPC
      • SOL Protect RPC
  • Base Network
    • Submit Transactions
    • Streams
      • GetBdnBlockStream
  • TON NETWORK
    • TON Trader API
      • Quick Start
      • Fee Schedule
      • Connection
      • Submit Signed Transaction
  • Resources
    • BDN Explorer
    • Block Explorer
    • Guides
      • Algorithmic Trading
      • Setting Up a Local Gateway
      • Gateway as Web3 Bridge
    • Architecture
      • BDN Architecture
        • Network Components
        • Performance Techniques
          • Block Compression
          • Cut-through Routing
          • Optimized Topology
      • bloXroute Protocol
        • Versioning
        • Message Structure
        • Message Types
    • Contact Us
Powered by GitBook
On this page
  • Request
  • Response:
  1. SOLANA
  2. Trader API
  3. API Endpoints
  4. Jupiter

swap

Creates an unsigned transaction for the best possible swap through the specified tokens provided by Jupiter.

PreviousquotesNextswap-instructions

This endpoint does not submit the transaction to the network.

Request

Method:

POST ./api/v2/jupiter/swap

The tip parameter is currently not supported. You can create an additional transaction with an tip instruction and submit the swap & tip transactions as a .

Parameters:

Parameter
Type
Description

ownerAddress

string

Solana address which is placing swap.

inToken

string

Symbol or token program address of the swap-in token for the current step.

outToken

string

Symbol or token program address of the swap-out token.

inAmount

number

The amount of token wanted to be swapped from.

slippage

number

The maximum slippage tolerance in percentage.

computePrice

number

OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to overwrite default Jupiter compute price.

Request example:

curl -X 'POST' \
  -H "Authorization: $AUTH_HEADER" \
  -H 'Content-Type: application/json' \
  'https://ny.solana.dex.blxrbdn.com/api/v2/jupiter/swap' \
  -d '{
  "ownerAddress": "AFT8VayE7qr8MoQsW3wHsDS83HhEvhGWdbNSHRKeUDfQ",
  "inToken": "SOL",
  "outToken": "USDC",
  "inAmount": 0.1,
  "slippage": 0.001
}'

wscat --header "Authorization: $AUTH_HEADER" 
-c wss://ny.solana.dex.blxrbdn.com/ws 
--execute '{"jsonrpc": "2.0", "id": 1, 
"method": "PostTradeSwap", 
"params": {"Owner": "2JJQHAYdogfB1fE1ftcvFcsQAXSgQQKkafCwZczWdSWd", 
"inToken": "USDC", 
"outToken":"SOL", 
"inAmount": 0.1, 
"slippage": 5, 
"project": "P_JUPITER"}}'
g.PostTradeSwap(context.Background(), "AFT8VayE7qr8MoQsW3wHsDS83HhEvhGWdbNSHRKeUDfQ", "SOL", "USDC", 0.1, 0.001, pb.Project_P_JUPITER)
await provider.postTradeSwap({
    ownerAddress: ownerAddress,
    inToken: "USDC",
    outToken: "SOL",
    inAmount: 0.01,
    slippage: 0.1,
    project: "P_JUPITER",
})

Response:

Fields:

Field
Type
Description

transaction

[]TransactionMessage

Raw bytes of unsigned transaction. See TransactionMessage below

outAmount

double

Amount of tokens expected from the swap

outAmountMin

double

Minimum amount of tokens allowed from swap given slippage

priceImpact

PriceImpactPercentV2

Impact of swap upon the pool's liquidity. See PriceImpactPercentV2 below.

fee

Fee

Fee paid to AMM project. See Fee below.

PriceImpactPercentV2

Field
Type
Description

percent

double

Percentage impact on price.

infinity

string

Indicates possible infinity values: INF_NOT, INF_POSITIVE, INF_NEGATIVE. Usually INF_NOT.

fee

Field
Type
Description

amount

float

Amount paid to AMM project

mint

string

Token currency the fee is paid in

percent

float

Percentage of the swap consumed by the fee

Example:

{
    "transactions":[
        "AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg1Lo4g1hEH0nZ/T5G7nTAttcpmpseiXTXm0014hV7EHwEHh2GMqr0U7fduiXRYJGJhJ0CpV6kxeccTVonDvECAgAJF4ls26fgpAnCYufUzDrXMMpDjMYkf2Y2FHuxqKE+2+Ir73zZ7a97axh2Uh16NmlxFpyIf8w7yNqLsuZ/bbJoAJM9bkcuZ6RuprS9C6ud/TXitMcvHW1Zwuq5XJQlc60i8fQRtdRejGa7LPcbb0X1rADKVzfxp2IFx3sK/viF6uXHq+Q8fB4h6qb5fIvTVeIb0SeWdHVsHI4QbG5xK6EW2XC4cOEt03mJFWHS6fqPJkMYNOtzby8k/CoqTf8f1dyk3/LLubdg7dsYVwYwMGOtM9e1cpbqAtTgM14xzq+kzELdhML7GK7WGfVGYyZT7wYCnwKoZL84KYZxgbsg3x1xXDAA9CbhbrjPAxGRdfmAUUNElVzjcOdllA88KUOVRftFqabf0VxQdwX5M5uVPBpN/bycwYbdL2LfSKlYBF4qdlJZQCCJRlPP3fp7fmDJZmgnNqLbD4OFZJJbEQd6IeA215cfJvXwRhxAEL1cyMpwZt2lhKbucXk0xnet9MJfvRVqLWrj7TJ6D4hJp3KUHZcFDzpujLjdOrzbFHCIfIK1TT82K7AOSM28B8gwNuoiq44hs2cvrKE9TfLl8AjQJIG18IIGm4hX/quBhPtof2NGGMA12sQ53BrrO1WYoPAAAAAAAQan1RcZLFxRIYzJTD1K8X9Y2u4Im6H9ROPb2YoAAAAABt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKlBV7BYDzHF/ORKYlgtvPnXjudZQ6CEo5OzUDaNIomTCIUPLW4CpHr4JNCatp3ELXDLKMv6JJ+37le50lbBJ2Lv7BOKeAgUWPsd/ZDPmI9XmYqos8e4j1u2K4WnhlVcz30AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEvZScQ2AsM/IHeQ7RajUkyhuZdc8SGiqQz/7H34torN86EED9glv4WMHdJchvP2ZZvDPQq6PniaYqUsrsmZ94EZ8+1v+p9XMyTSHFcQqqY1KB217YyB72dA2rGwMEftogUUAgABNAAAAACAd44GAAAAAKUAAAAAAAAABt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKkQBAEOAA8BARUSEAIRAwQFBhIHCAkKCwwTAQ0AEQkA4fUFAAAAAMaAAAAAAAAAEAMBAAABCRYAH1Bvd2VyZWQgYnkgYmxvWHJvdXRlIFRyYWRlciBBcGk="
    ],
    "outAmount":3.296703,
    "outAmountMin":0.032966,
    "priceImpact":{
        "percent":4.5386233671508175e-7,
        "infinity":"INF_NOT"
    },
    "fee":{
        "amount":0.00025,
        "mint":"",
        "percent":0
    }
}
Bundle