The Graph API

The Graph API provides detailed information about various financial activities. With the use of this API, you can retrieve data about open interests, deposits, withdraws, open positions, open orders, portfolios, closed positions, and trade activities.

Base URL

The base URL for all the API endpoints is https://api.vela.exchange/graph. Example Request Base:

GET https://api.vela.exchange/graph/{ENDPOINT}/{chainId}/{address}

API Endpoints

This endpoint retrieves open interests for a given chain id.

get
Path parameters
chainIdstringRequired
Responses
200Success
get
GET /graph/open_interests/{chainId} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

This endpoint retrieves deposits for a given chain id and address.

get
Path parameters
chainIdstringRequired
addressstringRequired
Responses
200Success
get
GET /graph/deposits/{chainId}/{address} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

This endpoint retrieves withdraws for a given chain id and address.

get
Path parameters
chainIdstringRequired
addressstringRequired
Responses
200Success
get
GET /graph/withdraws/{chainId}/{address} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

This endpoint retrieves open positions for a given chain id and address.

get
Path parameters
chainIdstringRequired
addressstringRequired
Query parameters
paginatenumberRequired
Responses
200Success
get
GET /graph/open_positions/{chainId}/{address} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

This endpoint retrieves open positions for a given chain id and address.

get
Path parameters
chainIdstringRequired
addressstringRequired
Query parameters
paginatenumberRequired
Responses
200Success
get
GET /graph/open_orders/{chainId}/{address} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

This endpoint retrieves portfolios for a given chain id and address.

get
Path parameters
chainIdstringRequired
addressstringRequired
Responses
200Success
get
GET /graph/portfolios/{chainId}/{address} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

This endpoint retrieves closed positions for a given chain id and address.

get
Path parameters
chainIdstringRequired
addressstringRequired
Query parameters
paginatenumberRequired
Responses
200Success
get
GET /graph/closed_positions/{chainId}/{address} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

This endpoint retrieves trade activities for a given chain id and address.

get
Path parameters
chainIdstringRequired
addressstringRequired
Query parameters
paginatenumberRequired
Responses
200Success
get
GET /graph/trade_activities/{chainId}/{address} HTTP/1.1
Host: api.vela.exchange
Accept: */*
200Success

No content

An example of a request:

const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.vela.exchange/graph/deposits/42161/0xYourEthereumAddress',  // Update with your chainId and address
  headers: { }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Errors

Our API uses conventional HTTP response codes to indicate success or failure of an API request. In general, 2xx indicates success, 4xx indicates an error from the client's side, and 5xx indicates an error from the server's side.

Last updated