NAV
Python Node.js

Overview

Welcome to the OSL API reference documentation. Here you will find a single, consolidated library for all application programming interfaces (API) offered by OSL’s platform.

REST

REST API’s are available for our OSL Exchange users and OSL Brokerage users. Both APIs are expressive and offer a variety of functionality in line with the crypto industry standards that exist today.

WebSocket

Websocket API offers stream market data for our OSL Exchange users and OSL Brokerage users. Market data is streamed in an easy to process JSON format.

FIX

OSL supports order entry, market data and drop copy using the FIX 4.4 protocol for OSL Exchange users. Connectivity options to our FIX gateway is described in more detail in the FIX section of this library.

URLs

Sandbox

The OSL Sandbox environment provides full exchange and brokerage functionality using test funds.

Please contact us at [email protected] and request your sandbox account.

REST API v3 base URL: https://trade-sg.oslsandbox.com/api/3

REST API v4 base URL: https://trade-sg.oslsandbox.com/api/v4

Websocket API v4 base URL: wss://trade-am.oslsandbox.com/ws/v4

Example subscription : wss://trade-am.oslsandbox.com/ws/v4?subscribe=orderBook:BTCUSD

Production

Website

Please visit https://osl.com and based on your location you will be directed to one of the below:

REST API v3 base URL: https://trade-sg.osl.com/api/3

REST API v4 base URL: https://trade-sg.osl.com/api/v4

Websocket API v4 base URL: wss://trade-sg.osl.com/ws/v4

Example subscription : wss://trade-sg.osl.com/ws/v4?subscribe=orderBook:BTCUSD

REST

Authentication

Both REST API v3 and v4 authentication is based on hash-based message authentication code HMAC-512.

The code (or signature) is generated in the same way, but different data is required to be sent between REST API v3 and v4.

Getting API Key and Secret

In order to use the REST API users must generate a key and secret.

This can be done through the OSL website, or via the REST API v3 endpoint.

Via the Website

Login to your account and navigate to the top-right persona icon:

Then click SETTINGS on the drop-down menu:

Then click API:

Finally click CREATE. If two-factor authentication is enabled, enter a one time password (OTP):

The REST API key and secret will be displayed. You can toggle now the Move Funds and Place and Manage Orders permissions. After clicking SAVE the secret will no longer be visible:

If you forget/lose the REST API secret, you can click the RESET SECRET button to re-generate a new REST API secret.

Please note that old REST API secrets will be disabled automatically once the secret is reset.

Multiple REST API keys can be created as per the user requirements.

Via the REST API v3

A REST API key and secret can be generated using the /api/3/apiKey v3 endpoint.

A valid username, password, and one-time-password (OTP) if two-factor authentication is enabled are required.

REST API key and secret generated by the /api/3/apiKey endpoint by default cannot place and manage orders. You can control the permissions assigned to the generated key via the website as per above.

Calculating the Signature

import time
import json
import base64
import hashlib
import hmac
import requests
import pprint

base_url = 'https://trade-sg.oslsandbox.com'
key = '<key>'
secret = '<secret>'

def gen_sig_helper(secret, data):
  secret_bytes = base64.b64decode(secret.encode('utf8'))
  return base64.b64encode(hmac.new(secret_bytes, data.encode('utf8'), digestmod = hashlib.sha512).digest()).decode('utf8')

def v4_gen_sig(secret, method, path, expires, body_str = None):
  data = method + path + str(expires)
  if body_str != None:
    data = data + body_str
  return gen_sig_helper(secret, data)

def v4_mk_request(method, path, body = None):
  print('=> ' + method + ' ' + path)
  tonce = int(time.time()) + 10
  body_str = None
  if body:
    body_str = json.dumps(body)
  headers = {
    'api-key': key,
    'api-signature': v4_gen_sig(secret, method, path, tonce, body_str),
    'api-expires': str(tonce),
    'Content-Type': 'application/json'
  }
  response = requests.request(method, base_url + path, headers = headers, data = body_str)
  response_json = response.json()
  pprint.pprint(response_json)
  response.raise_for_status()
  return response_json

def v3_gen_sig(secret, path, body_str = None):
  data = path
  if body_str != None:
    data = data + chr(0) + body_str
  return gen_sig_helper(secret, data)

def v3_mk_request(method, path, body = {}):
  print('=> ' + method + ' ' + path)
  tonce = int(time.time() * 1000 * 1000)
  body['tonce'] = tonce
  body_str = json.dumps(body)
  headers = {
    'Rest-Key': key,
    'Rest-Sign': v3_gen_sig(secret, path, body_str),
    'Content-Type': 'application/json'
  }
  response = requests.request(method, base_url + '/' + path, headers = headers, data = body_str)
  response_json = response.json()
  pprint.pprint(response_json)
  response.raise_for_status()
  return response_json

order_id_v4 = v4_mk_request('POST', '/api/v4/order', {
  'ordType': 'Limit',
  'symbol': 'BTCUSD',
  'orderQty': '0.01',
  'price': '39000',
  'side': 'Buy'
})['orderID']
v4_mk_request('GET', '/api/v4/order?orderID=' + order_id_v4)
v4_mk_request('DELETE', '/api/v4/order', {'orderID': [order_id_v4]})

order_id_v3 = v3_mk_request('POST', 'api/3/order/new', {
  'order': {
    'orderType': 'LIMIT',
    'tradedCurrency': 'BTC',
    'settlementCurrency': 'USD',
    'buyTradedCurrency': True,
    'tradedCurrencyAmount': '0.01',
    'limitPriceInSettlementCurrency': '39000'
  }
})['orderId']
v3_mk_request('POST', 'api/3/order/info', {'orderId': order_id_v3})
v3_mk_request('POST', 'api/3/order/cancel', {'orderIds': [order_id_v3]})
const https = require('https');
const crypto = require('crypto');

const host = 'trade-sg.oslsandbox.com';
const key = '<key>';
const secret = '<secret>';

function response_as_json(resolve, reject) {
  return function(res) {
    let str = '';
    res.on('data', function (chunk) { str += chunk; });
    res.on('end', function (arg) {
      console.log(JSON.parse(str));
      ((res.statusCode >= 200 && res.statusCode < 300) ? resolve : reject)(str ? JSON.parse(str) : '');
    });
  }
}

function gen_sig_helper(secret, data) {
  const secret_bytes = Buffer.from(secret, 'base64');
  return crypto.createHmac('sha512', secret_bytes).update(data).digest('base64');
}

function v4_gen_sig(secret, method, path, expires, body_str) {
  let data = method + path + expires;
  if (body_str) {
    data = data + body_str;
  }
  return gen_sig_helper(secret, data);
}

function v4_mk_request(method, path, body) {
  console.log(`=> ${method} ${path}`);
  return new Promise((resolve, reject) => {
    const tonce = Math.floor(Date.now() / 1000) + 10;
    const body_str = JSON.stringify(body);
    const headers = {
      'api-key': key,
      'api-signature': v4_gen_sig(secret, method, path, tonce, body_str),
      'api-expires': tonce,
      'Content-Type': 'application/json'
    }
    if (body) {
      headers['Content-Length'] = Buffer.byteLength(body_str);
    }
    const opt = { host, method, path, headers };
    const req = https.request(opt, response_as_json(resolve, reject));
    if (body) {
      req.write(body_str);
    }
    req.end();
  });
}

function v3_gen_sig(secret, path, body_str) {
  let data = path;
  if (body_str) {
    data = data + '\0' + body_str;
  }
  return gen_sig_helper(secret, data);
}

function v3_mk_request(method, path, body) {
  console.log(`=> ${method} ${path}`);
  return new Promise((resolve, reject) => {
    const tonce = Math.floor(Date.now() * 1000);
    body['tonce'] = tonce;
    const body_str = JSON.stringify(body);
    const headers = {
      'Rest-Key': key,
      'Rest-Sign': v3_gen_sig(secret, path, body_str),
      'Content-Type': 'application/json'
    }
    const opt = { host, method, path: '/' + path, headers };
    const req = https.request(opt, response_as_json(resolve, reject));
    req.write(body_str);
    req.end();
  });
}

async function run() {
  const order_id_v4 = (await v4_mk_request('POST', '/api/v4/order', {
    'ordType': 'Limit',
    'symbol': 'BTCUSD',
    'orderQty': '0.01',
    'price': '39000',
    'side': 'Buy'
  }))['orderID'];
  await v4_mk_request('GET', '/api/v4/order?orderID=' + order_id_v4);
  await v4_mk_request('DELETE', '/api/v4/order', {'orderID': [order_id_v4]});

  const order_id_v3 = (await v3_mk_request('POST', 'api/3/order/new', {
    'order': {
      'orderType': 'LIMIT',
      'tradedCurrency': 'BTC',
      'settlementCurrency': 'USD',
      'buyTradedCurrency': true,
      'tradedCurrencyAmount': '0.01',
      'limitPriceInSettlementCurrency': '39000'
    }
  }))['orderId'];
  await v3_mk_request('POST', 'api/3/order/info', {'orderId': order_id_v3});
  await v3_mk_request('POST', 'api/3/order/cancel', {'orderIds': [order_id_v3]});
}

run();

As mentioned above REST API v3 and v4 use the same HMAC algorithm, but there are some differences in terms of required data to authenticate between those two versions.

To authenticate a REST API v4 call the following data is required:

To authenticate a REST API v3 call the following data is required:

The details of signature calculation are best presented in the code itself hence please refer to code samples provided. The code samples calculate signatures and authenticate for both API versions. These also present how requests can be executed against the APIs.

Rate Limits

To prevent abuse the OSL Exchange imposes rate limits on incoming requests.

v3

For API entry points, we limit requests to 30 requests per second for each account. For trading API entry points, we limit requests to 100 requests per second for each IP.

v4

For all v4 endpoints, we limit requests to 200 requests per second for each IP.

Brokerage

v3

Introduction

The OSL Brokerage API v3 provides a JSON brokerage interface for OSL Brokerage users.

Supported currency and currency pair

GET /api/3/currencyStatic
Obtain supported currency and currency pair

This endpoint returns a list of supported currencies and currency pairs of the platform.

No Rest-Key and Rest-Sign in HTTP Header.

e.g OSL supported settlement currencies

USD, USDT

e.g. OSL supported crypto currencies

BTC, ETH, BCH, LTC

e.g OSL supported currency pairs

BTCUSD,ETHUSD, BCHUSD, LTCUSD, BTCUSDT

Request Definition
Fields Description Example
Response Definition
Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode Result code reflecting the success status of the operation. OK
currencyStatic Currency Static see Currency Static
Currency Static
Fields Description Example
currencies map of ccy and currency settings e.g. BTC
currencyPairs map of CcyPair and Currency Pair Settings e.g BTCUSD
Currency Settings
Fields Description Example
decimals decimal place used for trading 8
minOrderSize minimum order size 0.00020000
maxOrderSize maximum order size 100000.00000000
minOrderValue minimum order value 1.0E-7
maxOrderValue minimum order value 100000000.00000000
maxMarketOrderValue maximum market order value 10.00000000
maxMarketOrderSize maximum market order size 10.00000000
displayDenominator display denominator 1000
summaryDecimals decimals place used to display summary e.g. 0
display Unit currency unit e.g. BTC
symbol symbol of the currency e.g. Ɖ for BTC
type CRYPTO or FIAT CRYPTO
confirmationThresholds
networkFee standard network fee 0.00010000
engineSettings Fund Engine Settings see Fund Engine Settings
urlPrefix url prefix to handle the related coin address bitcoin:
digitalCurrencyType SATOSHI, COLORED_COIN_OPEN_ASSETS, MULTICHAIN, MULTICHAIN_NATIVE, RIPPLE, RIPPLE_IOU, ETHEREUM, ETHEREUM_TOKEN SATOSHI
assetId (CRYPTO type only) e.g.
assetName (CRYPTO type only) e.g. BTC
assetDivisibility (CRYPTO type only) asset divisibility e.g. 2
assetIcon (CRYPTO type only) asset icon /images/currencies/crypto/AAVE.svg
assetIssueQuantity (CRYPTO type only) asset issue quantity e.g. 10000
Fund Engine Settings
Fields Description Example
depositsEnabled If true deposits are enabled true or false
withdrawalsEnabled If true withdrawals are enabled true or false
displayEnabled If true the currency is visible on the platform. If false the user should also reflect this in their application and hide the currency. true or false
mobileAccessEnabled true always from API v3 true or false
Currency Pair Settings
Fields Description Example
priceDecimals decimals place of price for trading 5
engineSettings Order Engine Settings see Order Engine Settings
minOrderRate minimum order rate 10.00000000
maxOrderRate maximum order rate 40000.00000000
displayPriceDecimals decimals place of price for display 5
tradedCcy traded Ccy e.g BTC for BTCUSD
settlementCcy settlement Ccy e.g USD for BTCUSD
preferredMarket Preferred market ANX
Order Engine Settings
Fields Description Example
tradingEnabled true if trading enabled true or false
displayEnabled If true the currency is visible on the platform. If false the user should also reflect this in their application and hide the currency. true or false
cancelOnly cancel true or false
verifyRequired true if verification required for trading true or false
restrictedBuy true if user cannot buy the currency pair true or false
restrictedSell true if user cannot sell the currency pair true or false

Account

POST /api/3/account
Get account information

User has two accounts - primary and exchange.

Primary is for deposit, withdrawal and iRFQ.

Exchange is for Spot Orderbook Exchange.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
Response Definition
Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode Result code reflecting the success status of the operation. OK
data info result See Info Result
userUuid user's uuid d34ea17d-2b30-fg93-bd62-eaf1d43f7a20
Info Result
Fields Description Example
Created created date in format (yyyy-MM-dd HH:mm:ss) 2020-09-18 11:44:19
Language user's preferred language e.g. en_US
Login username [email protected]
Trade_Fee ordering fee 0.2000
Rights list of access right ["trade", "withdraw", "get_info" ]
Wallets map of ccy and wallet See Wallet
Wallet
Fields Description Example
Balance balance (Amount) See Amount
Available_Balance available balance for primary + exchange(Amount) See Amount
Primary_Available_Balance primary available balance(Amount) See Amount
Exchange_Available_Balance exchange available balance(Amount) See Amount
Brokerage_Available_Balance brokerage available balance(Amount) See Amount
Amount
Fields Description Example
displayShort Display in short 199.99 BTC
valueInt Value in Integer 19999400000
currency currency BTC
display display in full 199.99400000 BTC
value value 199.99400000

Activities

POST /api/3/transaction/list

