Vest API
General API Information
The base URL endpoints are available at:
Production: https://serverprod.vest.exchange/v2.
Development: https://devserver-mm.vest.exchange/v2/.
When sending requests, the header must contain:
Format Conversions
All decimals are strings.
All integers are numbers.
All timestamps are integers denoting milliseconds since epoch.
All ambiguous monetary values like margin requirements are ubiquitously USDC. i.e. USDC is the only numéraire.
ENUM Definitions
Symbol status: TRADING, HALT.
Order status: NEW, PARTIALLY_FILLED, FILLED, CANCELLED, REJECTED.
Order type: MARKET, LIMIT, STOP_LOSS, TAKE_PROFIT, LIQUIDATION (only in response).
LP type: DEPOSIT, IMMEDIATE_WITHDRAW, SCHEDULE_WITHDRAW.
Transfer type: DEPOSIT, WITHDRAW.
Order Lifecycle
Docs coming soon.
Order Type
Docs coming soon.
Error Codes
Public REST API
GET /exchangeInfo
Parameters
symbols (optional: returns all by default; should be comma-separated e.g.
BTC-PERP,ETH-PERP,SOL-PERP
).
Notes
The minimum contract size and contract size is 1e(-sizeDecimals).
Example Response
GET /ticker/latest
Parameters
symbols (optional: returns all by default; should be comma-separated, e.g.
BTC-PERP,ETH-PERP,SOL-PERP
).
Example Response
GET /ticker/24hr
Parameters
symbols (optional: returns all by default; should be comma-separated e.g.
BTC-PERP,ETH-PERP,SOL-PERP
).
Example Response
GET /funding/history
Parameters
symbol (e.g.
BTC-PERP
).startTime (optional).
endTime (optional: defaults to current).
limit (optional: defaults to 1000; maximum 1000 entries from endTime).
interval (optional: defaults to 1m; supports 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M).
Example Response
GET /klines
Parameters
symbol (e.g.
BTC-PERP
).startTime (optional).
endTime (optional: defaults to current).
limit (optional: defaults to 1000; maximum 1000 entries from endTime).
interval (optional: defaults to 1m; supports 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M).
Example Response
GET /trades
Parameters
symbol (e.g.
BTC-PERP
).startTime (optional).
endTime (optional: defaults to current).
limit (optional: defaults to 1000; maximum 1000 entries from endTime).
Example Response
GET /depth
Parameters
symbol (e.g.
BTC-PERP
).limit (optional: defaults to 20; maximum 100).
Example Response
Private REST API
Authentication
To authenticate, the client must have access to or create the following variables:
primaryAddr, the public key of your primary account which holds balances.
signingAddr, a signing key generated by the client that acts as a delegate to sign transactions on behalf of the primary account.
apiKey, an API key returned as the response to the POST /register endpoint.
To connect to private endpoints, the client then:
Sends apiKey in the header of the request as X-API-KEY.
Attaches a signature by a valid signing key (or primary key).
For each POST request, create a signature based on order parameters as specified below. It is generally recommended to use time as nonce, unless you want to create identical orders (orders whose fields are the same except for nonce).
The registration process will look like this:
Generate a random key/pair for signing; this will be your signingAddr.
Make a request to the POST /register endpoint by creating a valid signature.
POST /register
Request Body Example
Example Response
GET /account
Parameters
time (e.g. 1713593340000).
Example Response
GET /account/nonce
Parameters
time, e.g. 1713593340000.
Example Response
POST /orders
Example Signature
Request Body Example
Example Response
Example Error Response
POST /orders/cancel
Example Signature
Request Body Example
Example Response
GET /orders
Parameters
id (optional: returns all orders by default).
nonce (optional: returns all orders by default).
symbol (optional: returns all symbols by default).
orderType (optional: returns all orders by default).
status (optional: returns all statuses by default).
startTime (optional).
endTime (optional: defaults to current).
limit (optional: defaults to 1000; maximum 1000 entires from endTime).
time (e.g. 1713593340000).
Example Response
POST /lp
Example Signature
Request Body Example
Example Response
GET /lp
Parameters
id (optional: returns all orders by default).
nonce (optional: returns all orders by default).
orderType (optional: returns all orders by default).
status (optional: returns all statuses by default).
startTime (optional).
endTime (optional: defaults to current).
limit (optional: defaults to 1000; maximum 1000 entires from endTime).
time (e.g. 1713593340000).
Example Response
POST /transfer/withdraw
Example Signature
Request Body Example
Example Response
GET /transfer
Parameters
id (optional: returns all orders by default).
nonce (optional: returns all orders by default).
orderType (optional: returns all orders by default).
startTime (optional).
endTime (optional: defaults to current).
limit (optional: defaults to 1000; maximum 1000 entires from endTime).
time (e.g. 1713593340000).
Example Response
Public WS Endpoints
The base endpoints are available at:
Production: wss://wsprod.vest.exchange/ws-api?version=1.0.
Development: wss://devws.vest.exchange/ws-api?version=1.0.
When sending requests, this query parameter is required:
Ping/Pong
To check the connection, the client must send {"method": "PING", "params": [], "id": 0}
where id can be any integer. The server will respond with {"data": "PONG"}
.
Subscription
For each subscription, the client must attach an integer-valued id which will be unique per request. e.g. {"method": "SUBSCRIBE", "params": [channel1, channel2, ...], "id": subscription_id}.
The server will respond with {"result": null, "id": subscription_id}
after successful subscription/un-subscription.
Tickers
Channel name: tickers.
Example Response
Klines
Channel name: {symbol}@kline_{intervals} (e.g. DOGE-PERP@kline_1m).
Supported intervals: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M.
Example Response
Depth
Channel name: {symbol}@depth (e.g. DOGE-PERP@depth).
Example Response
Private WS Endpoints
Authentication
To establish a connection to private endpoints, the client must obtain listenKey. For all methods, include the X-API-Key in the header obtained via /register.
POST /account/listenKey
Returns a listen key that is valid for 60 minutes. If a client has an active listenKey, it will return the existing listenKey and extend its validity by 60 minutes.
Parameters
None
Example Response
PUT /account/listenKey
Extends the expiry of the current listen key by 60 minutes. If the existing key has already expired or there is no listen key, it will return an error response.
Parameters
None
Example Response:
Example Error Response:
DELETE /account/listenKey
Closes the current listen key.
Parameters
None
Example Response
Subscription
Uses the same base url as the public endpoint but the client must pass in an additional query parameter, listenKey when sending a request for subscription.
e.g.
Channel name: account_private.
Each response will be in the following format:
Order
event_name: ORDER.
Example Payload for New Order
Example Payload for Order Execution
Example Payload for Order Cancellation
Example Payload for Order Rejection
LP Order
event_name: LP.
Example Payload for Order Execution
Transfer
event_name: TRANSFER.
Example Payload
Last updated