× #message#
×

Warning

Exchange API Documentation

Our REST API can be used to fetch market data from Limitlex Exchange platform, as well as to manage trading activities: check balance, open/cancel orders, get trading and funding history.

Please note: Exchange API accepts GET and POST requests for public and POST requests for private calls.

You have to send HTTP parameters using application/x-www-form-urlencoded format.
More about POST requests here.

API endpoints are divided into two groups: public and private.

Public API functions are prefixed with /public/{method}, for example: https://limitlex.com/api/public/currencies

Private API functions use path prefixed with /private/{method}, for example: https://limitlex.com/api/private/cancel_order

Public API methods

Public methods are not related to a particular user, so you don't need to pass any API keys.

This is the list of public API calls:

  • /currencies
  • /pairs
  • /ticker
  • /ohlc
  • /order_book
  • /recent_trades

Private API methods

Private calls are intended to manage trading activities and they require you to send additional data to execute operations.

Keys can be generated in the user profile:
My Account > Profile > Exchange API Key.

To perform a private API request, you need to have following:

  1. API user public identifier attached to 'API-Key' header.
  2. Nonce in the body of the request.
  3. Signature of the request stored in 'API-Sign' header.

Nonce is a Unix timestamp, that must be appended to the body of each request, and must not be older than 30 seconds.

You also need to provide the signature, so we can make sure that your request has not been malformed.

The signature must follow ASN.1 format.
The method we are using is ECDSA (Elliptic Curve Digital Signature Algorithm) combined with SHA-512 hash algorithm.

Below are the steps you need to follow to create the signature for your request:

  1. Concatenate two strings:
  • String of API Function (for example: "/private/balance")
  • URL encoded parameters from the body of the request.
  1. Sign it with your private key using ECDSA algorithm with SHA512 digest.

A HTTP request should be structured as follows:

HTTP HEADERS:
API-Key: (PUBLIC KEY YOU GENERATED IN PROFILE)
API-Sign: ECDSA_SHA512_SIGN( API_FUNCTION + BODY_PARAMS_URL_ENCODED ) as BASE64

REQUEST BODY:
nonce=NONCE&param1=PARAM1&param2=PARAM2

At the bottom of this document you can find example of querying private endpoints in Node.js

List of private calls:

  • /balance
  • /open_orders
  • /trades
  • /add_order
  • /cancel_order
  • /cancel_all_orders
  • /order_status
  • /withdrawal
  • /deposit_addresses
  • /ledger
  • /blockchain_transactions
  • /websocket_token
  • /add_subaccount
  • /subaccounts
  • /subaccount_transfer
  • /subaccount_transactions

API request limitations

Every user has limited amount of allowed API calls per 10 seconds, 1 minute and 1 day.

These are limits by each interval in points:

Interval Cost
10 seconds 500 points
1 minute 1500 points
1 day 1000000 points

Also pay attention that each API endpoint request spends different amount of points:

Public Endpoint Cost
pairs 2
currencies 2
ticker 2
ohlc 5
order_book 5
recent_trades 10

 

Private Endpoint Cost
balance 2
open_orders 2
trades 10
add_order 10
cancel_order 10
cancel_all_orders 20
order_status 2
withdrawal 100
websocket_token 2
deposit_addresses 2
ledger 10
blockchain_transactions 10
add_subaccount 10
subaccounts 2
subaccount_transfer 10
subaccount_transactions 2

If you spend more points that you are allowed to spend you will get this message:

{
  "error": {
    "code": 5,
    "message": "rate limit exceeded"
  },
  "req_id": "9fd99389-2445-11eb-ba6f-0242ac120007"
}

Trading API provides X-Ratelimit response headers that can be inspected to check rate-limit points:

Header key Description
X-Ratelimit-Limit-10s Allowed points every 10 seconds
X-Ratelimit-Limit-1m Allowed points every minute
X-Ratelimit-Limit-1d Allowed points every day
X-Ratelimit-Used-10s Used points last 10 seconds
X-Ratelimit-Used-1m Used points last 1 minute
X-Ratelimit-Used-1d Used points last day

Example:

X-Ratelimit-Limit-10s: 500
X-Ratelimit-Limit-1m: 1500
X-Ratelimit-Limit-1d: 1000000
X-Ratelimit-Used-10s: 78
X-Ratelimit-Used-1m: 311
X-Ratelimit-Used-1d: 32974