By querying this endpoint, it will return your transactions (max result: 200). Specify a date range and/or offset so that transactions returned are paginated.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy currency BTC (optional)
transactionState TransactionState e.g.PROCESSED (optional)
from start time(inclusive) of queries transaction, format should be a number (UNIX timestamp in milliseconds) (optional) 1464675012000
to end time(inclusive) of queries transaction, format is same as 'from' (optional) 1464679992000
max Max results you want the endpoint to return. Note that it can be no greater than 200. Default value is 50 if not provided. (optional) 50
offset if there is more than 'max' results between the date range specified, this field is useful to get the next 'max' results (optional) if max is 200, and there are actually 407 results in the date range, offset=400 will get you the last 7 results
lang displayTitle and displayDescription for each transaction returned will be in the language specified. Default is "en-US". (optional) en-US
TransactionState
Fields Description
SUBMITTED Transaction submitted
PROCESSED Transaction has been processed
SUSPENDED Transaction has been suspended
REVERSED Reversed
LIMIT_OVERRIDE_APPROVED Limit overridden
CANCELLED_INSUFFICIENT_FUNDS Cancelled insufficient funds
CANCELLED_LIMIT_BREACH Cancelled - limit breach
PENDING_CONFIRM Pending confirmation
PENDING_SUFFICIENT_CONFIRMATIONS Pending confirmation
PENDING_REVERSE Pending to reverse
PENDING_LIMIT_APPROVAL Pending limit approval
TransactionState
Fields Description
zh-CN Simplified Chinese
zh-HK Traditional Chinese
en-US English (US)
Response Definition
Fields Description Example
resultCode Result code reflecting the success status of the operation. OK
timestamp UNIX timestamp in milliseconds 1632390252603
transactions list of transactions See Transaction
count number of transactions returned 100
Transaction
Fields Description Example
transactionClass FILL, COUPON and etc FILL
uuid uuid of the transaction 6d568392-ce9f-42b9-bfe6-074cffa78d6b
userUuid uuid belong to the user 67271c1d -2f9b-48e2- a5bb-01c8a8ce11a4
amount total amount of the transaction e.g -1.00345678
fee fee included in the transaction 0.0
balanceBefore balance before the transaction 105337.05233524
balanceAfter balance after the transaction 105336.04887846,
ccy account currency BTC
transactionState transaction state e.g. PROCESSED
transactionType transaction type FILL_DEBIT
received received timestamp 1431004151000
processed processed timestamp 1431004151000
timestampMillis created timestamp 1464677126478
displayTitle Order Fill Order Filled
displayDescription description Buy XRP @ 1.00000 USD/XRP
TransactionClass:
Transaction Class Description
FILL Spot Orderbook Trade
COIN Digital Asset Transfer via blockchain
CASH Cash Transfer
COUPON Fund Transfer
MERCHANT iRFQ Trade
OTCTRADE OTC Trade
NONCUSTODIAL Non Custodial
TransactionType:
TransactionType Description
DEPOSIT Deposit
DEPOSIT_REVERSAL Deposit Reversal
WITHDRAWAL Withdrawal
WITHDRAWAL_REVERSAL Withdrawal Reversal
FILL_DEBIT Orderbook Trade debit
FILL_CREDIT Orderbook Trade credit
TRADE_DEBIT iRFQ/OTC trade debit
TRADE_DEBIT_REVERSAL iRFQ/OTC trade debit reversal
TRADE_CREDIT iRFQ/OTC trade credit
TRADE_CREDIT_REVERSAL iRFQ/OTC trade credit reversal
FLOAT_DEBIT collateral account debit
FLOAT_DEBIT_REVERSAL collateral account debit reversal
FLOAT_CREDIT collateral account credit
FLOAT_CREDIT_REVERSAL collateral account credit reversal
FEE_CREDIT transaction fee credit
FEE_CREDIT_REVERSAL transaction fee credit reversal
FEE_DEBIT transaction fee debit
FEE_DEBIT_REVERSAL transaction fee debit reversal
TransactionState:
TransactionState Description
SUBMITTED transaction submitted
PROCESSED transaction being processed
SUSPENDED transaction is suspended
CANCELLED_INSUFFICIENT_FUNDS transaction cancelled due to insufficient fund
CANCELLED_INSUFFICIENT_FUNDS_IN_FLOAT transaction cancelled due to insufficient fund in collateral account
CANCELLED_INSUFFICIENT_FUNDS_IN_SITE_OWNER transaction cancelled due to insufficient fund in site owner account
CANCELLED_LIMIT_BREACH transaction is cancelled due to the amount over the limit
PENDING_CONFIRM transaction is pending confirmation from user
PENDING_REVERSE transaction is pending to be reversed
REVERSED transaction is reversed
PENDING_SUFFICIENT_CONFIRMATIONS transaction is pending confirmations in blockchain to be processed.
PENDING_LIMIT_APPROVAL transaction is pending limit override approval
LIMIT_OVERRIDE_APPROVED transaction is being approval for limit
POST /api/3/transfer/list
Obtain transfer list for the account
Request Definition
Fields Description Example
nonce Ever increasing integer 1632398764302000
ccy optional - default is all the ccy USD
date processed from optional - default is past 7 days 1368892862123456
date processed to optional - default is past 7 days 1368892862123456
Response Definition
Fields Description Example
date UNIX timestamp in milliseconds 1368892862123456
state state will be Processed/Reversed/Sent Sent
ccy currency USD
amount amount details
From Account Transfer from primary/exchange/brokerage primary
To Account Transfer to primary/exchange/brokerage exchange

Funds

POST /api/3/send
Send Crypto Coin

This service allows users to withdraw funds. The API Key must have "move funds" permissioned, via the web platform.

A confirmation email is sent to confirm the withdrawal. If the link within the email is not clicked within 10minutes the withdrawal request will be cancelled

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy currency (currently one of BTC, ETH, BCH and LTC) BTC
address valid address in the selected ccy 2MucnhthMEQSy6kqx765pwGwb27DzAeZEnb
otp One time password key for two factor authentication 12345
amount amount to send (must be less than the available balance) 0.0054
destinationTag (This parameter is only used for crypto currencies that require a destinationTag such as Ripple) Destination tag identifies the purpose of payment allowing a single address to be utilized by multiple users. Additionally, these tags enable the return of payments.
Response Definition
Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode Result code reflecting the success status of the operation. OK
transactionId internal transaction id of the transaction. Note this is not the coin txid in blockchain. At the time this method is invoked, the blockchain TXID is not available. This identifier, however, can be used to reconcile the transaction updates sent when requesting the status of a fund movement.
POST /api/3/receive
Obtain a current receive address for the given token

Use this service to obtain a valid address to receive crypto funds.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy traded currency (currently one of BTC, ETH, BCH and LTC) BTC
Response Definition
Fields Description Example
resultCode Result code reflecting the success status of the operation. OK
timestamp UNIX timestamp in milliseconds 1632390252603
address Valid crypto address, currently for any one of BTC, ETH, BCH and LTC) 2MucnhthMEQSy6kqx765pwGwb27DzAeZEnb
subAccount UUID of the subAccount of which the coin address is tied to 622bcf3c-46e1-4dc5-bda4-4c9asdrf4dad
POST /api/3/receive/create
Create a new deposit address for a specific token

Use this service to create a new address to receive crypto funds. New address will be created only when the old address has transactions.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy traded currency (currently one of BTC, ETH, BCH and LTC BTC
Response Definition
Fields Description Example
resultCode Result code reflecting the success status of the operation. OK
timestamp UNIX timestamp in milliseconds 1632390252603
address Valid new crypto address, currently for any one of BTC, ETH, BCH and LTC)) 2MucnhthMEQSy6kqx765pwGwb27DzAeZEnb
subAccount UUID of the sub account that the coin address is tied to. 622bcf3c-46e1-4dc5-bda4-4c9asdrf4dad
POST /api/3/transfer
Move funds in-between platform accounts

Use this service to move funds between different accounts that allows for spot order book trading/withdrawal/deposit.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
from "From" account. See AccountType e.g. AVAILABLE, EXCHANGE
to "To" account. See AccountType e.g. EXCHANGE, AVAILABLE
amount This is the amount to move 0.01
ccy Currency selected to move currency e.g. BTC, ETH, LTC, BCH, USD
Account Type:
Account Type Description
AVAILABLE primary account. Used for payment-in, payment-out, iRFQ
EXCHANGE Exchange account. Used for Spot Order Book trading
Response Definition
Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
UUID Returns the transfer fund transaction uuid 622bcf3c-jhkl-rte4-bda4-4c9asdrf4dad
status If transfer fund is successful, “OK” is returned OK
resultCode Result Code See Result Code
Result Code:

Result code reflects the status of the operation.

Result Code Description
OK the fund is being transferred
INVALID_PARAMETERS Too many decimals or Exchange product not available
INSUFFICIENT_AVAILABLE_BALANCE account has insufficient funds to move
NO_PERMISSION Do not have permission
SYSTEM_ERROR system error

iRFQ

POST /api/3/retail/quote

This endpoint returns a quote for a currency pair. The API Key must have the “Place and Manage Orders” permission enabled.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
quoteRequest Quote Request see Quote Request
Quote Request
Fields Description Example
tradedCurrency traded currency BTC
settlementCurrency settlement currency USD
tradedCurrencyAmount traded currency amount 0.1
settlementCurrencyAmount settlement currency amount 10
buyTradedCurrency true for buy currency false for sell
isIndicativeQuote true for retail quote false
customRef customer reference in uuid format
Response Definition
Fields Description Example
resultCode result code See Quote Result Code
timestamp unix timestamp 1632404454196
quoteResponse Quote Response see Quote Response
Quote Response
Fields Description Example
responseCode see Quote Response Code FULL_QUOTE
errorCode a set of error codes separated by period. see Quote Error Code p200021
buyTradedCurrency true for buy or false for sell true or false
tradedCurrency tradedCurrency currency e.g. BTC
settlementCurrency settlement currency e.g. USD
quotedSettlementCurrencyAmount quoted settlement currency amount
quotedTradedCurrencyAmount quoted traded currency amount
quotedAmountToDeliver quoted amount to deliver
wholesaleRateInSettlementCurrency wholesale rate in settlement currency
retailRateInSettlementCurrency retail rate in settlement currency
customRef custom reference
quoteId quote id
quoteExpiresAt timestamp which the quote is expired at
quoteCreatedAt timestamp which the quote is created at
maxAmount max amount the brokerage support 100
Quote Result Code
Fields Description
USER_ACTIVITY_RESTRICTED User had been restricted from iRFQ
SYSTEM_ERROR General error. see Response code
INVALID_PARAMETERS invalid parameters
SIMPLE_TRADE_DISABLED iRFQ disabled for the account
Quote Response Code
Fields Description
CANNOT_PRICE A quote is not available for the requested instrument. For exact result, please check the field errorCode
EXCHANGE_RATES_CONVERSION_ERROR
PER_TXN_LIMIT_EXCEEDED
USER_DAILY_LIMIT_EXCEEDED
DEALER_DAILY_LIMIT_EXCEEDED
FULL_QUOTE
Quote Error Code

A set of error codes separated by period.

Fields Description
p200021 No fallback pricing
p500005 Requested quantity is invalid
p500019 Requested quantity is invalid
s200003 Traded ccy not support
s200004 Settlement ccy not supported
s200015 Merchant configuration cannot be found
s300019 Exchange Rates Not Available
s500018 Requested quantity is invalid
s500024 Requested quantity is invalid
s500025 Requested quantity is invalid
POST /api/3/retail/trade

This endpoint is used to accept the quote and execute the trade.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
tradeRequest Trade Request see Trade Request
Trade Request
Fields Description Example
quoteId quote Id
customRef custom reference
Response Definition
Fields Description Example
resultCode result Code. See Trade Result Code EXECUTED
timestamp unix timestamp 1632390252603
tradeResponse Trade Response see Trade Response
Trade Response
Fields Description Example
responseCode see Trade Response Code EXECUTED
tradeId trade id
quoteId quote Id
errorCode errorCode s200003
Trade Result Code
Fields Description
USER_ACTIVITY_RESTRICTED User had been restricted from iRFQ
SYSTEM_ERROR General error. see Response code
INVALID_PARAMETERS invalid parameters
SIMPLE_TRADE_DISABLED iRFQ disabled for the account
Trade Response Code
Fields Description
INVALID_QUOTE_ID Invalid quote ID. No trade.
QUOTE_EXPIRED The quote has expired. No trade.
EXECUTED Trade Execution
INSUFFICIENT_FUND Insufficient funds. No trade.
ENGINE_NOT_AVAILABLE The quoting engine is currently unavailable. No trade.
INSUFFICIENT_LIQUIDITY There was insufficient liquidity available to complete the order. No trade.
Trade Error Code
Fields Description
s200003 Traded currency is not supported
s200004 Settlement currency is not supported
s300001 Invalid exchange rates
s100002 Invalid quote id
s100005 Trade Already Exists for the Quote ID
s100006 Quote Expired
s100026 Quote Expired
s400010 Requested quantity is invalid
s400011 Requested quantity is invalid
s400012 Debit account not found
s400013 Debit account have insufficient fund
s400024 Requested quantity is invalid
s400025 Requested quantity is invalid
POST /api/3/retail/basketQuote

This endpoint allows a user to request a quote for a basket of currencies crypto per settlement amount. The API Key must have the “Place and Manage Orders” permission enabled.

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
basketQuoteRequest Basket Quote Request see Basket Quote Request
Basket Quote Request
Fields Description Example
basketSettlementCurrency settlement currency USD
basketSettlementCurrencyAmount settlement currency amount 1.55
buyTradedCurrency true for buy currency false or true
Response Definition
Fields Description Example
resultCode result code. See Basket Quote Result Code
timestamp unix timestamp 1632390252603
basketQuoteResponse see Basket Quote Response
Basket Quote Response
Fields Description Example
responseCode Basket Quote Response Code see Basket Quote Response Code
errorCode a set of error codes separated by period. see Quote Error Code
quoteExpiresAt Time at which the quote expires
isPtsSufficient Is Pre-Trade Settlement amounts sufficient
quoteResponses list of Quote Responses
Basket Quote Response
Fields Description Example
responseCode Basket Quote Response Code see Basket Quote Response Code, FULL_QUOTE
buyTradedCurrency true for buy or false for sell true or false
tradedCurrency Traded Currency e.g. BTC
settlementCurrency Settlement Currency e.g. USD
quotedSettlementCurrencyAmount Quoted settlement currency amount
quotedTradedCurrencyAmount Quoted traded currency amount
wholesaleRateInSettlementCurrency Wholesale rate in settlement currency
retailRateInSettlementCurrency Retail rate in settlement currency
quoteExpiresAt Time at which the quote expires
quoteCreatedAt Time at which the quote was created
quoteId quote id
isPtsSufficient is Pre Trade Settlement amounts sufficient
Basket Quote Result Code
Fields Description
USER_ACTIVITY_RESTRICTED User had been restricted from using iRFQ
SYSTEM_ERROR General error. see Response code
INVALID_PARAMETERS invalid parameters
SIMPLE_TRADE_DISABLED iRFQ disabled for the account
Basket Quote Response Code
Fields Description
CANNOT_PRICE A quote is not available for the requested instrument. For exact result, please check the field errorCode
EXCHANGE_RATES_CONVERSION_ERROR
PER_TXN_LIMIT_EXCEEDED
USER_DAILY_LIMIT_EXCEEDED
DEALER_DAILY_LIMIT_EXCEEDED
FULL_QUOTE
Quote Error Code

