Introduction
API Version
The base URL for production is
https://api.quoine.com/
. All responses are in JSON format with the following status codes:
HTTP 200: OK
Response is correct. The body of the response will
include the data requested.
HTTP 400: Bad Request
There was an error with the request. The body of the response will have more info
HTTP 401: Unauthorized
Token is invalid. If your API key is wrong a 401 will also be served,
so check the response body, it might be that the API_KEY is invalid.
HTTP 422: Unprocessable Entity
There was an error with the request. The body of the response will have more info. Some possible reasons:
- Missing params
- The format of data is wrong
HTTP 429: Too Many Requests
This status indicates that the user has sent too many requests in a given amount of time
HTTP 503: Service Unavailable
Many reasons, body will include details
- An internal error on Authy.
- Your application is accessing an API call you don't have access too.
- API usage limit. If you reach API usage limits a 503 will be returned,
please wait until you can do the call again.
The current API version is 2. Please include the following header in the request to get correct API behaviors.
Header | Value |
---|---|
X-Quoine-API-Version | 2 |
API Version 1 documentation can still be found here. If you are a V1 user, we recommend upgrade to V2 as soon as possible.
Vendor ID
Some response fields are made available only to vendor user. Please specify your vendor ID if you have one
Header | Value |
---|---|
X-Quoine-Vendor-ID | Your Vendor ID |
Rate Limiting
API users should not make more than 300 requests per 5 minute. Requests go beyond the limit will return with a 429 status
Authentication
require 'uri'
require 'net/http'
require 'time'
require 'jwt'
uri = URI.parse("https://api.quoine.com")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
token_id = 'YOUR_API_TOKEN_ID'
user_secret = 'YOUR_API_SECRET'
path = '/orders?product_id=1'
auth_payload = {
path: path,
nonce: DateTime.now.strftime('%Q'),
token_id: token_id
}
signature = JWT.encode(auth_payload, user_secret, 'HS256')
request = Net::HTTP::Get.new(path)
request.add_field('X-Quoine-API-Version', '2')
request.add_field('X-Quoine-Auth', signature)
request.add_field('Content-Type', 'application/json')
response = http.request(request)
Authentication requires 2 parameters: API Token ID
and API Secret
. These parameters can be obtained from
API Setting page
We use JSON Web Token open standard for Authentication:
First you need to build an auth payload, which includes the following parameters:
Auth Payload Parameters:
Parameters | Optional? | Description |
---|---|---|
path | request path, e.g /orders?product_id=1 |
|
nonce | a strictly increasing number, uniquely created for each request. We recommend using a millisecond timestamp at the time of making request, e.g 1459142524488 |
|
token_id | Token ID |
After constructing the auth payload, you need to sign it with your secret using HMAC-SHA256 (HS256).
JWT.encode(auth_payload, user_secret, 'HS256')
You can choose to manually sign by following JWT specs. But we highly recommend using a JWT library, which is available in a wide range of programming languages.
Request Header:
Parameters | Optional? | Description |
---|---|---|
X-Quoine-Auth | Signature obtained from signing the Auth Payload |
Types
Timestamps
1457974024 (for 2016-03-14T16:47:04 in ISO 8601)
Unless otherwise specified, all timestamps from API are returned in Unix Time.
Numbers
- Decimal numbers are returned as strings to avoid floating precision errors.
- Integer numbers (including IDs) are unquoted.
Errors
Due to legacy reason, there are 2 type of error responses:
Message
{
"message": "missing parameters"
}
The message will be in the requester default language. For public api, please request with HTTP_ACCEPT_LANGUAGE header set to your preferred language
Code
Code with the following structure will be returned
{ “errors”: {“object”: [“errors list”]} }
{
"errors": {"user":["not_enough_fund"]}
}
Pagination
{
"models": [ "<json objects>" ],
"current_page": "<current page>",
"total_pages": "<number of pages>"
}
Unless otherwise specified, all API requesting lists will be paginated with the following format:
I. Public API
Products
Get Products
GET /products
[
{
"id": 5,
"product_type": "CurrencyPair",
"code": "CASH",
"name": "CASH Trading",
"market_ask": "48203.05",
"market_bid": "48188.15",
"indicator": -1,
"currency": "JPY",
"currency_pair_code": "BTCJPY",
"symbol": "¥",
"fiat_minimum_withdraw": "1500.0",
"pusher_channel": "product_cash_btcjpy_5",
"taker_fee": "0.0",
"maker_fee": "0.0",
"low_market_bid": "47630.99",
"high_market_ask": "48396.71",
"volume_24h": "2915.627366519999999998",
"last_price_24h": "48217.2",
"last_traded_price": "48203.05",
"last_traded_quantity": "1.0",
"quoted_currency": "JPY",
"base_currency": "BTC",
"exchange_rate": "0.009398151671149725"
},
...
]
Get the list of all available products.
Get a Product
GET /products/:id
{
"id": 5,
"product_type": "CurrencyPair",
"code": "CASH",
"name": "CASH Trading",
"market_ask": "48203.05",
"market_bid": "48188.15",
"indicator": -1,
"currency": "JPY",
"currency_pair_code": "BTCJPY",
"symbol": "¥",
"fiat_minimum_withdraw": "1500.0",
"pusher_channel": "product_cash_btcjpy_5",
"taker_fee": "0.0",
"maker_fee": "0.0",
"low_market_bid": "47630.99",
"high_market_ask": "48396.71",
"volume_24h": "2915.62736652",
"last_price_24h": "48217.2",
"last_traded_price": "48203.05",
"last_traded_quantity": "1.0",
"quoted_currency": "JPY",
"base_currency": "BTC",
"exchange_rate": "0.009398151671149725"
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Product ID |
Get Order Book
GET /products/:id/price_levels
{
"buy_price_levels": [
["416.23000", "1.75000"], ...
],
"sell_price_levels": [
["416.47000", "0.28675"], ...
]
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Product ID | |
full | yes | 1 to get all price levels (default is 20 each side) |
Format
- Each price level follows: [
price
,amount
]
Executions
Get Executions
GET /executions?product_id=1&limit=2&page=2
Success Response:
{
"models": [
{
"id": 1011880,
"quantity": "6.118954",
"price": "409.78",
"taker_side": "sell",
"created_at": 1457370745
},
{
"id": 1011791,
"quantity": "1.15",
"price": "409.12",
"taker_side": "sell",
"created_at": 1457365585
}
],
"current_page": 2,
"total_pages": 1686
}
Get a list of recent executions from a product (Executions are sorted in DESCENDING order - Latest first)
Parameters | Optional? | Description |
---|---|---|
product_id | Product ID | |
limit | yes | How many executions should be returned. Must be <= 1000. Default is 20 |
page | yes | From what page the executions should be returned, e.g if limit=20 and page=2, the response would start from the 21st execution. Default is 1 |
Get Executions by Timestamp
GET /executions?product_id=1×tamp=1430630863&limit=2
Success Response:
[
{
"id": 960598,
"quantity": "5.6",
"price": "431.89",
"taker_side": "buy",
"created_at": 1456705487
},
{
"id": 960603,
"quantity": "0.06",
"price": "431.74",
"taker_side": "buy",
"created_at": 1456705564
}
]
Get a list of executions after a particular time (Executions are sorted in ASCENDING order)
Parameters | Optional? | Description |
---|---|---|
currency_pair_code | e.g. BTCJPY | |
timestamp | Only show executions at or after this timestamp (Unix timestamps in seconds) | |
limit | yes | How many executions should be returned. Must be <= 1000. Default is 20 |
Interest Rates
Get Interest Rate Ladder for a currency
Format
- Each level follows: [
rate
,amount
]
GET /ir_ladders/USD
{
"bids": [
[
"0.00020",
"23617.81698"
],
[
"0.00040",
"50050.42000"
],
[
"0.00050",
"100000.00000"
]
],
"asks": []
}
II Authenticated API
All requests to Authenticated endpoints must be properly signed as shown in Authentication,
Orders
Create an Order
POST /orders/
{
"order": {
"order_type": "limit",
"product_id": 1,
"side": "sell",
"quantity": "0.01",
"price": "500.0"
}
}
Success Response:
{
"id": 2157474,
"order_type": "limit",
"quantity": "0.01",
"disc_quantity": "0.0",
"iceberg_total_quantity": "0.0",
"side": "sell",
"filled_quantity": "0.0",
"price": "500.0",
"created_at": 1462123639,
"updated_at": 1462123639,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": 1,
"product_code": "CASH",
"funding_currency": "USD",
"currency_pair_code": "BTCUSD",
"order_fee": "0.0",
"margin_used": "0.0",
"margin_interest": "0.0",
"unwound_trade_leverage_level": null,
}
Parameters
Parameters | Optional? | Description |
---|---|---|
order_type | limit , market or market_with_range |
|
product_id | Product ID | |
side | buy or sell |
|
quantity | quantity to buy or sell | |
price | price per unit of cryptocurrency | |
price_range | true | For order_type of market_with_range only, slippage of the order. |
Margin Order Parameters
Parameters | Optional? | Description |
---|---|---|
leverage_level | Valid levels: 2,4,5,10,25 | |
funding_currency | Currency used to fund the trade with. Default is quoted currency (e.g a trade in BTCUSD product will use USD as the funding currency as default) | |
order_direction | true | one_direction , two_direction or netout . |
Response Parameters
Parameters | Optional? | Description |
---|---|---|
status | live , filled , partially_filled , cancelled |
|
filled_quantity | the amount that has been filled |
Get an Order
GET /orders/:id
Success Response
{
"id": 2157479,
"order_type": "limit",
"quantity": "0.01",
"disc_quantity": "0.0",
"iceberg_total_quantity": "0.0",
"side": "sell",
"filled_quantity": "0.01",
"price": "500.0",
"created_at": 1462123639,
"updated_at": 1462123639,
"status": "filled",
"leverage_level": 2,
"source_exchange": "QUOINE",
"product_id": 1,
"product_code": "CASH",
"funding_currency": "USD",
"currency_pair_code": "BTCUSD",
"order_fee": "0.0",
"margin_used": "0.0",
"margin_interest": "0.0",
"unwound_trade_leverage_level": null,
"executions": [
{
"id": 4566133,
"quantity": "0.01",
"price": "500.0",
"taker_side": "buy",
"my_side": "sell",
"created_at": 1465396785
}
]
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Order ID |
Get Orders
GET /orders?funding_currency=:currency&product_id=:product_id&status=:status&with_details=1
Success Response
{
"models": [
{
"id": 2157474,
"order_type": "limit",
"quantity": "0.01",
"disc_quantity": "0.0",
"iceberg_total_quantity": "0.0",
"side": "sell",
"filled_quantity": "0.0",
"price": "500.0",
"created_at": 1462123639,
"updated_at": 1462123639,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": 1,
"product_code": "CASH",
"funding_currency": "USD",
"currency_pair_code": "BTCUSD",
"unwound_trade_leverage_level": null,
"order_fee": "0.0",
"margin_used": "0.0",
"margin_interest": "0.0",
*
"executions": []
*
}
],
"current_page": 1,
"total_pages": 1
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
funding_currency | yes | filter orders based on funding currency |
product_id | yes | filter orders based on product |
status | yes | filter orders based on status |
with_details | yes | return full order details (attributes between *) including executions if set to 1 |
Cancel an Order
PUT /orders/:id/cancel
Success Response
{
"id": 2157474,
"order_type": "limit",
"quantity": "0.01",
"disc_quantity": "0.0",
"iceberg_total_quantity": "0.0",
"side": "sell",
"filled_quantity": "0.0",
"price": "500.0",
"created_at": 1462123639,
"updated_at": 1462123639,
"status": "cancelled",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": 1,
"product_code": "CASH",
"funding_currency": "USD",
"currency_pair_code": "BTCUSD"
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Order ID |
Edit a Live Order
PUT /orders/:id
{
"order": {
"quantity": "0.02",
"price": "520.0"
}
}
Success Response:
{
"id": 2157474,
"order_type": "limit",
"quantity": "0.02",
"disc_quantity": "0.0",
"iceberg_total_quantity": "0.0",
"side": "sell",
"filled_quantity": "0.0",
"price": "520.0",
"created_at": 1462123639,
"updated_at": 1462123639,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": 1,
"product_code": "CASH",
"funding_currency": "USD",
"currency_pair_code": "BTCUSD"
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Order ID |
Get an Order’s Trades
GET /orders/:id/trades
Success Response:
[
{
"id": 57896,
"currency_pair_code": "BTCUSD",
"status": "closed",
"side": "short",
"margin_used": "0.83588",
"open_quantity": "0.01",
"close_quantity": "0.0",
"quantity": "0.01",
"leverage_level": 5,
"product_code": "CASH",
"product_id": 1,
"open_price": "417.65",
"close_price": "417.0",
"trader_id": 3020,
"open_pnl": "0.0",
"close_pnl": "0.0065",
"pnl": "0.0065",
"stop_loss": "0.0",
"take_profit": "0.0",
"funding_currency": "USD",
"created_at": 1456250726,
"updated_at": 1456251837,
"close_fee": "0.0",
"total_interest": "0.02",
"daily_interest": "0.02"
}
]
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Order ID |
Get an Order’s Executions
GET /orders/:id/executions
Success Response:
{
"models": [
{
"id": 1206374,
"quantity": 2,
"price": 910.1872,
"taker_side": "buy",
"created_at": 1483943148
}
],
"current_page": 1,
"total_pages": 1
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Order ID | |
limit | Limit execution per request | |
page | Page |
Executions
Get Your Executions
GET /executions/me?product_id=:product_id
Success Response
{
"models": [
{
"id": 1001232,
"quantity": "0.37153179",
"price": "390.0",
"taker_side": "sell",
"my_side": "sell",
"created_at": 1457193798
}
],
"current_page": 1,
"total_pages": 2
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
product_id | Product ID |
Accounts
Get Fiat Accounts
GET /fiat_accounts
Success Response
[
{
"id": 4695,
"currency": "USD",
"currency_symbol": "$",
"balance": "10000.1773",
"pusher_channel": "user_3020_account_usd",
"lowest_offer_interest_rate": "0.00020",
"highest_offer_interest_rate": "0.00060",
"exchange_rate": "1.0",
"currency_type": "fiat",
"margin": "0.0",
"free_margin": "10000.1773"
}
]
Create a Fiat Account
POST /fiat_accounts
{
"currency": "USD",
}
Success Response
{
"id": 5595,
"currency": "USD",
"currency_symbol": "$",
"balance": "0.0",
"pusher_channel": "user_3122_account_usd",
"lowest_offer_interest_rate": "0.00020",
"highest_offer_interest_rate": "0.00060",
"exchange_rate": "1.0",
"currency_type": "fiat",
"margin": "0.0",
"free_margin": "0.0"
}
Get Crypto Accounts
GET /crypto_accounts
Success Response
[
{
"id": 4668,
"balance": "4.99",
"address": "1F25zWAQ1BAAmppNxLV3KtK6aTNhxNg5Hg",
"currency": "BTC",
"currency_symbol": "฿",
"pusher_channel": "user_3020_account_btc",
"minimum_withdraw": 0.02,
"lowest_offer_interest_rate": "0.00049",
"highest_offer_interest_rate": "0.05000",
"currency_type": "crypto"
}
]
Get all Account Balances
GET /accounts/balance
Success Response
[
{
"currency": "BTC",
"balance": "0.04925688"
},
{
"currency": "USD",
"balance": "7.17696"
},
{
"currency": "JPY",
"balance": "356.01377"
}
]
Get Main Asset
GET /accounts/main_asset
Success Response
{
"currency": "JPY",
"total_amount": "23050.04"
}
Assets Lending
Create a loan bid
POST /loan_bids
{
"loan_bid": {
"quantity": "50",
"currency": "USD",
"rate": "0.0002"
}
}
Success Response
{
"id": 3580,
"bidask_type": "limit",
"quantity": "50.0",
"currency": "USD",
"side": "bid",
"filled_quantity": "0.0",
"status": "live",
"rate": "0.0002",
"user_id": 3020
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
rate | daily interest rate, e.g 0.0002 (0.02%), must be <= 0.07% | |
quantity | amount to lend | |
currency | lending currency (all available in the system except JPY) |
Get loan bids
GET /loan_bids?currency=:currency
Success Response
{
"models": [
{
"id": 3580,
"bidask_type": "limit",
"quantity": "50.0",
"currency": "USD",
"side": "bid",
"filled_quantity": "0.0",
"status": "live",
"rate": "0.0007",
"user_id": 3020
}
],
"current_page": 1,
"total_pages": 1
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
currency | yes | filter loan bids by lending currency |
Close loan bid
PUT /loan_bids/:id/close
Success Response:
{
"id": 3580,
"bidask_type": "limit",
"quantity": "50.0",
"currency": "USD",
"side": "bid",
"filled_quantity": "0.0",
"status": "closed",
"rate": "0.0007",
"user_id": 3020
}
Parameters | Optional? | Description |
---|---|---|
id | loan bid ID |
Get Loans
GET /loans?currency=JPY
Success Response
{
"models": [
{
"id": 144825,
"quantity": "495.1048",
"rate": "0.0005",
"created_at": 1464168246,
"lender_id": 312,
"borrower_id": 5712,
"status": "open",
"currency": "JPY",
"fund_reloaned": true
}
],
"current_page": 1,
"total_pages": 1
}
Update a Loan
PUT /loans/144825
{
"loan": {
"fund_reloaned": false
}
}
Success Response
{
"id": 144825,
"quantity": "495.1048",
"rate": "0.0005",
"created_at": 1464168246,
"lender_id": 312,
"borrower_id": 5712,
"status": "open",
"currency": "JPY",
"fund_reloaned": false
}
Trading Accounts
Get Trading Accounts
GET /trading_accounts
Success Response
[
{
"id": 1759,
"leverage_level": 10,
"max_leverage_level": 10,
"pnl": "0.0",
"equity": "10000.1773",
"margin": "4.2302",
"free_margin": "9995.9471",
"trader_id": 4807,
"status": "active",
"product_code": "CASH",
"currency_pair_code": "BTCUSD",
"position": "0.1",
"balance": "10000.1773",
"created_at": 1421992165,
"updated_at": 1457242996,
"pusher_channel": "trading_account_1759",
"margin_percent": "0.1",
"product_id": 1,
"funding_currency": "USD",
"base_open_price": 0,
"long_summary": {
"pnl": "0.0",
"position": "0.0",
"base_open_price": "0.0"
},
"short_summary": {
"pnl": "0.0",
"position": "0.0",
"base_open_price": "0.0"
}
},
...
]
Get a Trading Account
GET /trading_accounts/:id
Success Response
{
"id": 1759,
"leverage_level": 10,
"max_leverage_level": 10,
"pnl": "0.0",
"equity": "10000.1773",
"margin": "4.2302",
"free_margin": "9995.9471",
"trader_id": 4807,
"status": "active",
"product_code": "CASH",
"currency_pair_code": "BTCUSD",
"position": "0.1",
"balance": "10000.1773",
"created_at": 1421992165,
"updated_at": 1457242996,
"pusher_channel": "trading_account_1759",
"margin_percent": "0.1",
"product_id": 1,
"funding_currency": "USD"
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Trading Account ID |
Update Leverage Level
PUT /trading_accounts/:id
{
"trading_account": {
"leverage_level": 25
}
}
Success Response
{
"id": 1759,
"leverage_level": 25,
"max_leverage_level": 25,
"pnl": "0.0",
"equity": "10000.1773",
"margin": "4.2302",
"free_margin": "9995.9471",
"trader_id": 4807,
"status": "active",
"product_code": "CASH",
"currency_pair_code": "BTCUSD",
"position": "0.1",
"balance": "10000.1773",
"created_at": 1421992165,
"updated_at": 1457242996,
"pusher_channel": "trading_account_1759",
"margin_percent": "0.1",
"product_id": 1,
"funding_currency": "USD"
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Trading account ID | |
leverage_level | New leverage level |
Trades
Get Trades
GET /trades?funding_currency=:funding_currency&status=:status
Success Response
{
"models": [
{
"id": 57896,
"currency_pair_code": "BTCUSD",
"status": "open",
"side": "short",
"margin_used": "0.83588",
"open_quantity": "0.01",
"close_quantity": "0.0",
"quantity": "0.01",
"leverage_level": 5,
"product_code": "CASH",
"product_id": 1,
"open_price": "417.65",
"close_price": "417.0",
"trader_id": 3020,
"open_pnl": "0.0",
"close_pnl": "0.0",
"pnl": "0.0065",
"stop_loss": "0.0",
"take_profit": "0.0",
"funding_currency": "USD",
"created_at": 1456250726,
"updated_at": 1456251837,
"close_fee": "0.0",
"total_interest": "0.02",
"daily_interest": "0.02"
},
...
],
"current_page": 1,
"total_pages": 1
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
funding_currency | yes | get trades of a particular funding currency |
status | yes | open or closed |
Close a trade
PUT /trades/:id/close
Success Response:
{
"id": 57896,
"currency_pair_code": "BTCUSD",
"status": "closed",
"side": "short",
"margin_used": "0.83588",
"open_quantity": "0.01",
"close_quantity": "0.0",
"quantity": "0.01",
"leverage_level": 5,
"product_code": "CASH",
"product_id": 1,
"open_price": "417.65",
"close_price": "417.0",
"trader_id": 3020,
"open_pnl": "0.0",
"close_pnl": "0.0065",
"pnl": "0.0065",
"stop_loss": "0.0",
"take_profit": "0.0",
"funding_currency": "USD",
"created_at": 1456250726,
"updated_at": 1456251837,
"close_fee": "0.0",
"total_interest": "0.02",
"daily_interest": "0.02"
}
Parameters:
Parameters | Optional? | Description |
---|---|---|
id | Trade ID | |
closed_quantity | yes | The quantity you want to close |
Close all trade
PUT /trades/close_all
{
"side": "short"
}
Success Response:
[
{
"id": 57896,
"currency_pair_code": "BTCUSD",
"status": "closed",
"side": "short",
"margin_used": "0.83588",
"open_quantity": "0.01",
"close_quantity": "0.0",
"quantity": "0.01",
"leverage_level": 5,
"product_code": "CASH",
"product_id": 1,
"open_price": "417.65",
"close_price": "417.0",
"trader_id": 3020,
"open_pnl": "0.0",
"close_pnl": "0.0065",
"pnl": "0.0065",
"stop_loss": "0.0",
"take_profit": "0.0",
"funding_currency": "USD",
"created_at": 1456250726,
"updated_at": 1456251837,
"close_fee": "0.0",
"total_interest": "0.02",
"daily_interest": "0.02"
}
]
Parameters:
Parameters | Optional? | Description |
---|---|---|
side | yes | Close all trades of this side. Close trades of both side if left blank |
Update a trade
PUT /trades/:id
{
"trade": {
"stop_loss": "300",
"take_profit": "600"
}
}
Success Response:
{
"id": 57897,
"currency_pair_code": "BTCUSD",
"status": "open",
"side": "short",
"margin_used": "0.83588",
"open_quantity": "0.01",
"close_quantity": "0.0",
"quantity": "0.01",
"leverage_level": 5,
"product_code": "CASH",
"product_id": 1,
"open_price": "417.65",
"close_price": "0",
"trader_id": 3020,
"open_pnl": "0.0",
"close_pnl": "0.0065",
"pnl": "0.0065",
"stop_loss": "300.0",
"take_profit": "600.0",
"funding_currency": "USD",
"created_at": 1456250726,
"updated_at": 1456251837,
"close_fee": "0.0",
"total_interest": "0.02",
"daily_interest": "0.02"
}
Parameters | Optional? | Description |
---|---|---|
id | Trade ID | |
stop_loss | Stop Loss price | |
take_profit | Take Profit price |
Get a trade’s loans
GET /trades/:id/loans
Success Response:
[
{
"id": 103520,
"quantity": "42.302",
"rate": "0.0002",
"created_at": 1461998432,
"lender_id": 100,
"borrower_id": 3020,
"status": "open",
"currency": "USD",
"fund_reloaned": true
}
]
Parameters | Optional? | Description |
---|---|---|
id | Trade ID |
III. Notifications
Websocket
// Javascript Client Sample
// https://github.com/pusher/pusher-js
var pusher = new Pusher(PUSHER_KEY, {
wsHost: PUSHER_HOST,
wsPort: PUSHER_PORT,
enabledTransports: ["ws", "flash"],
disabledTransports: ["flash"]
});
var channel = pusher.subscribe('price_ladders_cash_btcusd_sell');
channel.bind('updated', function(data) {
// processing new data
}
);
Quoine uses Pusher for real time data streaming. Please check Pusher documentation and libraries on how to connect to our stream. You can also find an example for each stream below.
Please contact us for pusher key
One Product
- CHANNEL:
product_cash_[currency pair code]_[product id]
(e.g.product_cash_btcusd_1
) - EVENT:
updated
Order book:
- CHANNEL:
price_ladders_cash_[currency pair code]_[side]
(e.g.price_ladders_cash_btcjpy_sell
) - EVENT:
updated
Orders:
- CHANNEL:
user_[user id]_account_[funding currency]_orders
(e.g.user_1_account_usd_orders
) - EVENT:
updated
Executions:
- CHANNEL:
executions_cash_[currency pair code]
(e.g.executions_cash_btcjpy
) - EVENT:
created