Open orders limit

Also there is limit on open orders.

Make sure you are not holding more than 50 orders on all pairs at once, otherwise you will not able to open new orders.

This error is shown in this case:

{
  "error": {
    "code": 242,
    "message": "open orders limit exceeded"
  },
  "req_id": "a2e24a5e-240f-11eb-ba6f-0242ac120007"
}

Public methods reference

Get list of currencies: /currencies

This method does not accept any parameters.

{
  "result": {
    "data": [
      {
        "id": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "deposit_locked": false,
        "withdrawal_locked": false,
        "decimals": 8,
        "fiat": false,
        "name": "Bitcoin",
        "code": "BTC",
        "withdrawal_fee": "0.0005",
        "withdrawal_minimum": "0.002",
        "unified_cryptoasset_id": 1
      },
      {
        "id": "76d845ac-1e6a-4a1b-995b-762370e8c1cd",
        "deposit_locked": false,
        "withdrawal_locked": false,
        "decimals": 6,
        "fiat": false,
        "name": "Tether",
        "code": "USDT",
        "withdrawal_fee": "1.2",
        "withdrawal_minimum": "2",
        "unified_cryptoasset_id": 825
      }
    ]
  },
  "req_id": "9b1eca38-240e-11eb-a7ff-0242ac120007"
}

Get list of exchange pairs: /pairs

Parameter Required Description
pair_id No Specify exact pair
{
  "result": {
    "data": [
      {
        "id": "44567e46-d10c-4b99-bc82-4e2faca15234:76d845ac-1e6a-4a1b-995b-762370e8c1cd",
        "currency_id_1": "44567e46-d10c-4b99-bc82-4e2faca15234",
        "currency_id_2": "76d845ac-1e6a-4a1b-995b-762370e8c1cd",
        "locked": false,
        "decimals": 2,
        "min_amount_1": "0.00001",
        "min_amount_2": "10"
      },
      {
        "id": "ab651a43-1fc9-4163-a31b-74e5f537e82f:bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "currency_id_1": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "currency_id_2": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "locked": false,
        "decimals": 2,
        "min_amount_1": "0.000001",
        "min_amount_2": "2"
      }
    ]
  },
  "req_id": "07141172-240f-11eb-a7ff-0242ac120007"
}

Get tick data of the specified exchange pair: /ticker

Parameter Required Description
pair_id No Exchange pair
{
  "result": {
    "currency_id_1": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
    "currency_id_2": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
    "last_price": "8096.46",
    "volume_1": "4.58732267",
    "volume_2": "39044.90205",
    "high": "9041.70",
    "low": "7977.22",
    "open": "8002.50",
    "close": "8096.46",
    "change": "93.96",
    "percentage": "1.17",
    "bid": "7621.50",
    "ask": "8900.20"
  },
  "req_id": "a2e24a5e-240f-11eb-a7ff-0242ac120007"
}

OHLC (open-high-low-close) data for specific timeframe: /ohlc

Parameter Required Description
pair_id Yes Exchange pair
interval No Timeframe, default = M1
since No Timestamp from which ticks are returned
limit No Select amount of last ticks

Allowed timeframes/intervals are:

Value Timeframe
"1" M1
"3" M3
"5" M5
"15" M15
"30" M30
"60" H1
"120" H2
"240" H4
"480" H8
"720" H12
"900" H15
"1440" Daily
"10080" Weekly
"43200" Monthly
{
  "result": {
    "data": [
      {
        "time": "1605115140000000",
        "open": "8900.20",
        "high": "8900.20",
        "low": "8900.20",
        "close": "8900.20",
        "change": "0.00",
        "volume": "0.00000000"
      },
      {
        "time": "1605115200000000",
        "open": "8900.20",
        "high": "8900.20",
        "low": "8900.20",
        "close": "8900.20",
        "change": "0.00",
        "volume": "0.00000000"
      }
    ],
    "last": "1605115200000000"
  },
  "req_id": "31896df7-2442-11eb-ba6f-0242ac120007"
}

Order book: /order_book

Parameter Required Description
pair_id Yes Exchange pair
limit No Amount of nearest bids/asks (market depth)
{
  "result": {
    "date_created": "1605093768225498",
    "asks": [
      {
        "price": "8900.20",
        "amount_1": "0.00463156"
      },
      {
        "price": "9397.30",
        "amount_1": "0.01065689"
      }
    ],
    "bids": [
      {
        "price": "7621.50",
        "amount_1": "0.00447229"
      },
      {
        "price": "7621.20",
        "amount_1": "0.04686994"
      }
    ]
  },
  "req_id": "3a5de95d-2410-11eb-a7ff-0242ac120007"
}

