VELA Knowledge Base
  • Exchange
    • Platform Overview
    • Account Setup
      • Deposit & Withdraw
      • 1-Click Trading
    • Staking
      • $VLP
      • $VELA and $esVELA
      • Rewards
      • Hyper VLP
        • Hyper VLP Legacy
        • Hyper VLP 2.0
    • Trading
      • Positions
        • Profit, Loss, and ROI
        • Increase Collateral/ Leverage
        • Add to Position
        • Triggered Orders
        • Edit Triggered Orders
        • Close Position
      • Chart Trading
      • Mobile
    • Platform Mechanics
      • Fees
      • Price Feeds
      • Risk Mitigation
    • Tokenomics
    • Restricted Countries
  • Community
    • Grand Prix Trading Competition
      • Credits
      • Missions & Streaks
      • Nitro Boost
    • Social Features
      • Referrals
      • Share Trade
      • Leaderboards
      • AstraBit Guide
      • Previous Events
        • Pirate's Loot Trading Competition
    • NFTs
  • Support
    • Resources (Links)
    • Brand Kit
    • Gnosis Safe Management
  • Developers
    • APIs
      • The Graph API
      • Trade Bots API
      • Market Maker API
    • Asset Pairs and VelaId
    • Contracts
      • Arbitrum Mainnet
      • Arbitrum Testnet
      • Base Mainnet
      • Base Testnet
    • Contract Functions
      • Vault
      • Position Vault
      • Liquidate Vault
      • Order Vault
      • Price Manager
      • Settings Manager
      • Multicall
    • Audit
Powered by GitBook
On this page
  1. Developers
  2. APIs

The Graph API

PreviousAPIsNextTrade Bots API

Last updated 8 months ago

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

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.

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

  • Base URL
  • API Endpoints
  • GETThis endpoint retrieves open interests for a given chain id.
  • GETThis endpoint retrieves deposits for a given chain id and address.
  • GETThis endpoint retrieves withdraws for a given chain id and address.
  • GETThis endpoint retrieves open positions for a given chain id and address.
  • GETThis endpoint retrieves open positions for a given chain id and address.
  • GETThis endpoint retrieves portfolios for a given chain id and address.
  • GETThis endpoint retrieves closed positions for a given chain id and address.
  • GETThis endpoint retrieves trade activities for a given chain id and address.
  • An example of a request:
  • Errors