A set of error code separated by period.

Fields Description
p200021 No fallback pricing
p500005 Requested quantity is invalid
p500019 Requested quantity is invalid
s200003 Traded ccy not support
s200004 Settlement ccy not supported
s200015 Merchant configuration cannot be found
s300019 Exchange Rates Not Available
s500018 Requested quantity is invalid
s500024 Requested quantity is invalid
s500025 Requested quantity is invalid
POST /api/3/retail/basketTrade

This endpoint to trade order previously quote

Request Definition
Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
basketTradeRequest Basket Trade Request see Basket Trade Request
Basket Trade Request
Fields Description Example
basketRequests list of Basket Request see Basket Request
Basket Request
Fields Description Example
quoteId uuid
Response Definition
Fields Description Example
timestamp unix timestamp 1632390252603
basketTradeResponse Basket Trade Response see Basket Trade Response
Basket Trade Response
Fields Description Example
responseCode Basket Trade Response Code see Basket Trade Response Code
tradeId trade id
quoteId quote Id
errorCode errorCode s100005
Basket Trade Result Code
Fields Description
USER_ACTIVITY_RESTRICTED User had been restricted from iRFQ
SYSTEM_ERROR General error. see Response code
INVALID_PARAMETERS invalid parameters
SIMPLE_TRADE_DISABLED iRFQ disabled for the account
Basket Trade Response Code
Fields Description
INVALID_QUOTE_ID Invalid quote Id. Trade failed
QUOTE_EXPIRED quote has already expired. Trade failed
EXECUTED trade executed
INSUFFICIENT_FUND User doesn't have enough funds. Trade failed
ENGINE_NOT_AVAILABLE iRFQ engine is off. Trade failed
INSUFFICIENT_LIQUIDITY Exchange stopped the trade. Trade failed
Basket Trade Error Code
Fields Description
s200003 Traded ccy not supported
s200004 Settlement ccy not supported
s300001 Invalid exchange rates
s100002 Invalid quote id
s100005 Trade Already Exists for the Quote ID
s100006 Quote Expired
s100026 Quote Expired
s400010 Requested quantity is invalid
s400011 Requested quantity is invalid
s400012 Debit account not found
s400013 Debit account have insufficient fund
s400024 Requested quantity is invalid
s400025 Requested quantity is invalid

Exchange

v4

Introduction

OSL provides a simple and powerful REST API v4 currently for order management.

Instrument

Get instruments

GET /api/v4/instrument

Parameters
Name In Type Required Description
symbol query string false One (e.g. BTCUSD) or many symbols (e.g. BTCUSD,ETHUSD). If empty all symbols are returned.

Example responses

200 Response

[
  {
    "symbol": "BTCUSD",
    "currency": "BTC",
    "settlCurrency": "USD",
    "highPrice": "69999.00000",
    "lowPrice": "1000.00000",
    "bidPrice": "37000.00000",
    "askPrice": null,
    "lastPrice": "39000.00000",
    "minPrice": "1000.00000",
    "maxPrice": "70000.00000",
    "minOrderQty": null,
    "maxOrderQty": "210.00000000",
    "minValue": null,
    "maxValue": "10000000.00000",
    "prevClosePrice": null,
    "volume": null,
    "tickSize": null,
    "stepSize": "0.00010000",
    "priceDecimals": "5",
    "quantityDecimals": "8",
    "updateTime": "2021-06-17T06:11:06.727Z"
  },
  {
    "symbol": "ETHUSD",
    "currency": "ETH",
    "settlCurrency": "USD",
    "highPrice": "2800.00000",
    "lowPrice": "1200.00500",
    "bidPrice": "2500.00000",
    "askPrice": null,
    "lastPrice": "2480.00000",
    "minPrice": "1612.00000",
    "maxPrice": "2994.00000",
    "minOrderQty": "0.00100000",
    "maxOrderQty": "3340.00000000",
    "minValue": null,
    "maxValue": "10000000.00000",
    "prevClosePrice": null,
    "volume": null,
    "tickSize": null,
    "stepSize": "0.00100000",
    "priceDecimals": "5",
    "quantityDecimals": "8",
    "updateTime": "2021-06-16T17:04:13.308Z"
  }
]
Responses
Status Meaning Description Schema
200 OK Success. Instruments
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error

User

Get exchange wallets

GET /api/v4/user/wallet

Parameters
Name In Type Required Description
currency query string false One (e.g. BTC) or many currencies (e.g. BTC,USD). If empty all symbols are returned.

Example responses

200 Response

[
  {
    "currency": "ETH",
    "exchangeBalance": "191.58700000",
    "exchangeAvailableBalance": "191.58700000"
  },
  {
    "currency": "BTC",
    "exchangeBalance": "2.00000000",
    "exchangeAvailableBalance": "1.50000000"
  }
]
Responses
Status Meaning Description Schema
200 OK Success. Wallets
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error

OrderBook

Get L2 order book

GET /api/v4/orderBook/L2

Parameters
Name In Type Required Description
symbol query string true One symbol e.g. BTCUSD.
depth query number false Order book depth per side. Send 0 for full depth. Default: 25.

Example responses

200 Response

{
  "symbol": "BTCUSD",
  "asks": [
    [
      "50000",
      "0.1"
    ],
    [
      "60000",
      "0.2"
    ]
  ],
  "bids": [
    [
      "40000",
      "0.1"
    ],
    [
      "30000",
      "0.2"
    ]
  ],
  "updateTime": "2000-01-01 00:00:00.000000000Z"
}
Responses
Status Meaning Description Schema
200 OK Success. OrderBookL2

Order

Get orders

GET /api/v4/order

Orders are returned from oldest to newest. By default only open orders are returned. Inactive orders are retrievable only for a limited period of time.

Parameters
Name In Type Required Description
symbol query string false One (e.g. BTCUSD) or many symbols (e.g. BTCUSD,ETHUSD). If empty all symbols are returned.
open query boolean false When true return active/open orders only. Default: true.
orderID query string false Order ID.
clOrdID query string false Client order ID.
start query number false Start point for results. Default: 0.
count query number false Number of results to fetch. Must be a positive integer. Default: 500.
reverse query boolean false From newest to oldest. Default: false.
startTime query string(date-time) false Start date time filter for results.
endTime query string(date-time) false End date time filter for results.

Example responses

200 Response

[
  {
    "orderID": "338697858",
    "clOrdID": "my-order-1",
    "symbol": "BTCUSD",
    "side": "Buy",
    "orderQty": "0.01000000",
    "price": "30000.00000",
    "currency": "BTC",
    "settlCurrency": "USD",
    "ordType": "Limit",
    "timeInForce": "GoodTillCancel",
    "ordStatus": "New",
    "leavesQty": "0.01000000",
    "cumQty": "0",
    "transactTime": "2021-06-11T03:49:20.521Z"
  },
  {
    "orderID": "338697888",
    "clOrdID": "my-order-2",
    "symbol": "BTCUSD",
    "side": "Sell",
    "orderQty": "0.01000000",
    "price": "60000.00000",
    "currency": "BTC",
    "settlCurrency": "USD",
    "ordType": "Limit",
    "timeInForce": "GoodTillCancel",
    "ordStatus": "New",
    "leavesQty": "0.01000000",
    "cumQty": "0",
    "transactTime": "2021-06-11T04:30:25.364Z"
  }
]
Responses
Status Meaning Description Schema
200 OK Success. Orders
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error
Create a new order

POST /api/v4/order

Body parameter

{
  "symbol": "BTCUSD",
  "orderQty": "0.01",
  "side": "Sell",
  "price": "40000",
  "ordType": "Limit",
  "timeInForce": "GoodTillCancel",
  "clOrdID": "my-order-3",
  "sendingTime": "2021-06-11T00:10:00.123Z"
}
Parameters
NameInTypeRequiredDescription
» symbolbodystringtrueOne symbol e.g. BTCUSD.
» orderQtybodystringtrueOrder quantity.
» sidebodystringtrueSide. Valid values:
  • Buy
  • Sell
» ordTypebodystringtrue Order type. Valid values:
  • Limit: Execute at a specified price or better.
  • Market: Execute at the current market price.
» pricebodystringtruePrice.
» timeInForcebodystringfalse Time in force specifies how long the order remains in effect. Valid values:
  • GoodTillCancel: The order will remain in the order book until fully filled or cancelled by the user.
  • ImmediateOrCancel: The order will execute in full or partially and then cancelled. It does not rest on the order book.
  • FillOrKill: Execute all, or none and immediately cancel.
Default: GoodTillCancel
» execInstbodystringfalse Execution instruction. Valid values:
  • PostOnly: Ensures that your Limit order is always a maker order, if not gets withdrawn.
» clOrdIDbodystringfalseClient order ID. There is no clOrdID duplicate check. It is the client's responsibility to keep them unique. If not unique for a given user some reporting endpoints might have unexpected behaviour.

Example responses

200 Response

{
  "orderID": "339210744",
  "clOrdID": "my-order-1",
  "symbol": "BTCUSD",
  "side": "Sell",
  "orderQty": "4.00000000",
  "price": "38000.00000",
  "currency": "BTC",
  "settlCurrency": "USD",
  "ordType": "Limit",
  "timeInForce": "GoodTillCancel",
  "ordStatus": "New",
  "leavesQty": "4.00000000",
  "cumQty": "0",
  "transactTime": "2021-06-17T09:47:52.280Z"
}
Responses
Status Meaning Description Schema
200 OK Success. Order
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error
Cancel orders

DELETE /api/v4/order

Orders can be cancelled by orderID or clOrdID.

IMPORTANTNOTE: Either orderID OR clOrdID array needs to be present in the request, but not both.

The API supports bulk cancelling however users should take into consideration that the cancel request may fail on some orders due to timing whereby cancels or fills are processed ahead of the cancel being processed by the matching engine.

If all cancels succeed the HTTP status returned will be 200. If an order(s) fails the cancel request the HTTP status will be 400. The response will specify orders that were successfully cancelled and the reason for those that were not.

Example: HTTP 400 status code even though orderID=338697858 cancel succeeded (no error field for 338697858): [ { "orderID": "338697862", "error": { "name": "ALREADY_CANCELLED", "message": "order already cancelled" } }, { "orderID": "338697858" } ]

If the response is neither HTTP status 200 or 400 a normal error object response of: { "error": { "name": "string", "message": "string" } } is returned.

Body parameter

{
  "orderID": [
    "338697858"
  ]
}
Parameters
Name In Type Required Description
» orderID body [string] false Order ID(s).
» clOrdID body [string] false Client order ID(s).

Example responses

200 Response

[
  {
    "orderID": "338697858"
  },
  {
    "orderID": "338697862",
    "error": {
      "name": "ALREADY_CANCELLED",
      "message": "order already cancelled"
    }
  },
  {
    "orderID": "338697865",
    "error": {
      "name": "ORDER_NOT_FOUND",
      "message": "order not found"
    }
  }
]
Responses
Status Meaning Description Schema
200 OK Success. OrdersCancelled
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error
Cancel all orders

DELETE /api/v4/order/all

Cancels all open orders owned by the user. The difference between DELETE /order and this endpoint is that this is executed as one transaction by the engine. The DELETE /order is multiple transactions when bulk cancelling more than one order.

Body parameter

{
  "symbol": "BTCUSD"
}
Parameters
Name In Type Required Description
» symbol body string false One symbol e.g. BTCUSD. Will cancel orders only for that symbol.

Example responses

200 Response

{}
Responses
Status Meaning Description Schema
200 OK Success. Empty object.
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error
Response Schema

Execution

Get executions

GET /api/v4/execution

From oldest to newest.

Parameters
Name In Type Required Description
symbol query string false One (e.g. BTCUSD) or many symbols (e.g. BTCUSD,ETHUSD). If empty all symbols are returned.
orderID query string false Order ID.
clOrdID query string false Client order ID.
start query number false Start point for results. Default: 0.
count query number false Number of results to fetch. Must be a positive integer. Default: 500.
reverse query boolean false From newest to oldest. Default: false.
startTime query string(date-time) false Start date time filter for results.
endTime query string(date-time) false End date time filter for results.

Example responses

200 Response

[
  {
    "execID": "1628126",
    "trdMatchID": "16P1B",
    "orderID": "339210495",
    "clOrdID": "my-order-1",
    "lastQty": "1.00000000",
    "lastPx": "39000.00000000",
    "grossValue": "39000.00000000",
    "fee": "136.50000000",
    "execType": "Trade",
    "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
    "symbol": "BTCUSD",
    "side": "Sell",
    "currency": "BTC",
    "settlCurrency": "USD",
    "transactTime": "2021-06-17T06:11:06.000Z"
  },
  {
    "execID": "1628127",
    "trdMatchID": "16NNF",
    "orderID": "339209709",
    "clOrdID": "my-order-2",
    "lastQty": "0.01000000",
    "lastPx": "33000.00000000",
    "grossValue": "330.00000000",
    "fee": "1.15500000",
    "execType": "Trade",
    "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
    "symbol": "BTCUSD",
    "side": "Buy",
    "currency": "BTC",
    "settlCurrency": "USD",
    "transactTime": "2021-06-16T14:34:36.000Z"
  }
]
Responses
Status Meaning Description Schema
200 OK Success. Executions
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error
Get executions of order

GET /api/v4/execution/order

One of (exclusively) orderID or clOrdID needs to be present.

Parameters
Name In Type Required Description
orderID query string false Order ID.
clOrdID query string false Client order ID.

Example responses

200 Response