Get recent trades: /recent_trades

Parameter Required Description
pair_id Yes Exchange pair
since No Unix timestamp in microseconds to list trades from
limit No Amount of last trades to return

Timestamp is an Unix timestamp in microseconds represented as an integer (The number of microseconds elapsed since January 1, 1970 UTC).

{
  "result": {
    "data": [
      {
        "trade_id": "8c080678-283d-4f60-a36a-aee99de2a4fd:52563e9b-1ae0-44ff-8d00-52c3ffa0dd72",
        "amount_1": "0.00001318",
        "amount_2": "0.11727",
        "price": "8898.10",
        "order_direction": "buy",
        "date_created": "1605084159321746"
      },
      {
        "trade_id": "3be66742-24d1-4c7c-aa32-e32e5b5814f5:0f29b35a-698c-4f02-b7e3-bae1347ae387",
        "amount_1": "0.00028770",
        "amount_2": "2.58638",
        "price": "8989.88",
        "order_direction": "buy",
        "date_created": "1605084165872574"
      }
    ],
    "last": "1605091626459102"
  },
  "req_id": "7d92c676-2415-11eb-a7ff-0242ac120007"
}

Private methods reference

Use HTTP POST nonce parameter and the parameters listed in the table at each private method below.

Subaccounts

A single main account can have multiple sub accounts associated with it.

Sub accounts allow for separate balances, orders, trades and transactions.

Your API credentials and rate limits are always associated with the main account.

You can create sub accounts by using the /add_subaccount endpoint.

The /subaccount_transfer endpoint makes it possible to transfer funds between the main account and the subaccount (but not between subaccounts).

See the sub account endpoints reference below for more details.

Balance on all wallets: /balance

Parameter Required Description
subaccount_id No Return balances of specified subaccount instead
{
  "result": {
    "data": [
      {
        "currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "amount_available": "560.49093",
        "amount_reserved": "83.96741"
      },
      {
        "currency_id": "76d845ac-1e6a-4a1b-995b-762370e8c1cd",
        "amount_available": "1173.84055900",
        "amount_reserved": "0.000000"
      }
    ]
  },
  "req_id": "76396a8c-241a-11eb-a7ff-0242ac120007"
}

List user's open orders: /open_orders

Parameter Required Description
pair_id Yes Pair on which orders are opened
subaccount_id No Return open orders of specified subaccount instead
{
  "result": {
    "data": [
      {
        "order_id": "f55bc6ee-b414-496c-8d88-514083529dc6",
        "order_direction": "buy",
        "amount_initial": "0.00031898",
        "amount_open": "0.00031898",
        "price": "8500.00",
        "date_created": "1605099779360546"
      },
      {
        "order_id": "64a72823-2728-4f13-a7b5-6fbb195e4e13",
        "order_direction": "sell",
        "amount_initial": "0.00500000",
        "amount_open": "0.00500000",
        "price": "9500.00",
        "date_created": "1605099828393383"
      }
    ]
  },
  "req_id": "587c9715-241e-11eb-a7ff-0242ac120007"
}

List user's trades: /trades

Parameter Required Description
pair_id Yes Pair on which trades were made
start No Unix timestamp in microseconds, return trades that are newer
end No Unix timestamp in microseconds, return trades that are older
limit No Count of last trades to return
subaccount_id No Return trades of specified subaccount instead
{
  "result": {
    "data": [
      {
        "currency_id_1": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "currency_id_2": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "trade_id": "c8eb54d9-ab19-4b40-88de-2700cdfbbc36:064e89bc-16c7-486b-a025-82ef5e5727d2",
        "order_id": "c8eb54d9-ab19-4b40-88de-2700cdfbbc36",
        "amount_1": "0.10000000",
        "amount_2": "200.00000",
        "price": "2000.00",
        "order_side": "taker",
        "order_direction": "sell",
        "order_trade_type": "market",
        "fee": "0.20000",
        "fee_currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "date_created": "1654085320827828"
      },
      {
        "currency_id_1": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "currency_id_2": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "trade_id": "7f74c674-032b-42cb-af1d-a172f5aad6f0:89cb3d7c-e43d-4722-8a70-5395f46c05cd",
        "order_id": "7f74c674-032b-42cb-af1d-a172f5aad6f0",
        "amount_1": "1.00000000",
        "amount_2": "3000.00000",
        "price": "3000.00",
        "order_side": "taker",
        "order_direction": "buy",
        "order_trade_type": "market",
        "fee": "0.00100000",
        "fee_currency_id": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "date_created": "1653914671856045"
      }
    ],
    "last": "1605084165872574"
  },
  "req_id": "7b081afd-241e-11eb-a7ff-0242ac120007"
}

