sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
On this page
  • Smart Routing Order Estimate
  • Response Body
  • Example Request
  1. REST API
  2. Market Data

Get Order Estimate

Smart Routing Order Estimate

Smart Routing Order Estimate

GET https://api.sfox.com/v1/offer/:side

Get an estimated execution price for the specified quantity of a given asset using sFOX’s Smart Order Routing, as well as related information. Only use this as an estimate – execution is not guaranteed.

Path Parameters

Name
Type
Description

side*

String

Specifies your order side.

Options: buy | sell

Query Parameters

Name
Type
Description

pair

String

The pair or product to trade in the format: (i.e. "btcusd", "ethbtc", "usdteth")

Default = btcusd

quantity*

Number

The base currency quantity to buy or sell. quantity OR maxspend are required.

maxspend

Number

The quote currency amount to spend (side = buy) or receive (side = sell). quantity OR maxspend are required.

routing_type

String

The sFOX order book used for the estimate

Options: NetPrice | Smart

{
    "price": 19203.23787426,
    "subtotal": 19202.05116807,
    "fees": 6.72071791, 
    "total": 19208.77188598,
    "quantity": 1,
    "vwap": 19202.05116807,
    "currency_pair": "btcusd",
    "routing_type": "NetPrice"
}

Response Body

VWAP, Price, Fees, and Total are in the quote currency (e.g. USD for a btcusd pair).

Key
Description
Example

price

Estimated order limit price to specify when placing this order to receive the estimated fill price at the time of this request. (Quote Currency)

19203.23787426

subtotal

If side = buy: Estimated cost before fees. If side = sell: Estimated proceeds before fees.

19202.05116807

fees

Estimated fees you would pay in quote currency terms for this order. Note: Authentication required to receive a fees estimate

6.72071791

total

If side = buy: Estimated cost net fees. If side = sell: Estimated proceeds net fees.

19208.77188598

quantity

The base currency quantity applicable to the estimate. Equal to the quantity parameter in the request.

1

vwap

Estimated fill price you would receive at the time of this request. (Quote currency terms)

19202.05116807

currency_pair

Trading pair / symbol

"btcusd"

routing_type

sFOX order book used for this estimate

"NetPrice"

Example Request

curl 'https://api.sfox.com/v1/offer/buy?quantity=1&pair=btcusd'
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/offer/buy',
  params: {
    quantity: 1,
    pair: 'btcusd' 
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.get(
  "https://api.sfox.com/v1/offer/buy",
  headers={
    "Authorization": "Bearer <API_KEY>",
  },
  params={
    "quantity": 1,
    "pair": "btcusd"
  }
)
print(data)
PreviousGet Volume AnalyticsNextGet Order Book

Last updated 1 year ago

This response is an estimate, not a quote. Prices fluctuate often, therefore, it is possible that an order submitted after receiving this estimate will execute differently. Real-time order book and ticker data is available through SFOX’s .

Websocket API