{
  "order": {
    "orderID": "339210744",
    "clOrdID": "my-order-1",
    "symbol": "BTCUSD",
    "side": "Sell",
    "orderQty": "4.00000000",
    "price": "38000.00000",
    "currency": "BTC",
    "settlCurrency": "USD",
    "ordType": "Limit",
    "timeInForce": "GoodTillCancel",
    "ordStatus": "New",
    "leavesQty": "4.00000000",
    "cumQty": "0",
    "transactTime": "2021-06-17T09:47:52.280Z"
  },
  "execution": [
    {
      "execID": "1628128",
      "trdMatchID": "16P1B",
      "orderID": "339210744",
      "clOrdID": "my-order-1",
      "lastQty": "1.00000000",
      "lastPx": "39000.00000000",
      "grossValue": "39000.00000000",
      "fee": "136.50000000",
      "execType": "Trade",
      "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
      "symbol": "BTCUSD",
      "side": "Sell",
      "currency": "BTC",
      "settlCurrency": "USD",
      "transactTime": "2021-06-17T06:11:06.000Z"
    },
    {
      "execID": "808e37f0-2b67-492b-ac84-9417524eca2a",
      "trdMatchID": "16NNF",
      "orderID": "339210744",
      "clOrdID": "my-order-1",
      "lastQty": "0.01000000",
      "lastPx": "33000.00000000",
      "grossValue": "330.00000000",
      "fee": "1.15500000",
      "execType": "Trade",
      "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
      "symbol": "BTCUSD",
      "side": "Buy",
      "currency": "BTC",
      "settlCurrency": "USD",
      "transactTime": "2021-06-16T14:34:36.000Z"
    }
  ]
}
Responses
Status Meaning Description Schema
200 OK Success. ExecutionOrder
400 Bad Request Error. Error
401 Unauthorized Unable to auth. Error
403 Forbidden Access denied. Error
404 Not Found Not found. Error
500 Internal Server Error Server error. Error

Schemas

Error

{
  "error": {
    "name": "string",
    "message": "string"
  }
}

Properties
Name Type Required Description
error object false none
» name string false Error key.
» message string false Error description/details.
Instrument

{
  "symbol": "BTCUSD",
  "currency": "BTC",
  "settlCurrency": "USD",
  "highPrice": "69999.00000",
  "lowPrice": "1000.00000",
  "bidPrice": "37000.00000",
  "askPrice": null,
  "lastPrice": "39000.00000",
  "minPrice": "1000.00000",
  "maxPrice": "70000.00000",
  "minOrderQty": null,
  "maxOrderQty": "210.00000000",
  "minValue": null,
  "maxValue": "10000000.00000",
  "prevClosePrice": null,
  "volume": null,
  "tickSize": null,
  "stepSize": "0.00010000",
  "priceDecimals": "5",
  "quantityDecimals": "8",
  "updateTime": "2021-06-17T06:11:06.727Z"
}

Instrument.

Properties
Name Type Required Description
symbol string false Symbol.
currency string false Base currency.
settlCurrency string false Settlement currency.
highPrice string false 24h high.
lowPrice string false 24h low.
bidPrice string false Best buy price.
askPrice string false Best sell price.
lastPrice string false Last trade price.
minPrice string false Min price limit.
maxPrice string false Max price limit.
minOrderQty string false Min order qty limit.
maxOrderQty string false Max order qty limit.
minValue string false Min order notional limit.
maxValue string false Max order notional limit.
prevClosePrice string false 24h ago close.
volume string false 24h volume.
tickSize string false Price step.
stepSize string false Quantity step.
priceDecimals string false Max price decimals limit.
quantityDecimals string false Max qty decimals limit.
updateTime string(date-time) false Last change time.
Instruments

[
  {
    "symbol": "BTCUSD",
    "currency": "BTC",
    "settlCurrency": "USD",
    "highPrice": "69999.00000",
    "lowPrice": "1000.00000",
    "bidPrice": "37000.00000",
    "askPrice": null,
    "lastPrice": "39000.00000",
    "minPrice": "1000.00000",
    "maxPrice": "70000.00000",
    "minOrderQty": null,
    "maxOrderQty": "210.00000000",
    "minValue": null,
    "maxValue": "10000000.00000",
    "prevClosePrice": null,
    "volume": null,
    "tickSize": null,
    "stepSize": "0.00010000",
    "priceDecimals": "5",
    "quantityDecimals": "8",
    "updateTime": "2021-06-17T06:11:06.727Z"
  },
  {
    "symbol": "ETHUSD",
    "currency": "ETH",
    "settlCurrency": "USD",
    "highPrice": "2800.00000",
    "lowPrice": "1200.00500",
    "bidPrice": "2500.00000",
    "askPrice": null,
    "lastPrice": "2480.00000",
    "minPrice": "1612.00000",
    "maxPrice": "2994.00000",
    "minOrderQty": "0.00100000",
    "maxOrderQty": "3340.00000000",
    "minValue": null,
    "maxValue": "10000000.00000",
    "prevClosePrice": null,
    "volume": null,
    "tickSize": null,
    "stepSize": "0.00100000",
    "priceDecimals": "5",
    "quantityDecimals": "8",
    "updateTime": "2021-06-16T17:04:13.308Z"
  }
]

Instruments.

Properties
Name Type Required Description
Instruments. [Instrument] false Instruments.
Wallet

{
  "exchangeBalance": "191.58700000",
  "exchangeAvailableBalance": "191.58700000",
  "currency": "ETH"
}

Wallet.

Properties
Name Type Required Description
currency string false Account currency.
exchangeBalance string false Total exchange balance.
exchangeAvailableBalance string false Total available balance - always <= total exchange balance.
Wallets

[
  {
    "currency": "ETH",
    "exchangeBalance": "191.58700000",
    "exchangeAvailableBalance": "191.58700000"
  },
  {
    "currency": "BTC",
    "exchangeBalance": "2.00000000",
    "exchangeAvailableBalance": "1.50000000"
  }
]

Wallets.

Properties
Name Type Required Description
Wallets. [Wallet] false Wallets.
OrderBookL2AsksBidsEntry

[
  "50000", // price
  "0.1" // quantity
]






OrderBookL2AsksBidsEntry.

Properties

[ <price>, <quantity> ]

OrderBookL2

[
  {
    "symbol": "BTCUSD",
    "asks": [
      [
        "50000",
        "0.1"
      ],
      [
        "60000",
        "0.2"
      ]
    ],
    "bids": [
      [
        "40000",
        "0.1"
      ],
      [
        "30000",
        "0.2"
      ]
    ],
    "updateTime": "2000-01-01 00:00:00.000000000Z"
  }
]

OrderBookL2.

Properties
Name Type Required Description
symbol string false Symbol.
asks [OrderBookL2AsksBidsEntry] false Sell side of orderbook.
bids [OrderBookL2AsksBidsEntry] false Buy side of orderbook.
updateTime string false Last update time of orderbook.
Order

{
  "orderID": "339210744",
  "clOrdID": "my-order-1",
  "symbol": "BTCUSD",
  "side": "Sell",
  "orderQty": "4.00000000",
  "price": "38000.00000",
  "currency": "BTC",
  "settlCurrency": "USD",
  "ordType": "Limit",
  "timeInForce": "GoodTillCancel",
  "ordStatus": "New",
  "leavesQty": "4.00000000",
  "cumQty": "0",
  "transactTime": "2021-06-17T09:47:52.280Z"
}

Order.

Properties
Name Type Required Description
orderID string false Unique ID for order as assigned by the exchange.
clOrdID string false Unique ID for order as assigned by the client.
symbol string false Symbol.
side string false Order side.
orderQty string false Order quantity.
price string false Order price.
currency string false Base currency.
settlCurrency string false Settlement currency.
ordType string false Order type.
timeInForce string false Specifies how long the order remains in effect.
ordStatus string false Order status
leavesQty string false Quantity open for further execution.
cumQty string false Total quantity filled so far.
transactTime string false Execution time.
error object false Error.
» name string false Error key.
» message string false Error description/details.

Enumerated Values

Property Value
side Buy
side Sell
ordStatus New
ordStatus PartiallyFilled
ordStatus Filled
ordStatus Cancelled
ordStatus Withdrawn
ordStatus Rejected
ordStatus Suspended
Orders

[
  {
    "orderID": "338697858",
    "clOrdID": "my-order-1",
    "symbol": "BTCUSD",
    "side": "Buy",
    "orderQty": "0.01000000",
    "price": "30000.00000",
    "currency": "BTC",
    "settlCurrency": "USD",
    "ordType": "Limit",
    "timeInForce": "GoodTillCancel",
    "ordStatus": "New",
    "leavesQty": "0.01000000",
    "cumQty": "0",
    "transactTime": "2021-06-11T03:49:20.521Z"
  },
  {
    "orderID": "338697888",
    "clOrdID": "my-order-2",
    "symbol": "BTCUSD",
    "side": "Sell",
    "orderQty": "0.01000000",
    "price": "60000.00000",
    "currency": "BTC",
    "settlCurrency": "USD",
    "ordType": "Limit",
    "timeInForce": "GoodTillCancel",
    "ordStatus": "New",
    "leavesQty": "0.01000000",
    "cumQty": "0",
    "transactTime": "2021-06-11T04:30:25.364Z"
  }
]

Orders.

Properties
Name Type Required Description
Orders. [Order] false Orders.
OrderCancelled
{
  "orderID": "338697858"
}

Order cancelled.

Properties
Name Type Required Description
orderID string false Unique ID for order as assigned by the exchange.
clOrdID string false Unique ID for order as assigned by the client.
error object false Error.
» name string false Error key.
» message string false Error description/details.
OrdersCancelled
[
  {
    "orderID": "338697858"
  },
  {
    "orderID": "338697862",
    "error": {
      "name": "ALREADY_CANCELLED",
      "message": "order already cancelled"
    }
  },
  {
    "orderID": "338697865",
    "error": {
      "name": "ORDER_NOT_FOUND",
      "message": "order not found"
    }
  }
]

Orders cancelled.

Properties
Name Type Required Description
OrdersCancelled. [OrderCancelled] false OrdersCancelled.
Execution

{
  "execID": "1628126",
  "trdMatchID": "16P1B",
  "orderID": "339210495",
  "clOrdID": "my-order-1",
  "lastQty": "1.00000000",
  "lastPx": "39000.00000000",
  "grossValue": "39000.00000000",
  "fee": "136.50000000",
  "execType": "Trade",
  "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
  "symbol": "BTCUSD",
  "side": "Sell",
  "currency": "BTC",
  "settlCurrency": "USD",
  "transactTime": "2021-06-17T06:11:06.000Z"
}

Execution.

Properties
Name Type Required Description
execID string false Execution ID.
trdMatchID string false Trade match ID.
orderID string false Unique ID for order as assigned by the exchange.
clOrdID string false Unique ID for order as assigned by the client.
lastQty string false Quantity bought/sold on this (last) fill.
lastPx string false Price of this (last) fill.
grossValue string false Total value traded.
fee string false Fee.
execType string false Execution type.
account string false Account ID.
symbol string false Symbol.
side string false Order side.
currency string false Base currency.
settlCurrency string false Settlement currency.
leavesQty string false Quantity open for further execution.
cumQty string false Total quantity filled so far.
avgPx string false Average execution price.
transactTime string false Execution time.

Enumerated Values

Property Value
execType Trade
side Buy
side Sell
Executions

[
  {
    "execID": "1628126",
    "trdMatchID": "16P1B",
    "orderID": "339210495",
    "clOrdID": "my-order-1",
    "lastQty": "1.00000000",
    "lastPx": "39000.00000000",
    "grossValue": "39000.00000000",
    "fee": "136.50000000",
    "execType": "Trade",
    "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
    "symbol": "BTCUSD",
    "side": "Sell",
    "currency": "BTC",
    "settlCurrency": "USD",
    "transactTime": "2021-06-17T06:11:06.000Z"
  },
  {
    "execID": "1628127",
    "trdMatchID": "16NNF",
    "orderID": "339209709",
    "clOrdID": "my-order-2",
    "lastQty": "0.01000000",
    "lastPx": "33000.00000000",
    "grossValue": "330.00000000",
    "fee": "1.15500000",
    "execType": "Trade",
    "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
    "symbol": "BTCUSD",
    "side": "Buy",
    "currency": "BTC",
    "settlCurrency": "USD",
    "transactTime": "2021-06-16T14:34:36.000Z"
  }
]

Executions.

Properties
Name Type Required Description
Executions. [Execution] false Executions.
ExecutionOrder

{
  "order": {
    "orderID": "339210495",
    "clOrdID": "my-order-1",
    "symbol": "BTCUSD",
    "side": "Sell",
    "orderQty": "4.00000000",
    "price": "38000.00000",
    "currency": "BTC",
    "settlCurrency": "USD",
    "ordType": "Limit",
    "timeInForce": "GoodTillCancel",
    "ordStatus": "New",
    "leavesQty": "4.00000000",
    "cumQty": "0",
    "transactTime": "2021-06-17T09:47:52.280Z"
  },
  "execution": [
    {
      "execID": "1628128",
      "trdMatchID": "16P1C",
      "orderID": "339210744",
      "clOrdID": "my-order-1",
      "lastQty": "1.00000000",
      "lastPx": "39000.00000000",
      "grossValue": "39000.00000000",
      "fee": "136.50000000",
      "execType": "Trade",
      "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
      "symbol": "BTCUSD",
      "side": "Sell",
      "currency": "BTC",
      "settlCurrency": "USD",
      "transactTime": "2021-06-17T06:11:06.000Z"
    },
    {
      "execID": "1628129",
      "trdMatchID": "16NNG",
      "orderID": "3339210744",
      "clOrdID": "my-order-1",
      "lastQty": "0.01000000",
      "lastPx": "33000.00000000",
      "grossValue": "330.00000000",
      "fee": "1.15500000",
      "execType": "Trade",
      "account": "1abd7b0e-edf3-444e-95b3-95de59b7e209",
      "symbol": "BTCUSD",
      "side": "Buy",
      "currency": "BTC",
      "settlCurrency": "USD",
      "transactTime": "2021-06-16T14:34:36.000Z"
    }
  ]
}

Execution of order.

Properties
Name Type Required Description
order Order false Order.
execution Executions false Executions.

v3

Introduction

The OSL Exchange offers both public and private REST APIs for OSL Exchange users.

Public REST APIs provide market data:

Private REST APIs allow one to manage both orders and funds:

Public APIs

GET /api/3/currencyStatic
Obtain supported currency and currency pair

This endpoint returns a list of supported currencies and currency pairs.

e.g OSL supported settlement currencies

USD, USDT, BTC

e.g. OSL supported crypto currencies

BTC, ETH, BCH, LTC

e.g OSL supported currency pairs

BTCUSD,ETHUSD, BCHUSD, BTCUSDT, LTCUSD, USDTUSD

Response Definition

Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode Result code reflecting the success status of the operation. OK
currencyStatic Currency Static see Currency Static