Add new order: /add_order

Parameter Required Description
pair_id Yes Pair on which trade will be opened
order_direction Yes Trade direction: buy / sell
order_type Yes Order type: market / limit or stoplimit
price Yes Level at which order will be triggered
amount_1 Yes Volume of the position in currency_1
trigger_price No Price at which stoplimit order is triggerred
trigger_condition No "LTE" lower/equal OR "GTE" greater/equal
subaccount_id No Open order on specified subaccount instead

Stop limit and trigger condition explained

As of Limitlex API v.2 you have ability to open "stoplimit" order.

This type of order will be pending until condition becomes true.

When opening stoplimit order two additional parameters must be provided: trigger_price and trigger_condition.

Example:

{
  "pair_id": "ab651a43-1fc9-4163-a31b-74e5f537e82f:bfd04d06-b97c-4287-8bb0-c18f2eb19157",
  "order_direction": "sell",
  "order_type": "stoplimit", // notice order type
  "amount_1": "0.0003",
  "price": "9500",
  "trigger_condition": "GTE", // condition: when price is greater
  "trigger_price": "9490" // than this value
}
{
  "result": {
    "order_id": "5a18dda1-a469-46ce-83a3-7ee591e38992"
  },
  "req_id": "0a0fb9a2-241d-11eb-a7ff-0242ac120007"
}

Cancel limit order: /cancel_order

Parameter Required Description
pair_id Yes Pair on which order was created
order_id Yes ID of the order to close
subaccount_id No Cancel order of specified subaccount instead
{
  "result": {
    "success": true
  },
  "req_id": "ab135c32-241f-11eb-a7ff-0242ac120007"
}

Cancel all limit orders: /cancel_all_orders

Parameter Required Description
pair_id Yes ID of pair on which orders were created
direction No Filter orders to cancel by direction buy / sell / both (default)
subaccount_id No Cancel all orders of specified subaccount instead
{
  "result": {
    "success": true
  },
  "req_id": "fa3c7402-241f-11eb-a7ff-0242ac120007"
}

Check status of pending limit order: /order_status

Parameter Required Description
pair_id Yes Pair on which order was created
order_id Yes UUID of the order to check
subaccount_id No Check order of specified subaccount instead

Existing order statuses:

  • opened
  • closed
  • cancelled
  • failed
{
  "result": {
    "currency_id_1": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
    "currency_id_2": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
    "order_id": "1e91c2c8-fae3-4a39-8b7f-0c15f985926b",
    "order_type": "limit",
    "status": "opened",
    "price": "70000.00",
    "order_direction": "sell",
    "amount_1_completed": "0.00000000",
    "amount_1_initial": "0.10000000",
    "amount_2_completed": "0",
    "fee_completed": "0",
    "fee_currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
    "date_cancelled": null,
    "date_completed": null,
    "date_created": "1658823430879133"
  },
  "req_id": "5eb059ff-0cbb-11ed-83d7-3448edabbc07"
}

Withdrawal: /withdrawal

Parameter Required Description
currency_id Yes Currency being withdrawn
amount Yes Amount of money in selected currency
key Yes Withdrawal key, that can be set up in Account > Deposit / Withdrawal
{
  "result": {
    "transaction_id": "f1bc955de1b8cb7f33c62e44dfcf0c0e"
  },
  "req_id": "9dd69e73-2420-11eb-a7ff-0242ac120007"
}

Fetch deposit addresses of specific wallet: /deposit_addresses

Parameter Required Description
currency_id Yes Currency being withdrawn
{
  "result": {
    "data": [
      {
        "address": "bitcoincash:qqvsh3073uep5k8a9tqwa779w9lj6gw5eu7v37qy4h"
      }
    ]
  },
  "req_id": "d037c926-24bc-11eb-ba6f-0242ac120007"
}

