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. Openbook

replace

Create raw bytes of an unsigned transaction to place an order by specified parameters.

PreviousplaceNextcancel

Last updated 4 months ago

This endpoint does not submit the transaction to the network.

The endpoint allows you to specify priority fees and tips to later control the transaction inclusion and propagation. Refer to the& page for additional information about these parameters.

Request

Method:

POST ./api/v2/openbook/replace

Parameters:

Parameter
Type
Description

orderID

string

Unique order ID to be replaced. This order ID is assigned by the orderbook after processing, and can be difficult to associate with a transaction without the clientOrderId.

clientOrderId

string

OPTIONAL. Client order id which can be customized by the user.

ownerAddress

string

User's account address to place order

payerAddress

string

Account address to pay for the order. Typically, this is the same as ownerAddress if providing SOL, else the SPL token wallet for the relevant token.

market

string

Smart contract address/symbol of the market.

side

string

Order type, “ASK” or “BID”

amount

number

Order size

price

number

Order price. Not applicable if the type is "market"

type

string

Supported types: "LIMIT", "IOC", "POSTONLY"

openOrdersAddress

string

Define with open order address to place the order in case of having multiple open order addresses.

computeLimit

number

OPTIONAL. Specifies total compute limit to be allocated for all instructions within the created tx

computePrice

number

OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to be included as a part of instruction, known as priority fee.

tip

uint64

Request example:

curl --header "Authorization: $AUTH_HEADER" \
-X 'POST' \
  'https://ny.solana.dex.blxrbdn.com/api/v2/openbook/replace' \
  -H 'Content-Type: application/json' \
  -d '{
  "ownerAddress": "AFT8VayE7qr8MoQsW3wHsDS83HhEvhGWdbNSHRKeUDfQ",
  "payerAddress": "AFT8VayE7qr8MoQsW3wHsDS83HhEvhGWdbNSHRKeUDfQ",
  "market": "SOLUSDC",
  "side": "S_ASK",
  "amount": 0,
  "price": 0,
  "openOrdersAddress": "5yyh4mzzycmjfR6arY736d1mB6vNSLiUaFWfepKLf8kZ",
  "clientOrderID": "12324",
  "orderID": "1569817920672682842648894460"
}'
wscat --header "Authorization: $AUTH_HEADER"
-c ws://ny.solana.dex.blxrbdn.com/ws --wait 1000 --execute '{"jsonrpc": "2.0", "id": 1, "method": "PostReplaceOrder", "params": {
  "orderID": "1569817920672682842648894460",
  "ownerAddress": "AFT8VayE7qr8MoQsW3wHsDS83HhEvhGWdbNSHRKeUDfQ",
  "payerAddress": "AFT8VayE7qr8MoQsW3wHsDS83HhEvhGWdbNSHRKeUDfQ",
  "market": "SOLUSDC",
  "side": "S_ASK",
  "type": [
    "OT_LIMIT"
  ],
  "amount": 0.1,
  "price": 10000000,
  "openOrdersAddress": "5yyh4mzzycmjfR6arY736d1mB6vNSLiUaFWfepKLf8kZ",
  "clientOrderID": "1234"
}}'
//Make sure to set environment variable AUTH_HEADER.
transaction, err := g.PostReplaceOrder(
    ctx,
    "1569817920672682842648894460", // orderID to replace
    "BraJjCwLLqw8TciQXYruDEF4YhDkGwoEnwnAdwJSjcgC", // owner solana wallet address
    "4raJjCwLLqw8TciQXYruDEF4YhDkGwoEnwnAdwJSjcgv", // SPL token wallet address 
    "SOL/USDC", // market 
    pb.Side_S_BID, // trade side (Bid/Ask)
    []pb.OrderType{pb.OrderType_OT_LIMIT}, // OrderType
    20, // order size
    float64(0.124), // order price 
    provider.PostOrderOpts{
        ClientOrderID: 5000, // Client controlled OrderID
    }
)
#Make sure to set environment variable AUTH_HEADER.
await api.submit_replace_order(
    owner_address=PUBLIC_KEY,
    payer_address=PUBLIC_KEY,
    market="SOLUSDC",
    side=proto.Side.S_ASK,
    types=[proto.OrderType.OT_LIMIT],
    amount=0.1,
    price=150_000,
    # optional, but much faster if known
    open_orders_address="5yyh4mzzycmjfR6arY736d1mB6vNSLiUaFWfepKLf8kZ",
    # optional, for identification
    client_order_id=0,
    order_id=""
)
await provider.postReplace({
    orderId: "12345",
    ownerAddress: ownerAddress,
    payerAddress: payerAddress,
    market: "SOLUSDC",
    side: "S_ASK",
    type: ["OT_LIMIT"],
    amount: 0.1,
    price: 200,
    project: "P_UNKNOWN",
})

Response:

Fields:

Field
Description

transaction

Raw bytes of unsigned transaction

openOrdersAddress

The open order address to place the order

Example:

{
  "transaction": "AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3VviHhRXwajmbHjA81VWXrZn5eFs8QQgktl0zJIHYBY3t6VHnwK40CkHx94w499MTm6w2xUFNd4g/td6s0OsDAgAFD4ls26fgpAnCYufUzDrXMMpDjMYkf2Y2FHuxqKE+2+Ir4JOYQLjX3gNAS/hRzKTUUu1/FlowlWLc1wv3nKsGTt6EwvsYrtYZ9UZjJlPvBgKfAqhkvzgphnGBuyDfHXFcMEoHX5xmEhJgK0YZx3BKh/s3nhpE7IFyBzqsKBqiTDd6jfzI9XsPznt1ZnWa9u9nVKg1KibD5ElrzSfbftYpluJAIIlGU8/d+nt+YMlmaCc2otsPg4VkklsRB3oh4DbXlwD0JuFuuM8DEZF1+YBRQ0SVXONw52WUDzwpQ5VF+0Wppt/RXFB3Bfkzm5U8Gk39vJzBht0vYt9IqVgEXip2UlkfJvXwRhxAEL1cyMpwZt2lhKbucXk0xnet9MJfvRVqLWrj7TJ6D4hJp3KUHZcFDzpujLjdOrzbFHCIfIK1TT82BpuIV/6rgYT7aH9jRhjANdrEOdwa6ztVmKDwAAAAAAEGp9UXGSxcUSGMyUw9SvF/WNruCJuh/UTj29mKAAAAAAbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACFDy1uAqR6+CTQmradxC1wyyjL+iSft+5XudJWwSdi72WJF7hI17QuJRRi1EmSpQkUrNAwom+Kp9LFCTP8SA/pBA0CAAE0AAAAAIB3jgYAAAAApQAAAAAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqQwEAQoACwEBDgwCAwQFBgcBAAgJDAszAAoAAAABAAAAAOQLVAIAAAABAAAAAAAAAAAQpdToAAAAAAAAAAAAAADSBAAAAAAAAP//DAMBAAABCQ==",
  "openOrdersAddress": "5yyh4mzzycmjfR6arY736d1mB6vNSLiUaFWfepKLf8kZ"
}

OPTIONAL. Specifies a tip amount that will be used to pay for front-running protection or bundle submission services.

Transaction Submission
Front-Running Protection & Transaction Bundle
What is tip?