Currency Static

Fields Description Example
currencies map of ccy and currency settings e.g. BTC
currencyPairs map of CcyPair and Currency Pair Settings e.g BTCUSD

Currency Settings

Fields Description Example
decimals decimal place used for trading 8
minOrderSize minimum order size 0.00020000
maxOrderSize maximum order size 100000.00000000
minOrderValue minimum order value 1.0E-7
maxOrderValue minimum order value 100000000.00000000
maxMarketOrderValue maximum market order value 10.00000000
maxMarketOrderSize maximum market order size 10.00000000
displayDenominator display denominator 1000
summaryDecimals decimals place used to display summary e.g. 0
display Unit currency unit e.g. BTC
symbol symbol of the currency e.g. Ɖ for BTC
type CRYPTO or FIAT CRYPTO
confirmationThresholds
networkFee standard network fee 0.00010000
engineSettings Fund Engine Settings see Fund Engine Settings
urlPrefix url prefix to handle the corresponding coin address bitcoin:
digitalCurrencyType SATOSHI, RIPPLE, RIPPLE_IOU, ETHEREUM, ETHEREUM_TOKEN
assetId (CRYPTO type only) e.g. SATOSHI
assetName (CRYPTO type only) e.g. BTC
assetDivisibility (CRYPTO type only) asset divisibility e.g. 2
assetIcon (CRYPTO type only) asset icon /images/currencies/crypto/AAVE.svg
assetIssueQuantity (CRYPTO type only) asset issue quantity e.g. 10000

Fund Engine Settings

Fields Description Example
depositsEnabled If true deposits are enabled true
withdrawalsEnabled If true withdrawals are enabled true
displayEnabled If true the currency is visible on the platform. If false the user should also reflect this in their application and hide the currency. true
mobileAccessEnabled true always from API v3 true

Currency Pair Settings

Fields Description Example
priceDecimals decimals place of price for trading 5
engineSettings Order Engine Settings see Order Engine Settings
minOrderRate minimum order rate 10.00000000
maxOrderRate maximum order rate 40000.00000000
displayPriceDecimals decimals place of price for display 5
tradedCcy traded Ccy e.g BTC for BTCUSD
settlementCcy settlement Ccy e.g USD for BTCUSD
preferredMarket The market where the currency is tradeable

Order Engine Settings

Fields Description Example
tradingEnabled true if trading enabled true
displayEnabled If true the currency is visible on the platform. If false the user should also reflect this in their application and hide the currency.
cancelOnly cancel true
verifyRequired true if verification required for trading true
restrictedBuy true if user cannot buy the currency pair true
restrictedSell true if user cannot sell the currency pair true
GET /api/2/currency_pair/money/ticker
Get the most recent ticker

Get the most recent ticker for a currency pair

Request parameters

Fields Description Example

Response Definition

Fields Description Example
result result success
data Ticker see Ticker

Ticker

Fields Description Example
high 24 hrs high See Ticker Field
low 24 hrs low See Ticker Field
last last price See Ticker Field
now unix timestamp, in microsecond 1632411887944000
dataUpdateTime unix timestamp, in microsecond 1632411887227000

Ticker Field

Fields Description Example
display_short Display in short form i.e. in 2 decimal place 43,000.00 USD
value_int value x 10000 4300000000
currency currency USD
display Display in short form i.e. in 5 decimal place 43,000.00000 USD
value value in decimal 43000.00000
GET /api/2/currency_pair/money/depth/full
Order Book Full Depth

Get a complete copy the order book for a currency pair.

In the example below, the order book of BTCUSD is requested. There are 4 bids and 3 asks. The highest bid is 2,000 USD for 3 BTC, the lowest ask is 3,260.4 USD for 16 BTC.

Request parameters

Fields Description Example

Response Definition

Fields Description Example
result result success
data Order Depth see Order Depth

Order Depth

Fields Description Example
now unix timestamp, in microsecond 1632412125425000
dataUpdateTime unix timestamp, in microsecond 1632412125425000
asks order ladders of asks side. (lower price to higher price) see Order Ladder
bids order ladders of bids side (higher price to lower price) see Order Ladder

Order Ladder

Fields Description Example
price price of the ladder 1.05000
price_int price of the ladder in integer (price x 10000) 105000
amount amount of the ladder 30000.0
amount_int amount of the ladder in integer (amount x10000) 3000000000000

Fund Management APIs

POST /api/3/account
Get account information

The platform has a few unique accounts for each user and a defined as below.

Request Definition

Fields Description Example
tonce/nonce current timestamp in microseconds/ever increasing integer 1368892862123456/1632398764302000

Response Definition

Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode Result code reflecting the success status of the operation. OK
data info result Info Result
userUuid user's uuid d34ea17d-2b30-fg93-bd62-eaf1d43f7a20

Info Result

Fields Description Example
Created created date in format (yyyy-MM-dd HH:mm:ss) 2020-09-18 11:44:19
Language user's preferred language e.g. en_US
Login username [email protected]
Trade_Fee ordering fee 0.2000
Rights list of access right ["trade", "withdraw", "get_info" ]
Wallets map of ccy and wallet See Wallet

Wallet

Fields Description Example
Balance Sum of Primary_Available_Balance + Exchange_Available_Balance (Amount) See Amount
Primary_Available_Balance Primary account's available balance (Amount) See Amount
Exchange_Available_Balance Exchange account's available balance (Amount) See Amount

Amount

Fields Description Example
displayShort Display in short 199.99 BTC
valueInt Value in Integer 19999400000
currency currency BTC
display display in full 199.99400000 BTC
value value 199.99400000
POST /api/3/send
Withdraw Crypto Funds

This service allows users to withdraw funds. The API Key must have "move funds" permissioned, via the web platform

A confirmation email is sent to confirm the withdrawal. If the link within the email is not clicked within 10 minutes the withdrawal request will be cancelled.

Request parameters

Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy currency (e.g. BTC, LTC, and ETH) BTC
address valid address in the selected ccy 2MucnhthMEQSy6kqx765pwGwb27DzAeZEnb
otp otp key for security reason
amount amount to send (must be less than the available balance) 0.0054
destinationTag (This parameter is only used for crypto currencies that require a destinationTag such as Ripple). Destination tags identifies the purpose of payments allowing a singleaddress to be utilized by multiple users. Additionally, these tags enable the return of payments.

Request parameters

Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode Result code reflecting the success status of the operation. OK
transactionId internal transaction id of the transaction. Note this is not the coin txid in blockchain. At the time this method is invoked, the blockchain TXID is not available. This identifier, however, can be used to reconcile the transaction updates sent when requesting the status of a fund movement.
POST /api/3/receive
Obtain a current receive address for the given token

Use this service to obtain a valid address to receive crypto funds.

Request Definition

Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy traded currency e.g. BTC, LTC, ETH, BCH
subAccount Optional. Uuid of the subAccount of which you want to get coin address. If not specified, this will be your default subAccount. 622bcf3c-46e1-4dc5-bda4-4c9asdrf4dad

Response Definition

Fields Description Example
resultCode Result code reflecting the success status of the operation. OK
timestamp UNIX timestamp in milliseconds 1632390252603
address Valid crypto address e.g. BTC, LTC, ETH, BCH
subAccount UUID of the subAccount of which the coin address is tied to 622bcf3c-46e1-4dc5-bda4-4c9asdrf4dad
POST /api/3/receive/create
Create a new deposit address for a specific token

Use this service to create a new address to receive crypto funds. New address will be created only if old address has transactions.

Request Definition

Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy traded currency e.g. BTC, LTC, ETH, BCH
subAccount Optional. Uuid of subAccount for which you want to create a new coin address. If not specified, this will be your default subAccount. 622bcf3c-46e1-4dc5-bda4-4c9asdrf4dad

Response Definition

Fields Description Example
resultCode Result code reflecting the success status of the operation. OK
timestamp UNIX timestamp in milliseconds 1632390252603
address Valid new crypto address e.g. BTC, LTC, ETH, BCH
subAccount UUID of the sub account that the coin address is tied to. 622bcf3c-46e1-4dc5-bda4-4c9asdrf4dad
POST /api/3/transfer
Move funds in-between platform accounts

Use this service to move funds in-between different accounts that allows for spot order book trading/withdrawal/deposit.

Request Definition

Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
from "From" account. See AccountType e.g. AVAILABLE, EXCHANGE
to "To" account. See AccountType e.g. EXCHANGE, AVAILABLE
amount This is the amount to move 1.5
ccy Currency selected to move currency e.g. BTC, ETH, LTC, BCH, USD

Account Type:

Fields Description Example
AVAILABLE primary account. Used for payment-in, payment-out, iRFQ
EXCHANGE Exchange account. Used for Spot Order book trading

Response Definition

Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
UUID Returns the transfer fund transaction uuid
status If transfer fund is successful, “OK” is returned OK
resultCode Result Code See Result Code

Result Code:

Result code reflects the status of the operation.

Fields Description
OK the fund is being transferred
INVALID_PARAMETERS Too many decimals or Exchange product not available
INSUFFICIENT_AVAILABLE_BALANCE account has insufficient funds to move
NO_PERMISSION Do not have permission
SYSTEM_ERROR system error
POST /api/3/transfer/list
Obtain transfer list for the account

Request Definition

Fields Description Example
nonce Ever increasing integer 1632398764302000
ccy optional - default is all the ccy USD
date processed from optional - default is past 7 days 1368892862123456
date processed to optional - default is past 7 days 1368892862123456

Response Definition

Fields Description Example
date UNIX timestamp in milliseconds 1368892862123456
state state will be PROCESSING/REVERSED/PROCESSED Sent
ccy currency USD
amount amount details
From Account Transfer from primary/exchange/brokerage primary
To Account Transfer to primary/exchange/brokerage exchange

Order Management API

POST /api/3/order/new
Create/Replace an order

By using this method, you can create new order or amend an existing order. The API Key must have the “Place and Manage Orders” permission enabled.

Request Definition (Create new order)

Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
order Order see Order

Order

Fields Description Example
orderType Order type LIMIT / MARKET
tradedCurrency Traded currency(currently one of BTC, ETH, BCH and LTC) BTC
tradedCurrencyAmount traded currency amount, numeric number with at most 8 decimal places 1234.12345678
settlementCurrency Settlement currency e.g. USD, USDT, and BTC
settlementCurrencyAmount settlement currency amount, numeric number with at most 8 decimal places 1234.12345678
buyTradedCurrency buying traded currency or settlement currency true or false
limitPriceInSettlementCurrency price in settlement currency, only valid for limit order 3000.12345
immediateOrCancel true for IMMEDIATE_OR_CANCEL order. orderType should be LIMIT true or false
replaceExistingOrderUuid to replace existing order 622bcf3c-46e1-4dc5-bda4-4c9asdrf4dad
replaceOnlyIfActive Replace the order only if the order being replace is active false

Response Definition

Fields Description Example
orderId Unique id of this order. 383390532
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode Result code reflecting the success status of the operation. ORDER_REQUEST_SUBMITTED
orderState Current order state Including ACTIVE / PARTIAL_FILL / FULL_FILL / EXPIRED / PENDING_SUBMISSION. If order state is PENDING_SUBMISSION, it indicates that order is pending processing by the matching engine. Need to do order enquiry to confirm the latest state.

Possible Result code

Fields Description
ORDER_REQUEST_SUBMITTED Order request submitted. It is generally considered a successful response.
INSUFFICIENT_AVAILABLE_BALANCE Insufficient available balance
TOO_MANY_OPEN_ORDERS Too many open orders
TOO_SMALL Order value too small
USER_NOT_VERIFIED User is not verified for trading
INVALID_PARAMETERS Invalid parameters, including wrong currency pair, order amount/rate too big, too many decimal place, etc
POST /api/3/order/cancel
Cancel a list of orders

The API Key must have "placeOrders" authority.

Request Definition

Fields Description Example
tonce/nonce current timestamp in microseconds/ever increasing integer 1368892862123456/1632398764302000
orderIds list of order ids e.g. order id : "565f2cdf-3f34-4881-bc80-46584c2c6b8d"

Response Definition

Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode see result code OK
resultCodeList list of Cancel Status see Cancel Status

Cancel Status

Fields Description Example
uuid order's uuid 383390532
errorCode error code CANCEL_REQUEST_SUBMITTED

Result Code

Fields Description
OK
OK_PARTIAL Request failed please check resultCodeList for detail
SYSTEM_ERROR System error
ENGINE_NOT_AVAILABLE Engine not available. request cannot be processed
USER_ACTIVITY_RESTRICTED The API is not enabled for this function

Error Code

Fields Description
ORDER_NOT_FOUND The system was unable to find the requested order.
CANCEL_REQUEST_SUBMITTED cancel request submiited
ERROR_ORDER_STATUS_SET_NO_CANCEL_CANCELLED The order cannot be cancelled as order is already cancelled
ERROR_ORDER_STATUS_SET_NO_CANCEL_AMENDED The order cannot be cancelled as order ID does not exist as it has been amended
ERROR_ORDER_STATUS_SET_NO_CANCEL_MATCHED The order cannot be cancelled as it is already fully filled
SYSTEM_ERROR order state uncertain

Order Status APIs

POST /api/3/transaction/list

Querying this endpoint, returns status of your transactions (max result: 200) across the OSL platform. You can specify date range and/or offset so that you can paginate the transactions returned.

Request Definition

Fields Description Example
nonce/tonce ever increasing integer/current timestamp in microseconds 1632398764302000/1368892862123456
ccy currency BTC (optional)
transactionState TransactionState e.g.PROCESSED (optional)
from start time(inclusive) of queries transaction, format should be a number (UNIX timestamp in milliseconds) (optional) 1464675012000
to end time(inclusive) of queries transaction, format is same as 'from' (optional) 1464679012000
max Max results you want the endpoint to return. Note that it can be no greater than 200. Default value is 50 if not provided. (optional) 50
offset if there is more than 'max' results between the date range you specified, this field is useful for you to get the next 'max' results (optional) if max is 200, and there are actually 407 results in the date range, offset=400 will get you the last 7 results
lang displayTitle and displayDescription for each transaction returned will be in the language specified. Default is "en-US". (optional) en-US

TransactionState

Fields Description
SUBMITTED Transaction submitted
PROCESSED Transaction has been processed
SUSPENDED Transaction has been suspended
REVERSED Transaction has been reversed
LIMIT_OVERRIDE_APPROVED Limit overridden
CANCELLED_INSUFFICIENT_FUNDS Cancelled insufficien funds
CANCELLED_LIMIT_BREACH Cancelled - limit breached
PENDING_CONFIRM Pending confirmation
PENDING_SUFFICIENT_CONFIRMATIONS Pending confirmation
PENDING_REVERSE Pending reversal
PENDING_LIMIT_APPROVAL Pending limit approval

