GTE

GTE Markets API

The Markets API from GTE — 6 operation(s) for markets.

OpenAPI Specification

gte-markets-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: GTE Exchange Markets API
  version: 0.1.0
  description: API for GTE trading and historical data
  contact:
    name: API Support
    url: https://docs.gte.xyz
    email: support@liquidlabs.inc
servers:
- url: https://api-testnet.gte.xyz/v1
  description: GTE API Testnet HTTP Server
- url: wss://api-testnet.gte.xyz/ws
  description: GTE API Testnet WebSocket Server
tags:
- name: Markets
paths:
  /markets:
    get:
      tags:
      - Markets
      operationId: GetMarkets
      summary: Get list of markets
      parameters:
      - name: limit
        in: query
        schema:
          type: integer
          default: 100
          minimum: 1
          maximum: 1000
          format: uint
      - name: offset
        in: query
        schema:
          type: integer
          minimum: 0
          default: 0
          format: uint
      - name: marketType
        in: query
        description: Filter by market type. If empty, all market types will be returned
        schema:
          $ref: '#/components/schemas/MarketType'
      - name: sortBy
        in: query
        description: Sort markets in descending order
        schema:
          type: string
          enum:
          - marketCap
          - createdAt
          - volume
          default: marketCap
      - name: tokenAddress
        in: query
        description: Filter markets by the specified token address
        schema:
          $ref: '#/components/schemas/EvmAddress'
      - name: newlyGraduated
        in: query
        description: Returns newly graduated markets. Ignores `sortBy` if `true`
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: List of markets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketListResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /markets/search:
    get:
      tags:
      - Markets
      operationId: SearchMarkets
      summary: Search markets based on name or symbol
      parameters:
      - name: q
        in: query
        required: true
        schema:
          type: string
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 1000
          default: 100
          format: uint
      responses:
        '200':
          description: List of markets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketListResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /markets/{market_address}:
    get:
      tags:
      - Markets
      operationId: GetMarketByAddress
      summary: Get market by address
      parameters:
      - name: market_address
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/EvmAddress'
      responses:
        '200':
          description: Market
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Market'
        '404':
          description: Market not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /markets/{market_address}/candles:
    get:
      tags:
      - Markets
      operationId: GetMarketCandles
      summary: Get candles for a market
      parameters:
      - name: market_address
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/EvmAddress'
      - name: interval
        in: query
        required: true
        schema:
          $ref: '#/components/schemas/CandleInterval'
      - name: startTime
        in: query
        required: true
        schema:
          type: integer
          format: int64
      - name: endTime
        in: query
        description: If not supplied, the current time will be used
        schema:
          type: integer
          format: int64
      - name: limit
        in: query
        schema:
          type: integer
          default: 500
          minimum: 1
          maximum: 1000
          format: uint
      responses:
        '200':
          description: List of candles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketCandlesResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Market not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /markets/{market_address}/trades:
    get:
      tags:
      - Markets
      operationId: GetMarketTrades
      summary: Get trades for a market
      parameters:
      - name: market_address
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/EvmAddress'
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 1000
          format: uint
          default: 100
      - name: offset
        in: query
        schema:
          type: integer
          minimum: 0
          default: 0
          format: uint
      responses:
        '200':
          description: List of trades
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTradeListResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Market not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /markets/{market_address}/book:
    get:
      tags:
      - Markets
      operationId: GetMarketBook
      summary: Get L2 orderbook for a market
      parameters:
      - name: market_address
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/EvmAddress'
      - name: limit
        in: query
        schema:
          type: integer
          default: 10
          minimum: 1
          maximum: 100
          format: uint
      responses:
        '200':
          description: L2 orderbook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketBookResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Market not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    GetMarketListResponse:
      type: array
      items:
        $ref: '#/components/schemas/Market'
    GetMarketBookResponse:
      $ref: '#/components/schemas/Book'
    BookLevel:
      type: object
      required:
      - price
      - size
      - number
      properties:
        price:
          type: string
          description: Price of the level
        size:
          type: string
          description: Size of the level
        number:
          type: number
          description: Number of orders at the level
    Market:
      type: object
      required:
      - marketType
      - address
      - baseToken
      - quoteToken
      - price
      - priceUsd
      - volume24HrUsd
      - volume1HrUsd
      - marketCapUsd
      - createdAt
      - tvlUsd
      properties:
        marketType:
          $ref: '#/components/schemas/MarketType'
        address:
          $ref: '#/components/schemas/EvmAddress'
          description: EVM address of the market
        baseToken:
          $ref: '#/components/schemas/Token'
          description: Base token of the market. On AMMs, this token comes first in the pair
        quoteToken:
          $ref: '#/components/schemas/Token'
          description: Quote token of the market. On AMMs, this token comes second in the pair
        price:
          type: number
          format: double
          description: Price of the base token in quote tokens.
        priceUsd:
          type: number
          format: double
          description: Price of the base token in USD.
        volume24HrUsd:
          type: number
          format: double
          description: Volume of the market in the last 24 hours in USD
        volume1HrUsd:
          type: number
          format: double
          description: Volume of the market in the last 1 hour in USD
        marketCapUsd:
          type: number
          format: double
          description: Market cap of the market in USD
        createdAt:
          type: integer
          format: int64
          description: Timestamp of when the market was deployed in UTC millis
          nullable: true
        tvlUsd:
          type: number
          nullable: true
          format: double
          description: TVL of the market in Usd. Null if not applicable.
    TradeSide:
      type: string
      enum:
      - buy
      - sell
      description: Side of the trade
    EvmTxnHash:
      type: string
      pattern: ^0x[a-fA-F0-9]{64}$
      description: EVM transaction hash
    MarketType:
      type: string
      enum:
      - bonding-curve
      - amm
      - clob-spot
      - perps
      description: Type of the market
    GetMarketCandlesResponse:
      type: array
      items:
        $ref: '#/components/schemas/Candle'
    Candle:
      type: object
      required:
      - timestamp
      - open
      - high
      - low
      - close
      - volume
      properties:
        timestamp:
          type: integer
          format: int64
          description: Start time of the candle in milliseconds
        open:
          type: number
          format: double
          description: Open price of the candle (in quote asset)
        high:
          type: number
          format: double
          description: High price of the candle (in quote asset)
        low:
          type: number
          format: double
          description: Low price of the candle (in quote asset)
        close:
          type: number
          format: double
          description: Close price of the candle (in quote asset)
        volume:
          type: number
          format: double
          description: Volume of the candle (in base asset)
    ErrorResponse:
      type: object
      required:
      - message
      properties:
        message:
          type: string
          description: Error message
    EvmAddress:
      type: string
      pattern: ^0x[a-fA-F0-9]{40}$
      description: EVM address
    Trade:
      type: object
      description: Trades in Launchpad and AMM markets.
      required:
      - timestamp
      - txnHash
      - maker
      - taker
      - price
      - size
      - side
      - marketAddress
      properties:
        marketAddress:
          $ref: '#/components/schemas/EvmAddress'
          description: EVM address of the market
        timestamp:
          type: integer
          format: int64
          description: Timestamp of the trade in milliseconds
        txnHash:
          $ref: '#/components/schemas/EvmTxnHash'
          description: Transaction hash of the trade
        maker:
          $ref: '#/components/schemas/EvmAddress'
          description: EVM address of the maker
        taker:
          $ref: '#/components/schemas/EvmAddress'
          description: EVM address of the taker
        price:
          type: number
          format: double
          description: Price of the trade in quote tokens
        size:
          type: number
          format: double
          description: Size of the trade in base tokens
        side:
          $ref: '#/components/schemas/TradeSide'
          description: Side of the trade by the taker
    CandleInterval:
      type: string
      enum:
      - 1s
      - 15s
      - 30s
      - 1m
      - 2m
      - 3m
      - 5m
      - 10m
      - 15m
      - 20m
      - 30m
      - 1h
      - 4h
      - 1d
      - 1w
      description: Interval of the candle
    Token:
      type: object
      required:
      - address
      - decimals
      - name
      - symbol
      - totalSupply
      - logoUri
      - priceUsd
      - volume1HrUsd
      - volume24HrUsd
      - marketCapUsd
      properties:
        address:
          $ref: '#/components/schemas/EvmAddress'
        decimals:
          type: integer
          description: Number of decimals for the token
        name:
          type: string
          description: Name of the token
        symbol:
          type: string
          description: Symbol of the token
        totalSupply:
          type: number
          format: double
          description: Total supply of the token
        logoUri:
          type: string
          nullable: true
          description: URI of the token's logo
        priceUsd:
          type: number
          format: double
          description: Price of token in USD
        volume1HrUsd:
          type: number
          format: double
          description: 1 hour volume in USD
        volume24HrUsd:
          type: number
          format: double
          description: 24 hour volume in USD
        marketCapUsd:
          type: number
          format: double
          description: Token market cap in USD
    GetTradeListResponse:
      type: array
      items:
        $ref: '#/components/schemas/Trade'
    Book:
      type: object
      required:
      - asks
      - bids
      - timestamp
      properties:
        asks:
          type: array
          items:
            $ref: '#/components/schemas/BookLevel'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/BookLevel'
        timestamp:
          type: integer
          format: int64