Skip to content

Latest commit

 

History

History
153 lines (112 loc) · 2.66 KB

File metadata and controls

153 lines (112 loc) · 2.66 KB

Gecko Terminal API Docs

Get Latest Block

Fetches the latest block processed by our API.

Endpoint


GET https://api.invariant.app/gecko/latest-block

Response

{
  "block": {
    "blockNumber": 86245854,
    "blockTimestamp": 1753290779
  }
}

Get Asset

Fetches information about a specific asset.

Endpoint

GET https://api.invariant.app/gecko/asset?id=<assetId>

Query Parameters

  • id (string, required): the asset identifier

Example

GET https://api.invariant.app/gecko/asset?id=64mggk2nXg6vHC1qCdsZdEFzd5QGN4id54Vbho4PswCF

Response

{
  "asset": {
    "id": "64mggk2nXg6vHC1qCdsZdEFzd5QGN4id54Vbho4PswCF",
    "name": "BITZ",
    "symbol": "BITZ",
    "decimals": 11,
    "totalSupply": "124280.28456317483",
    "circulatingSupply": "124280.28456317483",
    "coinGeckoId": "bitz-2",
    "metadata": {
      "icon": "https://powpow.app/assets/icon.png",
      "website": "https://powpow.app"
    }
  }
}

Get Pair

Fetches information about a specific trading pair.

Endpoint

GET https://api.invariant.app/gecko/pair?id=<pairId>

Query Parameters

  • id (string, required): the pair identifier

Example

GET https://api.invariant.app/gecko/pair?id=FvVsbwsbGVo6PVfimkkPhpcRfBrRitiV946nMNNuz7f9

Response

{
  "pair": {
    "id": "FvVsbwsbGVo6PVfimkkPhpcRfBrRitiV946nMNNuz7f9",
    "asset0Id": "GU7NS9xCwgNPiAdJ69iusFrRfawjDDPjeMBovhV1d4kn",
    "asset1Id": "So11111111111111111111111111111111111111112",
    "dexKey": "Invariant"
  }
}

Get Events

Fetches an array of events between two block numbers (inclusive).

Endpoint

GET https://api.invariant.app/gecko/events?fromBlock=<start>&toBlock=<end>

Query Parameters

  • fromBlock (number, required): starting block number (inclusive)
  • toBlock (number, required): ending block number (inclusive)

Example

GET https://api.invariant.app/gecko/events?fromBlock=86245854&toBlock=86245856

Response

{
  "events": [
    {
      "block": {
        "blockNumber": 86245854,
        "blockTimestamp": 1753290779
      },
      "eventType": "swap",
      "txnId": "3Gpnnc5cJuFRLagk88AtoJSRgDvfjaqxqyDUCDhPHpDQ1wvSmJ5qd4LZoY5pPFxzrCLu2SSjsiCfCUrsGGN1V8L",
      "txnIndex": 0,
      "eventIndex": 3,
      "pairId": "D323jpT4XmBFPshHvMRsf5nHmAMLa78q8ZBX7XXonYQq",
      "asset1In": "0.000002748",
      "asset0Out": "0.010203",
      "priceNative": "3712.882096069868995633",
      "maker": "9mwVsGBf39wk33bubg4Vv3BMrMV7JkRhCD4iqPNDifeS",
      "reserves": {
        "asset0": "10.540049",
        "asset1": "0.000211511"
      }
    }
    // …more events
  ]
}