Language

Fields Description
zh-CN Simplified Chinese
zh-HK Traditional Chinese
en-US English (US)

Response Definition

Fields Description Example
resultCode Result code reflecting the success status of the operation. OK
timestamp UNIX timestamp in milliseconds 1632390252603
transactions list of transactions see Transaction
count number of transactions returned 10
totalCount total number of transactions 50

Transaction

Fields Description Example
transactionClass FILL, COUPON and etc COUPON
uuid uuid of the transaction 6d568392-ce9f-42b9-bfe6-074cffa78d6b
userUuid uuid belong to the user 67271c1d-2f9b-48e2- a5bb-01c8a8ce11a4
amount total value of the transaction e.g -1.00345678
fee fee included in the transaction 0.0
balanceBefore balance before the transaction 105337.05233524
balanceAfter balance after the transaction 105336.04887846,
ccy currency BTC
transactionState transaction state e.g. PROCESSED
transactionType transaction type FILL_DEBIT
received received timestamp 1431004151000
processed processed timestamp 1431004151000
timestampMillis created timestamp 1464677126478
displayTitle Order Fill Order Filled
displayDescription description Sell BTC @ 3231.23333 USD / BTC or quoteId: xxxx-xxxx-xxxx-xxxxxxxxxxx

TransactionClass

Fields Description
FILL Spot Orderbook Trade
COIN Digital Asset Transfer via blockchain
CASH Cash Transfer
COUPON Fund Transfer
MERCHANT iRFQ Trade
OTCTRADE OTC Trade
NONCUSTODIAL Non Custodial
POST /api/3/order/info
Getting Order status

This method returns filled inter-day order info and any active orders

Request Definition

Fields Description Example
tonce/nonce current timestamp in microseconds/ever increasing integer 1368892862123456/1632398764302000
orderId Unique id of this order. "565f2cdf-3f34-4881-bc80-46584c2c6b8d"

Response Definition

Fields Description
resultCode see result code
timestamp UNIX timestamp in milliseconds
order Order

Order

Fields Description
orderId Unique id of this order.
timestamp unix timestamp
orderType LIMIT, MARKET
orderStatus Status code of this order
settlementCurrency Settlement currency
settlementCurrencyAmount Settlement currency amount
settlementCurrencyAmountOutstanding Settlement currency amount outstanding
tradedCurrency Traded currency
tradedCurrencyAmount Traded currency amount
tradedCurrencyAmountOutstanding Traded currency amount outstanding
immediateOrCancel true for IMMEDIATE_OR_CANCEL order. orderType should be LIMIT
buyTradedCurrency buying traded currency or settlement currency
trades the list of Trade
replaceExistingOrderId The order id that this order replaced
limitPriceInSettlementCurrency price in settlement currency, only valid for limit order

Trade

Fields Description
tradeId trade id
orderId order id
timestamp unix timestamp
tradedCurrencyFillAmount fill amount
settlementCurrencyFillAmount fill amount
settlementCurrencyFillAmountUnrounded fill amount
price price
ccyPair trade pair
side BUY or SELL

Possible result code

Fields Description
ORDER_NOT_FOUND Order not found

Possible order status code

Status Code Description
PENDING_SUBMISSION Pending to be processed by the system
ACTIVE Active. Pending to be matched by the system
EXPIRED Expired
PARTIAL_FILL Partially filled
FULL_FILL Full filled
NO_FILL Not filled
POST /api/3/order/orderId
Getting Order Info By Order ID

Request Definition

Fields Description Example
tonce/nonce current timestamp in microseconds/ever increasing integer 1368892862123456/1632398764302000

Response Definition

Fields Description
resultCode see result code
timestamp UNIX timestamp in milliseconds
order Order

Order

Fields Description
orderId Unique id of this order.
timestamp unix timestamp
orderType LIMIT, MARKET
orderStatus Status code of this order
settlementCurrency Settlement currency
settlementCurrencyAmount Settlement currency amount
settlementCurrencyAmountOutstanding Settlement currency amount outstanding
tradedCurrency Traded currency
tradedCurrencyAmount Traded currency amount
tradedCurrencyAmountOutstanding Traded currency amount outstanding
immediateOrCancel true for IMMEDIATE_OR_CANCEL order. orderType should be LIMIT
buyTradedCurrency buying traded currency or settlement currency
replaceExistingOrderId The order id that this order replaced
limitPriceInSettlementCurrency price in settlement currency, only valid for limit order
trades the list of Trade

Trade

Fields Description
tradeId trade id
orderId order id
timestamp unix timestamp
tradedCurrencyFillAmount fill amount
settlementCurrencyFillAmount fill amount
settlementCurrencyFillAmountUnrounded fill amount
price price
ccyPair trade pair
side BUY or SELL

Possible result code

Result Code Description
ORDER_NOT_FOUND Order not found

Possible order status code

Result Code Description
PENDING_SUBMISSION Pending to be processed by the system
ACTIVE Active. Pending to be matched by the system
EXPIRED Expired
PARTIAL_FILL Partially filled
FULL_FILL Full filled
NO_FILL Not filled
REPLACED Amended order
REPLACED_PARTIAL partially amended order
USER_CANCEL Cancelled order
USER_CANCEL_PARTIAL partially cancelled order
SUSPENDED suspended order
POST /api/3/order/list
Get a list of all orders with execution. Max of 100 orders. If user has more than 100 orders, only the first 100 orders are returned

Request Definition

Fields Description Example
tonce/nonce current timestamp in microseconds/ever increasing integer 1368892862123456/1632398764302000
offset offset index (optional) e.g. 0
max max number of orders to retrieve (optional) e.g. 10

Response Definition

Fields Description Example
timestamp UNIX timestamp in milliseconds 1632390252603
resultCode see result code OK
orders list of orders see Order
count number of orders returned 10
totalCount total number of orders 50

Order

Fields Description
orderId Unique id of this order.
timestamp unix timestamp
orderType LIMIT, MARKET
orderStatus Status code of this order
settlementCurrency Settlement currency
settlementCurrencyAmount Settlement currency amount
settlementCurrencyAmountOutstanding Settlement currency amount outstanding
tradedCurrency Traded currency
tradedCurrencyAmount Traded currency amount
tradedCurrencyAmountOutstanding Traded currency amount outstanding
immediateOrCancel true for IMMEDIATE_OR_CANCEL order. orderType should be LIMIT
buyTradedCurrency buying traded currency or settlement currency
trades the list of Trade
replaceExistingOrderId The order id that this order replaced
limitPriceInSettlementCurrency price in settlement currency, only valid for limit order
POST /api/3/trade/list
Get a list of all executions

Request Definition

Fields Description Example
tonce/nonce current timestamp in microseconds/ever increasing integer 1368892862123456/1632398764302000
offset offset index e.g. 0
max max number of trades to retrieved e.g. 10
reverse Lists trades in chronological order when reverse=true. Lists trades in reverse chronological order when reverse=false. If reverse flag is not specified, the default behavior will be reverse chronological order. e.g. reverse=true returns trades {1,2,3,4,5}. reverse=false returns trades {5,4,3,2,1}

Response Definition

Fields Description Example
resultCode see result code OK
timestamp unix timestamp 1632413965660
trades list of trade see Trade
count number of trades returned 99
totalCount total number of trades 99

Trade

Fields Description Possible values
tradeId trade id 1301c427-1df4-4dfb-9d68-3a8c55868a93
timestamp unix timestamp 1600420538000
orderId order id (uuid ) 214472867
tradedCurrencyFillAmount fill amount 1.00000000
settlementCurrencyFillAmount fill amount 390.00
settlementCurrencyFillAmountUnrounded fill amount 390.00000000
price price 390.00000
executionId trade execution Id V68V
side side of the trade BUY
ccyPair trade pair e.g. BTCUSD

WebSocket

Introduction

Websocket API allows user to subscribe to market data via an unsecured websocket endpoint streamed over secure sockets (protcol wss).

Once a connection is established the client will receive a stream of JSON messages that allows a them to maintain a real time view of market data.

Subscription Endpoint Details

The structure of the URL is:

Below shows an example susbcription for BTC/USD and LTC/USD on a single connection:

wss://trade-am.oslsandbox.com/ws/v4?subscribe=orderBook:BTCUSD,orderBook:LTCUSD

The publication frequency and depth are set by OSL and are currently set to two updates per second at a maximum depth of 25 levels per side.

If subscription is submitted for an instrument that does not exist the subscription will be rejected with http code 404, if multiple instruments are subcribed to all subscriptions are rejected if one of the instrument does not exist.

Market Data Message Details

All messages are published in JSON format. Each message contains a field called action which determines how the message should be processed by the client. A message may contain multiple price data elements that always contain a price, a side and conditionally a size.

The combination of price and side is guaranteed unique and in a naive implementation of unordered books this pair could be used as the key to a hash based map.

The value of action specifies how the message should be handled; each action type is outlined below with an example message.

Partial Message

Action partial means the message is a new snapshot message, the client should remove the existing view of the order book and replace it with prices and sizes specified in the body of the message.

{
  "table": "orderBookL2",
  "action": "partial",
  "symbol": "BTCUSD",
  "bookVersionId": 1,
  "sendTime": 1632330416488,
  "keys": [
    "symbol",
    "id",
    "side"
  ],
  "data": [
    {
      "symbol": "BTCUSD",
      "side": "Buy",
      "size": "1.0",
      "price": "43000.0"
    }
  ]
}

Insert Message

Action insert means insert or replace the current value of that price level with the new value; the value is the new absolute position for that price level. Only the size will be changed in the event of an order's price being ammended the appropriate combintation of insert/append and delete messages will be published to amend the appropriate levels.

{
  "table": "orderBookL2",
  "action": "insert",
  "symbol": "BTCUSD",
  "bookVersionId": 206,
  "sendTime": 1632335161128,
  "publishTime": 1632335161441,
  "data": [
    {
      "symbol": "BTCUSD",
      "side": "Sell",
      "size": "177.0",
      "price": "47228.0"
    },
    {
      "symbol": "BTCUSD",
      "side": "Sell",
      "size": "102.0",
      "price": "48935.0"
    }
  ]
}

Update Message

Action update means insert or replace the current value of that price level; the value is the new absolute position for that price level.

{
  "table": "orderBookL2",
  "action": "update",
  "symbol": "BTCUSD",
  "bookVersionId": 207,
  "sendTime": 1632335161128,
  "publishTime": 1632335161441,
  "data": [
    {
      "symbol": "BTCUSD",
      "side": "Sell",
      "size": "177.0",
      "price": "47228.0"
    },
    {
      "symbol": "BTCUSD",
      "side": "Sell",
      "size": "102.0",
      "price": "48935.0"
    }
  ]
}

Delete Message

Action delete means remove the price level; if the price level does not exist the message should be ignored.

{
  "table": "orderBookL2",
  "action": "delete",
  "symbol": "BTCUSD",
  "bookVersionId": 208,
  "sendTime": 1632335161128,
  "publishTime": 1632335161441,
  "data": [
    {
      "symbol": "BTCUSD",
      "side": "Sell",
      "price": "46823.0"
    }
  ]
}

Heartbeat Message

Action heartbeat is a keep alive message sent every 30 seconds for each instrument if there are no updates in that time interval.

{
  "table": "orderBookL2",
  "timestamp": 1632334653163,
  "action": "heartbeat",
  "symbol": "BTCUSD"
}

FIX

Introduction

In 2021 a new FIX implementation was introduced into the OSL stack offering a higher level of stability and compliance to FIX 4.4, and enhanced message recovery options.

This section contains the FIX interface specification for the new FIX implementation of the OSL Exchange. The document serves as a technical reference for users of the exchange when building applications that connect to the Exchange through FIX 4.4 protocol.

FIX Onboarding Process

To maintain a high level of platform integrity we require users to successfully complete a conformance test to ensure that the user’s implementation conforms to the specification outlined in this document. The certification process will test the message flow that users need.

This table below shows the activities involved

Activity Owner
Obtain source IP from user for UAT and PROD User
Register order management and settlement accounts for FIX user creation via trading platform User
Provide FIX conformance test plan to user OSL
Generate CSR key for stunnel certificate User
Sign the CSR key from user and send back to user OSL
Create FIX session(s) and open stunnel port to FIX engine OSL
Whitelist source IP and port from firewall OSL
Provide stunnel connection detail/FIX credentials to user OSL
User completes conformance test User
Certify user with the conformance test results User

Connectivity Details

Access to the platform has to go through TLS/SSL encrypted TCP connection over the Internet.

FIX users have to set up a stunnel to route FIX traffic.

The OSL FIX API supports three FIX session types:

Order Management Session for managing orders (new, amend, cancel)

Market Data Session for subscribing to market data

Drop Copy Session (also known as Trade Feed) for receiving a copy of trades.

Message Flow

OSL’s FIX interface conforms to version 4.4 of the protocol.

Supported Message Types

Administrative messages:

Application messages supported in the order management session:

Application messages supported in the drop copy session:

Application messages supported in the market data session:

Session Management

FIX sessions are uniquely defined by SenderCompID and TargetCompID. Any attempt to establish an additional FIX session using the same SenderCompID and TargetCompID will be rejected.

When either side of a FIX session has not sent any message for HeartBtInt<108> seconds, the FIX client/Exchange will transmit a Heartbeat<0> message. If one side of the connection does not receive any message for (HeartBtInt<108> + (HeartBtInt<108> / 5)) seconds, the other side will transmit a TestRequest<1> message. If there is still no Heartbeat<0> message received afterward, a force logout should be initiated from either end to disconnect the session.

In case of connectivity loss with the Exchange, the Exchange expects the FIX client to re-logon with the next expected sequence numbers and to handle the sequence synchronization if there’s any sequence gap detected.

For Market Data (MD) Session, the Exchange doesn’t support session management. Every MD session needs to re-login with force reset sequence number (ResetSeqNumFlag<141>=Y).

Note that upon the completion of scheduled maintenance periods it is expected that Order Management (OM) and Drop Copy (DC) sessions logon with MsgSeqNum <34> =1 and ResetSeqNumFlag<141>=Y.

Session Messages

Header and Trailer

All FIX messages must begin with header fields and end with a trailer field

Standard Header