Ledger - track changes of wallet balance: /ledger

Parameter Required Description
currency_id Yes Currency being withdrawn
start No Unix timestamp in microseconds, select entries that are newer
end No Unix timestamp in microseconds, select entries that are older
limit No Count of last records to return
subaccount_id No Return records for specified subaccount instead
{
  "result": {
    "data": [
      {
        "type": "trade",
        "order_direction": "buy",
        "date_created": "1605091626394705",
        "amount": "-17.32723",
        "amount_currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "value": "0.00214010",
        "value_currency_id": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "price": "8096.46",
        "price_currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "fee": "0.00000214",
        "fee_currency_id": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "balance_before": "590.04413",
        "balance_after": "572.71690",
        "balance_currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "order_id": "c8ea785f-08fa-4e55-a914-19103edada45",
        "trade_id": "8c080678-283d-4f60-a36a-aee99de2a4fd:52563e9b-1ae0-44ff-8d00-52c3ffa0dd72",
        "referee_user_id": null,
        "subaccount_transaction_id": null
      }
    ],
    "last": "1605084165872574"
  },
  "req_id": "da606514-2427-11eb-ba6f-0242ac120007"
}

List wallet blockchain operations (deposits|withdrawals): /blockchain_transactions

Parameter Required Description
currency_id Yes Currency being withdrawn
id No Filter transactions by ID, multiple IDs can be passed separated by comma
start No Unix timestamp in microseconds, select entries that are newer
end No Unix timestamp in microseconds, select entries that are older
limit No Amount of last trades to return
{
  "result": {
    "data": [
      {
        "id": "6b4d5121-970d-46c0-9062-06b9e08418dd",
        "type": "withdrawal",
        "address": "LT67 3910 0200 0000 0297",
        "amount": "195.00000",
        "currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "status": "waiting for your email confirmation...",
        "transaction_id": null,
        "fee_amount": "5",
        "fee_currency_id": "bfd04d06-b97c-4287-8bb0-c18f2eb19157",
        "date_created": "1605179763000000",
        "date_confirmed": null,
        "date_canceled": null,
        "date_scheduled": null
      }
    ],
    "last": "1605179757000000"
  },
  "req_id": "b090e42a-24f5-11eb-a375-0242ac130017"
}

Get websocket token for Websocket API: /websocket_token

Parameter Required Description
subaccount_id No Obtain token for only specific subaccount notifications

Generated JWT token can be used on Websocket Exchange API if you want to track your trading activities: get notified when you open an order or execute a trade.

Use it as a 't' query string parameter when connecting to the Websocket Exchange API. Example:

wss://limitlex.com/websocket/?p=ab651a43-1fc9-4163-a31b-74e5f537e82f:bfd04d06-b97c-4287-8bb0-c18f2eb19157&t=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxOGRhYWI0ZS01MWVhLTQ2YjEtYmFjMC1jY2ZhNTgzYTAzNjQiLCJleHAiOjE2MDE3OTIyOTR9.vUHXI4lK9z2vTdwpyQ2Oh_49reovT0pzRS95KlRbC7o

See Exchange Websocket API documentation for more details.

{
  "result": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MDUxNjk4NDksInN1YiI6ImM0YTYxNjExLTcwZWQtNDkzYS04MzRjLTM5NDBhNzAzZmE3ZSJ9.8D3qmPaKOdTrgnEY2-DiTX1doRry5roh-CiwWBZ7dfk"
  },
  "req_id": "2d2bc93f-24bd-11eb-ba6f-0242ac120007"
}

Create new subaccount: /add_subaccount

Parameter Required Description
subaccount_name Yes Name of the subaccount, must be unique along user's subaccounts
{
  "result": {
    "subaccount_id": "1ff96afc-ed1e-489a-aebe-11f097f9bf01",
    "subaccount_name": "First subaccount"
  },
  "req_id": "ae4f9cd7-e31d-11ec-981d-3448edabbc07"
}

List existing subaccounts: /subaccounts

This method does not accept any parameters.

{
  "result": {
    "data": [
      {
        "id": "3a32a88b-be66-48fa-ad00-c8efa0ab71bd",
        "date_created": "1653908093830969"
      },
      {
        "id": "5d70535f-94cd-4e18-9fd4-b9873397716a",
        "date_created": "1654085197610530"
      }
    ]
  },
  "req_id": "ac75e79c-e31d-11ec-981d-3448edabbc07"
}