Tag Field Name Data Type Req’d Comments
8 BeginString string Y Identifies beginning of new message and protocol version. Always the first field in a message. Value is FIX.4.4.
9 BodyLength int Y Message length, in bytes, forward to the CheckSum<10> field. Always second field in message and unencrypted.
35 MsgType string Y Defines message type. Always third field in message.
49 SenderCompID int Y Used to identify a firm which sends the message.
56 TargetCompID string Y Used to identify a receiving firm.
34 MsgSeqNum int Y Integer message sequence number.
43 PosDupFlag boolean C Required for retransmitted messages as a result of ResendRequest.
97 PossResend boolean C Required when message may be a duplicate of another message sent under a different sequence number.
122 OrigSendingTime timestamp C Required for messages sent as a result of ResendRequest. Time of original transmission in UTC.
52 SendingTime timestamp Y Time of message transmission in UTC.

Standard Trailer

Tag Field Name Data Type Req’d Comments
10 CheckSum int Y Simple checksum. Always defined as three characters in the last field in the message.

Heartbeat <0>

The client and the Exchange transmit the Heartbeat <0> message to verify connectivity during periods of inactivity. The Exchange will send a Heartbeat anytime it has not transmitted a message during the heartbeat interval. The client is expected to employ the same logic.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = 0
112 TestReqID string C Identifier to be returned in resulting Heartbeat if requested from a TestRequest.
Standard trailer Y

Logon <A>

The Logon <A> message authenticates a user and starts a session. It must be the first message sent by any application requesting to initiate a FIX session. A message of the same type will be sent to acknowledge the logon.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = A
98 EncryptMethod int Y Method of encryption. Valid values:
●0 = None / other
108 HeartBtInt int Y Heartbeat interval (seconds).
141 ResetSeqNumFlag boolean N Indicates that both sides of the FIX session should reset sequence numbers. Values:
●Y = Yes, reset sequence numbers
●N = No (default)
553 Username string Y UserId (provided during onboarding).
554 Password string Y Password (provided during onboarding).
Standard trailer Y

Test Request <1>

The Test Request <1> message forces a heartbeat from the opposing application in order to verify the FIX session status; upon receiving receipt of a TestRequest the recipient should reply with a Heartbeat message stating the corresponding TestReqID.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = 1
112 TestReqID string Y Identifier to be returned in the resulting Heartbeat.
Standard trailer Y

Reject <3>

The Reject <3> message is issued by the server when a message is received but cannot be properly processed due to deviation from the FIX specification or system error. The reason for the rejection may be given in the Text <58> field.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = 3
45 RefSeqNum int Y MsgSeqNum <34> of the rejected message.
371 RefTagID int N The tag number of the FIX field being referenced.
372 RefMsgType string N The MsgType (35) of the message being referenced.
373 SessionRejectReason int N Code to identify the reason for the session level Reject message.
58 Text string N Message that explains reject reason.
Standard trailer Y

Logout <5>

The Logout <5> message is sent by either side to initiate a session termination. A response message of the same type will be sent to acknowledge the logout.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = 5
58 Text String N Message that explains logout reason. Normal client logout “remote initiated logout” Force logout due to inactivity “Remote has ignored my test request. Aborting session…”
Standard trailer Y

Resend Request <2>

The Resend Request <2> message can be sent by either side to initiate the retransmission of messages. It can be used if a sequence number gap is detected, or if either side lost a message, or as a function of the initialization process.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = 2
7 BeginSeqNo int Y Sequence number of first message in range to be resent.
16 EndSeqNo int Y Sequence number of last message in range to be resent. Set EndSeqNo=0 if all messages subsequent to BeginSeqNo are required.
Standard trailer Y

Sequence Reset <4>

The Sequence Reset <4> message is used by the sending application to reset the incoming sequence number on the opposing side.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = 2
123 GapFillFlag boolean N Indicates replacing administrative or application messages which will not be resent. Valid values:
● Y = Gap Fill mode
● N = Sequence Reset mode
36 NewSeqNo int Y New sequence number.
Standard trailer Y

Business Message Reject <j>

The Business Message Reject <j> message is issued by the server when a message is received but cannot be properly processed due to a business level rule violation. The reason for the rejection may be given in the Text <58> field.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = j
45 RefSeqNum int N MsgSeqNum <34> of the rejected message.
372 RefMsgType string Y The MsgType (35) of the message being referenced.
380 BusinessRejectReason int Y Code to identify the reason for the BusinessMessageReject message.
379 BusinessRejectRefID String N The value of the business level "ID" field on the message being referenced.
58 Text string N Message that explains reject reason.
Standard trailer Y

Cancel On Disconnect

FIX users can request to enable Cancel on Disconnect function so that all open orders submitted through a FIX session will be automatically cancelled when the server identifies a disconnection of the client session in the following scenarios:

Missed Execution Reports

FIX users will receive execution reports that they missed whilst not logged in the next time they log in.

For example, if an order was cancelled during log out and the client disconnected before they received an execution report, they will receive it on their next log in.

Legacy Mode

For FIX users that don't wish to receive missed execution reports, legacy mode can be set and the client can request to reset sequence numbers on log in. This will stop them from receiving any missed execution reports, simulating the behaviour from the legacy FIX implementation.

FIX users must request this mode during onboarding, and send 141=Y in Logon messages.

Below is a summary of the behaviour for different combinations of 141 options combined with legacy mode options.

141 Tag Value Legacy Mode Option NFE Behaviour
Y Off The client resets their sequence number and receives missed execution reports.

1. The client will send 141=Y and sequence number 34=1 in their login message
2. The exchange will respond with 141=Y and sequence number 34=1 in their login response
3. The exchange will proceed to send any execution reports to the client for activity done whilst they were disconnected (such as trades, order expiry etc.) on the next available sequence number(s) e.g. 34=2, 34=3
4. The session will continue as normal
N or Missing Off The client does not reset their sequence number and receives missed execution reports.

1. The client will send 141=N (or can leave the field out altogether) and their next available sequence number e.g. 34=442 in their login message
2. The exchange will respond with 141=Y and their next available sequence number 34=3242 in their login response
3. The exchange will proceed to send any execution reports to the client for activity done whilst they were disconnected (such as trades, order expiry etc.) on the next available sequence number(s) e.g. 34=3243, 34=3244
4. The session will continue as normal
N or Missing On Legacy mode is only activated if the client sends 141=Y, so this scenario will be the same as if 141=N and legacy mode is off.

The client does not reset their sequence number and receives missing execution reports.
Y On The client does reset their sequence number and does not receive missing execution reports.

1. The client will send 141=Y and sequence number 34=1 in their login message
2. The exchange will respond with 141=Y and sequence number 34=1 in their login response
3. The exchange will NOT send any execution reports to the client for activity done whilst they were disconnected and the session will continue as normal

Order Execution

General Information

Instrument

FIX client retrieves the list of supported currency pairs from the Exchange. (The Exchange does not support Security Definition Request <c> message). Every order request message has to specify the instrument in Symbol <55>. e.g. 55=BTCUSD, the Exchange instrument shortname

OrdType <40>

The Exchange supports the following order types specify in OrdType<40> field:

TimeInForce <59>

The Exchange supports the following types TimeInForce<59> field:

OrdStatus <39>

The Exchange supports the following order status for OrdStatus<39> field:

Note that the Exchange does not support Pending OrdStatus (Pending Cancel<6>, Pending New<A> and Pending Replace<E>), the order status will contain the final result immediately. For example, in the event of receiving an Order Cancel Request, the system will respond with Cancelled<4> immediately.

ExecType <150>

The Exchange supports the following execution type for ExecType <150> field:

New Order Single

Example

Buy GTC Limit order BTCUSD Price=49417 Quantity=10

8=FIX.4.4 9=204 35=D 34=41934 49=<SenderCompID> 52=20211108-14:07:01.316 56=OSL 1=<Account> 11=<ClOrdID>  38=10 40=2 44=49417  54=1 55=BTCUSD 59=1 60=20211108-14:07:01.316 10=054

The New Order Single message is used to submit order to the Exchange for execution.

Order Types Supported

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = D
1 Account string Y The Exchange user uuid which should match the one specified in the Logon<A> message Username<553> field.
21 HandlInst int N Instructions for order handling on the Exchange Valid value:
● 1 = Automated execution order, private, no intervention.
11 ClOrdID string Y Unique identifier of the order as assigned by client.
38 OrderQty float Y Quantity to trade.
44 Price float C Price per unit of quantity (e.g. per 1 BTC coin). Not specified for Market (40=1) orders.
423 PriceType int N Code to represent the price type. Value value:
● 2 = Per unit
40 OrdType int Y Order type. Valid values:
● 1 = Market
● 2 = Limit
54 Side int Y Side of order. Valid values:
● 1 = Buy
● 2 = Sell
55 Symbol string Y Ticker symbol for instrument to trade.
59 TimeInForce int N Specifies how long the order remains in effect. Valid values:
● 0 - Day
● 1 - Good Till Cancel (GTC)
● 3 - Immediate or Cancel (IOC)
● 4 - Fill or Kill (FOK)
● 6 - Good Till Day (GTD)

NOTE: Exchange will convert to Day automatically if invalid value detected. For market orders TIF will be ignored.
60 TransactTime timestamp Y Time of execution/order creation in UTC i.e. yyyyMMdd-hh:mm:ss:xxx
126 ExpireTime timestamp C Date/time of order expiration (UTC). Required if TimeInForce is GTD (59=6) and ExpireDate (432) is not present in the message.
432 ExpireDate timestamp C The date of order expiration (local market date). Required if TimeInForce is GTD (59=6) and ExpireTime (126) is not present in the message.
110 MinQty float N Minimum quantity of the order to be executed.
111 MaxFloor float N Maxium quantity within the order to tbe shown on the exchange at any given time.
453 NoPartyIDs int N A repeating group which should contain unique combinations of below tags:
● PartyID <448>
● PartyIDSource <447>
● PartyRole <452>
>>448 PartyID string C Party identifier/code. It can be an Exchange firm name or user unique identifier that is the same as tag 1. e.g. XXXX_GROUP.
>>447 PartyIDSource string N Identifies class or source of PartyID <448> Valid value:
● D = Proprietary/Custom code
>>452 PartyRole int N Identifies the type of PartyID <448> Valid values:
● 1 = Executing Firm
● 12 = Executing Trader
Standard trailer Y

Order Cancel / Replace Request <G>

Example

Sell GTC Limit order BTCUSD Price-49110 Quantity-3

8=FIX.4.4 9=216 35=G 34=68961 49=<SenderCompID> 52=20211108-15:44:28.546 56=OSL 11=<ClOrdID> 37=<OrderID> 38=3 40=2 41=<OrigClOrdID> 44=49110 54=1 55=BTCUSD 59=1 60=20211108-15:44:28.546 453=1 448=<PartyID> 447=D 452=1 10=026

The Order Cancel/Replace Request message is used to amend an existing order.

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = G
11 ClOrdID string Y Unique identifier of the order as assigned by client.
41 OrigClOrdID string Y ClOrdID <11> of the existing order that the amend request want to execute.
37 OrderID string N Unique identifier for Order as assigned by the Exchange.
44 Price float C Price per unit of quantity (e.g. per 1 BTC coin). Not specified for Market (40=1) orders.
38 OrderQty float Y Quantity to trade.
40 OrdType int Y Order type. Valid values:
● 1 = Market
● 2 = Limit
54 Side int Y Side of order. Valid values:
● 1 = Buy
● 2 = Sell
55 Symbol string Y Ticker symbol for Instrument to trade.
59 TimeInForce int N Specifies how long the order remains in effect. Valid values:
● 0 - Day
● 1 - Good Till Cancel (GTC)
● 3 - Immediate or Cancel (IOC)
● 4 - Fill or Kill (FOK)
● 6 - Good Till Day (GTD)

NOTE: Exchange will convert to Day automatically if invalid value detected. For market orders TIF will be ignored.
60 TransactTime timestamp Y Time of execution/order creation in UTC i.e. yyyyMMdd-hh:mm:ss:xxx
110 MinQty float N Minimum quantity of the order to be executed.
111 MaxFloor float N Maximum quantity within the order to tbe shown on the exchange at any given time.
453 NoPartyIDs int N A repeating group which should contain unique combinations of below tags:
● PartyID <448>
● PartyIDSource <447>
● PartyRole <452>
>>448 PartyID string C Party identifier/code. It can be an Exchange firm name or user unique identifier that is the same as tag 1. e.g. XXXX_GROUP.
>>447 PartyIDSource string N Identifies class or source of PartyID <448> Valid value:
● D = Proprietary/Custom code
>>452 PartyRole int N Identifies the type of PartyID <448> Valid values:
● 1 = Executing Firm
● 12 = Executing Trader
Standard trailer Y

Order Cancel Request <F>

Example

Cancel BTCUSD Buy Order

8=FIX.4.4|9=196 35=F 34=41934 49=<SenderCompID> 52=20211108-16:04:29.393 56=OSL 11=1630812684 37=1611395539 38=10 41=4538388570411831233 54=1 55=BTCUSD 60=20211108-16:04:29.393 10=046

The Order Cancel Request message is used to cancel an existing order with remaining quantity.

Order Cancel Request

Tag Field Name Data Type Req’d Comments
Standard header Y MsgType (35) = F
11 ClOrdID string Y The value of ClOrdID (11) referred in the corresponding OrderCancelRequest (35=F) or OrderCancelReplaceRequest (35=G).
41 OrigClOrdID string Y ClOrdID <11> of the existing order that the cancel request want to execute.
37 OrderID string N Unique identifier for Order as assigned by the Exchange.
38 OrderQty float Y Quantity to trade.
54 Side int Y Side of order. Valid values:
● 1 = Buy
● 2 = Sell
55 Symbol string Y Ticker symbol for Instrument to trade.
60 TransactTime timestamp Y Time of execution/order creation in UTC i.e. yyyyMMdd-hh:mm:ss:xxx
Standard trailer Y

Execution Report <8>

Example

8=FIX.4.4 9=472 35=8 49=OSL 56=<TargetCompID> 34=457096 52=20210902-06:32:36.670 37=161147158 198=11FW6K6 11=4538670045388666524 453=2 448=OSLDS GROUP 447=D 452=1 448=<PartyID> 447=D 452=12 17=1630537869.15910996:1.1 150=0 39=0 1=<Account> 660=93 63=0 55=BTCUSD 54=1 854=0 38=50 40=2 423=2 44=49110 59=1 151=50 14=0 6=0 75=20210902 60=20210902-06:32:36.497 381=0 119=187710 120=USD 155=0 156=M 110=0 111=50 797=N 136=1 137=0 138=USD 139=7 10=227

The Execution Report <8> message is used to

Execution Report

Tag Field Name Data Type Req’d Comments
Standard header - Outgoing Y MsgType (35) = 8
37 OrderID string N Unique identifier for Order as assigned by the Exchange.
198 SecondaryOrderID string N Unique identifier for Order as assigned by the Exchange(in a different format).
11 ClOrdID string Y Unique identifier of the order as assigned by client.
41 OrigClOrdID string C ClOrdID <11> of the existing order that the amend/cancel request want to execute.
453 NoPartyIDs int N A repeating group which should contain unique combinations of below tags:
● PartyID <448>
● PartyIDSource <447>
● PartyRole <452>
>>448 PartyID string C Party identifier/code. It can be an Exchange firm name or user unique identifier that is the same as tag 1. e.g. XXXX_GROUP.
>>447 PartyIDSource string N Identifies class or source of PartyID <448> Valid value:
● D = Proprietary/Custom code
>>452 PartyRole int N Identifies the type of PartyID <448> Valid values:
● 1 = Executing Firm
● 12 = Executing Trader
17 ExecID string Y Unique identifier of execution message as assigned by the Exchange.
527 SecondaryExecID string N Unique identifier for executed fill as assigned by the Exchange(in a different format), an alphanumeric string of no more than 20 characters.
150 ExecType string Y Describes the specific Execution Report while OrdStatus <39> will always identify the current order status Valid values:
● 0 - New
● 4 - Canceled
● 5 - Replaced
● 8 - Rejected
● C - Expired
● F - Trade (partial fill or fill)
39 OrdStatus string Y Identifies current status of order. Valid values:
● 0 - New
● 1 - Partially filled
● 2 - Filled
● 4 - Cancelled
● 5 - Replaced
● 8 - Rejected
● C - Expired
103 OrdRejReason int N Code to identify the reason for order rejection.
378 ExecRestatement int N Code to identify reason for an ExecutionRpt <8> message sent with ExecType <150>=’Restated’ <D>. Valid values:
● 8 - Market (Exchange) Option
382 NoContraBrokers int N Number of repeating groups of contra brokers
>>375 ContraBroker string N Can be used to provide additional trade into by executing system. Required if NoContraBroker (382) is > 0.
1 Account string Y The Exchange user uuid which is the same as the one specify in Logon <A> message Username <553> field.
660 AcctIDSource int Y Uses to identify the source of the Account <1> code. Valid value: ● 99 - Other (custom or proprietary).
63 SettleType int Y Indicates order settlement period. Valid value:
● 0 - Regular
55 Symbol string Y Ticker symbol for Instrument to trade.
54 Side int Y Side of order. Valid values:
● 1 = Buy
● 2 = Sell
31 LastPx float C The price of this trade. Required if ExecType = TRADE (150=F)
32 LastQty float C The quantity bought / sold on this trade. Required if ExecType = TRADE (150=F)
854 QtyType int Y Type of quantity Valid values:
● 0 = Units (currency)
38 OrderQty float Y Quantity to trade.
40 OrdType int Y Order type. Valid values:
● 1 = Market
● 2 = Limit
59 TimeInForce int N Specifies how long the order remains in effect. Valid values:
● 0 - Day
● 1 - Good Till Cancel (GTC)
● 3 - Immediate or Cancel (IOC)
● 4 - Fill or Kill (FOK)
● 6 - Good Till Day (GTD)

NOTE: Exchange will convert to Day automatically if invalid value detected. For market orders TIF will be ignored.
126 ExpireTime timestamp C Date/time of order expiration (UTC). Required if TimeInForce is GTD (59=6) and ExpireDate (432) is not present in the message.
432 ExpireDate timestamp C The date of order expiration (local market date). Required if TimeInForce is GTD (59=6) and ExpireTime (126) is not present in the message.
423 PriceType int C Code to represent the price type. Valid values:
● 2 = Per unit

Populated if at least one of the price fields is present.
44 Price float C Price per unit of quantity (e.g. per 1 BTC coin). Required if present on the order.
1057 AggressorIndicator boolean N Used to identify whether the order initiator is an aggressor or not in the trade.
● Y- Order initiator is aggressor
● N - Order initiator is passive
151 LeavesQty float Y Outstanding quantity for further execution.
14 CumQty float Y Total quantity filled.
6 AvgPx float Y Calculated average price of all fills on this order.
75 TradeDate string N Indicates date of trade(UTC) referenced in YYYYMMDD format.
60 TransactTime timestamp Y Time of execution/order creation in UTC i.e. yyyyMMdd-hh:mm:ss:xxx
381 GrossTradeAmt float N Total amount traded (e.g. CumQty <14> * AvgPx <6>) expressed in units of currency.
119 SettlCurrAmt float Y Total amount due expressed in settlement currency.
120 SettlCurrency string Y Currency code of settlement denomination. Valid values e.g.:
● USD
● USDT
155 SettlCurrFxRate float N Foreign exchange rate used to compute SettlCurrAmt (119) from Currency (15) to SettlCurrency (120)
156 SettlCurrFxRateCalc char N Specifies whether or not SettlCurrFxRate (155) should be multiplied or divided. Valid values:
● M=Multiply
● D=Divide
110 MinQty float N Minimum quantity of the order to be executed.
111 MaxFloor float N Maximum quantity within the order to tbe shown on the exchange at any given time.
136 NoMiscFee int N Number of repeating groups of miscellaneous fees.
>>137 MiscFeeAmt float C Miscellaneous fee value. Required if NoMiscFees > 0 and must be the first field in this group.
>>138 MiscFeeCurr string N Currency of miscellaneous fee. Valid values e.g.:
● USD
● USDT
>>139 MiscFeeType int N Indicates type of miscellaneous fee. Valid value:
● 7=Other
797 CopyMsgIndicator boolean N Indicates whether or not this message is a drop copy of another message.
58 Text string Y providing supplemental information on the order.
Standard trailer Y

Order Cancel Reject <9>

Example

8=FIX.4.4 9=217 35=9 49=OSL 56=<TargetCompID> 34=360993 52=20210902-07:01:17.971 37=NONE 11=<ClOrderID> 41=<OrigClOrdID> 39=4 434=1 102=0 58=MarketGrid ResultCode: 22215 (ErrorParam: 0) [101] 10=232

When an order cancellation or order replacement fails, the system will send this message.

Tag Field Name Data Type Req’d Comments
Standard header - Outgoing Y MsgType (35) = 9
11 ClOrdID string Y Unique identifier of the order as assigned by client.
41 OrigClOrdID string Y ClOrdID <11> of the existing order that the replace/cancel request want to execute.
37 OrderID string N Unique identifier for Order as assigned by the Exchange.
39 OrdStatus string Y Identifies current status of order. Valid values:
● 0 - New
● 1 - Partially filled
● 2 - Filled
● 4 - Cancelled
● 5 - Replaced
● 8 - Rejected
● C - Expired
102 CxlRejReason int N Code to identify reason for canceling rejection. Valid values:
● 0 = Too late to cancel
58 Text string Y providing supplemental information on reject reason.
Standard trailer Y

Market Data

This section describes the message flow for the Exchange market data distribution functionality.

Implementation Notes

There is no unique market data entry ID available. Users will be required to key market data entries on price and symbol when taking into account the market data entry repeating groups.

Market Data Request <V>

Tag Field Name Data Type Req’d Comments
Standard header - Outgoing Y MsgType (35) = V
262 MDReqID string N Unique identifier for Market Data Request.
263 SubscriptionRequestType int Y Indicates to the other party what type of response is expected. Valid values:
● 0 = Snapshot
● 1 = Snapshot + Updates (Subscribe)
● 2 = Disable previous Snapshot + Update Request (Unsubscribe)
264 MarketDepth int Y Depth of market for Book Snapshot Valid values:
● 0 - full market depth
● 1 - top of book
● > 1 - report best N price tiers of the book
265 MDUpdateType int C Specifies the type of Market Data update Valid values:
● 0 = Full Refresh
● 1 = Incremental Refresh

Required when SubscriptionRequestType (263) equals 1 (Snapshot plus Updates).
267 NoMDEntryTypes int Y Specifies the number of repeating MDEntryType <269> entries.
>>269 MDEntryType char Y Entries that the firm requesting the Market Data is interested in receiving. There can be multiple fields, as defined by field 267 Valid values:
● 0 = Bid
● 1 = Offer
● 2 = Trade
● 4 = Opening Price
● 5 = Closing Price
● 7 = Trading Session High Price
● 8 = Trading Session Low Price
● B = Trade Volume
146 NoRelatedSym int Y Specifies the number of repeating Symbol <55> tags.
>>55 Symbol string Y e.g. BTCUSD.
Standard trailer Y

Market Data - Snapshot/Full Refresh <W>

Tag Field Name Data Type Req’d Comments
Standard header - Outgoing Y MsgType (35) = W
262 MDReqID string Y Unique identifier for Market Data Request
55 Symbol string Y e.g. BTCUSD
268 NoMDEntries int Y Number of repeating groups following
>>54 Side Int N When MDEntryType(269) = 2(trade), this tag will appear.
>>269 MDEntryType char Y Entries that the firm requesting the Market Data is interested in receiving. There can be multiple fields, as defined by field 267 Valid values:
● 0 = Bid
● 1 = Offer
● 2 = Trade
● 4 = Opening Price
● 5 = Closing Price
● 7 = Trading Session High Price
● 8 = Trading Session Low Price
● B = Trade Volume
>>270 MDEntryPx price C Price of the Market Data Entry. Required when MDEntryType (269) is not Trade Volume (B).
>>271 MDEntrySize int C Number of units available (or the maximum trade size) at the time the market data snapshot was generated. Required when MDEntryType (269) is Bid (0), Offer (1), Trade (2) or Trade Volume (B).
>>272 MDEntryDate timestamp N UTC date of rate data i.e. yyyyMMdd.
>>273 MDEntryTime timestamp N UTC time of rate data.
>>336 TradingSessionID string Y Identifier for Trading Session Valid values:
● OPEN
>>346 NumberOfOrders int C Number of orders in the market where MDEntryType (269) is Bid (0) or Offer (1).
>>290 MDEntryPositionNo int C Display position of a bid or offer, numbered from most competitive to least competitive where MDEntryType (269) is Bid (0) or Offer (1).
Standard trailer Y

Market Data – Incremental Refresh <X>

Market Data – Incremental Refresh

Tag Field Name Data Type Req’d Comments
Standard header - Outgoing Y MsgType (35) = X
262 MDReqID string Y Unique identifier for Market Data Request
268 NoMDEntries int Y Number of repeating groups following
>>54 Side Int N When MDEntryType(269) = 2(trade), this tag is appeared to indicate if the trade aggressor Valid values:
● 1 = Buy
● 2 = Sell
>>279 MDUpdateAction int Y Type of Market Data update action Valid values:
● 0 = New
● 1 = Change
● 2 = Delete
>>269 MDEntryType char Y Entries that the firm requesting the Market Data is interested in receiving. There can be multiple fields, as defined by field 267 Valid values:
● 0 = Bid
● 1 = Offer
● 2 = Trade
● 4 = Opening Price
● 5 = Closing Price
● 7 = Trading Session High Price
● 8 = Trading Session Low Price
● B = Trade Volume
>>55 Symbol string C e.g. BTCUSD - the instrument is identified only for first market data entry.
>>270 MDEntryPx price C Price of the Market Data Entry. Required when MDEntryType (269) is not Trade Volume (B).
>>271 MDEntrySize int C Number of units available (or the maximum trade size) at the time the market data snapshot was generated. Required when MDEntryType (269) is Bid (0), Offer (1), Trade (2) or Trade Volume (B).
>>272 MDEntryDate timestamp N UTC date of rate data i.e. yyyyMMdd.
>>273 MDEntryTime timestamp N UTC time of rate data.
>>346 NumberOfOrders int C Number of orders in the market where MDEntryType (269) is Bid (0) or Offer (1).
>>290 MDEntryPositionNo int C Display position of a bid or offer, numbered from most competitive to least competitive where MDEntryType (269) is Bid (0) or Offer (1).
Standard trailer Y

Market Data – Market Data Request Reject <Y>

Market Data Request Reject

Tag Field Name Data Type Req’d Comments
Standard header - Outgoing Y MsgType (35) = Y
262 MDReqID string Y Unique identifier for Market Data Request.
281 MDReqRejReason char Y Reason for a Market Data request rejection. Valid values:
● 0 = Unknown symbol
● 1 = Duplicate MDReqID <262>
● 4 = Unsupported Subscription Request Type
Standard trailer Y

Drop Copy

This section describes the message flow for the Exchange drop copy functionality. FIX drop copy is designed to deliver real-time information about trading activity taking place at the Exchange and about order activity when orders are entered, modified, canceled or executed.

Two subscription types are available:

Error Codes

Code Error Name Description
1002 SystemSuspended System is suspended
1106 UsermanagerSuspended User is suspended
1192 SessionError Session error
19087 InvalidOrder Order is invalid
20002 OrderInvalidSide Order get rejected with invalid side
20003 OrderInvalidType Order get rejected with invalid type
20004 OrderInvalidPrice Order get rejected with invalid price
20005 OrderInvalidQuantity Order get rejected with invalid quantity
20007 OrderInvalidExpiryDate Order get rejected with invalid expiry date
20008 OrderInvalidExpiryTime Order get rejected with invalid expiry time
20009 OrderInvalidPriceStep Order get rejected with invalid price step
20015 OrderUserSuspended Order get rejected with user being suspended
20024 OrderInsufficientHoldings Order get rejected with insufficient holdings
20025 OrderNoHoldings Order get rejected with no holidings
20026 OrderQuantityTooSmall Order get rejected with quantity smaller than the minimum quantity
20027 OrderQuantityTooLarge Order get rejected with quantity larger than the maximum quantity
20031 OrderInsufficientCash Order get rejected with insufficient Cash
20032 OrderInvalidCurrency Order get rejected with invalid currency
20033 OrderInvalidSettlementCurrency Order get rejected with invalid settlement currency
20062 OrderValueTooSmall Order value cannot be too small
20063 OrderValueTooLarge Order value cannot be too large
20066 OrderInvalidQuantityStep Order get rejected with invalid quantity step
20088 OrderInstrumentmarketClosed Order get rejected because instrument market is closed
20115 OrderPriceZero Order price cannot be zero
20116 OrderPriceNegative Order price cannot be negative
20117 OrderPriceTooLow Order price cannot be too low
20118 OrderPriceTooHigh Order price cannot be too high
20132 It relates to an "immediate" order like a market or FOK that could not be matched (so is rejected) The Market/FOK order get rejected because there is no orders on the order book to match with.
22213 OrderStatusSetNoCancelMatched Order matched, cancel not allowed
22215 OrderStatusSetNoCancelCancelled Order cancelled, cancel not allowed
22301 OrderAmendNotAvailable Failed to amend an order which has already filled