Transfer funds between your main account and a subaccount: /subaccount_transfer

Parameter Required Description
currency_id Yes Currency being transferred
amount Yes Amount to transfer
account_id_from Yes, when there is no account_id_to parameter Subaccount ID from which funds are transferred to the main account
account_id_to Yes, when there is no account_id_from parameter Subaccount ID to which funds are transferred to the main account
{
  "result": {
    "subaccount_transaction_id": "8df5631f-383d-4ae5-85d5-fb4e8681a590"
  },
  "req_id": "490d907e-e31e-11ec-981d-3448edabbc07"
}

List transactions between your main account and subaccounts: /subaccount_transactions

Parameter Required Description
subaccount_id No Filter transactions related to the sub account
start No Unix timestamp in microseconds, return trades that are newer
end No Unix timestamp in microseconds, return trades that are older
limit No Count of records to return
{
  "result": {
    "data": [
      {
        "id": "dff446dc-1aad-4d69-a90f-20f403220470",
        "account_id_from": "5d70535f-94cd-4e18-9fd4-b9873397716a",
        "currency_id": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "amount": "1",
        "date_created": "1654248096000000"
      },
      {
        "id": "8df5631f-383d-4ae5-85d5-fb4e8681a590",
        "account_id_to": "3a32a88b-be66-48fa-ad00-c8efa0ab71bd",
        "currency_id": "ab651a43-1fc9-4163-a31b-74e5f537e82f",
        "amount": "3",
        "date_created": "1654247977000000"
      }
    ]
  },
  "req_id": "92dc360b-e31e-11ec-981d-3448edabbc07"
}

Signing requests example in Node.js

This simple example shows how you can make private API queries in Node.js

// Store your credentials in environment variables
const { API_KEY, API_SECRET } = process.env;

async function test() {
  const endpoint = "/private/trades";

  // Parameters we are going to send
  const params = {
    nonce: Date.now().toString(),
    pair_id:
      "ab651a43-1fc9-4163-a31b-74e5f537e82f:bfd04d06-b97c-4287-8bb0-c18f2eb19157",
  };

  // Here we are encoding params to application/x-www-form-urlencoded format
  // Using built-in URLSearchParams class
  const urlEncodedParams = new URLSearchParams(params).toString();

  // We concatenate api function with params string in order to create signature
  const messageToSign = endpoint + urlEncodedParams;

  // Use built-in module 'crypto' to create ECDSA signature with SHA512
  const signature = crypto.sign(
    "sha512",
    Buffer.from(messageToSign),
    API_SECRET
  );

  // Node-fetch http client is used to send HTTP request
  const response = await fetch("https://limitlex.com/api" + endpoint, {
    method: "POST",
    headers: {
      "API-Key": API_KEY, // Your public api-key
      "API-Sign": signature.toString("base64"), // Signature in base-64 format
    },
    body: urlEncodedParams, // Parameters in body of the request
  });

  // Done!
  const json = await response.json();
  console.log(json.result);
}
BIDS

The bid price is the highest price that a particular buyer is willing to pay for a specific product or service. In the context of financial/crypto markets, it is the value buyers offer for an asset, such as a commodity, security or cryptocurrency.

Read more

ASKS

The asking price is the minimum price that an individual would be willing to sell their asset, or the minimum amount that they want to receive in return for the unit(s) they are parting with.

Read more

MY OPEN ORDERS

Here you can see all of your open orders. To cancel an open order, just click the ‘X’ symbol next to it.

Read more

LIMIT ORDER

Limit order gives you the power to set a specific price at which you would like to buy or sell the desired amount of cryptocurrency.

Read more

MARKET ORDER

A market order is an order type that enables you to buy or sell at the best available market price.

Read more

STOP LOSS LIMIT

A Stop Loss Limit order is designed to limit your loss on a cryptocurrency position. A Stop Loss Limit order can be placed to buy or sell a specific cryptocurrency at your entered price (a limit order) once that cryptocurrency reaches a certain price.

Read more

TAKE PROFIT LIMIT

A take profit limit order is an order put in place by traders to maximize their profits and protect their profits on positions. A take profit limit order allows you (a trader) to set your custom made Buy or Sell order. You have to set two prices - the Trigger Price and the buy/sell Price.

Read more