Resources

API reference

REST API endpoints for the Baseline protocol.

Base URL: https://api.baseline.markets

All REST endpoints are versioned under /v1/. Address parameters must be EIP-55 checksummed.


DexScreener adapter

Implements the DexScreener Adapter Spec v1.1. These endpoints are queried directly by DexScreener to index Baseline pools.

GET /v1/dexscreener/latest-block

Returns the latest indexed block. DexScreener polls this continuously to determine where to resume indexing.

GEThttps://api.baseline.markets/v1/dexscreener/latest-block

Response

{
  "block": {
    "blockNumber": 24922675,
    "blockTimestamp": 1776706931
  }
}
FieldTypeDescription
block.blockNumbernumberLatest indexed block number
block.blockTimestampnumberUnix timestamp (seconds) of that block

GET /v1/dexscreener/asset

Returns token metadata for a given contract address.

Query parameters

ParameterTypeRequiredDescription
idstringYesChecksummed token contract address
GEThttps://api.baseline.markets/v1/dexscreener/asset?id=0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B

Response

{
  "asset": {
    "id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "name": "Based Liquidity Token",
    "symbol": "BLT",
    "decimals": 18,
    "totalSupply": "72000000",
    "circulatingSupply": "29569970.092404356096317215"
  }
}
FieldTypeDescription
asset.idstringContract address
asset.namestringToken name
asset.symbolstringToken symbol
asset.decimalsnumberToken decimals (also used to decimalize supply fields)
asset.totalSupplystringDecimalized total supply (omitted if unavailable)
asset.circulatingSupplystringDecimalized circulating supply (omitted if unavailable)

Errors

StatusBodyCause
400{ error: [{ message: "Invalid input: expected string, received undefined" }] }Missing or invalid id parameter
404{ error: "Asset not found" }Address not in the indexed token registry

GET /v1/dexscreener/pair

Returns pool metadata for a given btoken contract address.

Query parameters

ParameterTypeRequiredDescription
idstringYesChecksummed btoken contract address
GEThttps://api.baseline.markets/v1/dexscreener/pair?id=0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B

Response

{
  "pair": {
    "id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "dexKey": "baseline",
    "asset0Id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "asset1Id": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "createdAtBlockNumber": 24921292,
    "createdAtBlockTimestamp": 1776690287,
    "createdAtTxnId": "0x7576a097a1680a8ec8a595212572b49e0d9cc8d64cfdcd891f5bc2bce2aa2178",
    "creator": "0xB2A9f3886134e5F6A19a1A87bD62343FE2685c64"
  }
}
FieldTypeDescription
pair.idstringbtoken contract address (the pair identifier)
pair.dexKeystringAlways "baseline"
pair.asset0Idstringbtoken address
pair.asset1IdstringReserve token address (WETH on mainnet)
pair.createdAtBlockNumbernumberPool deploy block
pair.createdAtBlockTimestampnumberPool deploy Unix timestamp
pair.createdAtTxnIdstringPool deploy transaction hash
pair.creatorstringAddress that deployed the pool

Errors

StatusBodyCause
404{ error: "Pair not found" }No pool found for this address

GET /v1/dexscreener/events

Returns swap events within an inclusive block range. DexScreener uses this to index historical and live trades.

Query parameters

ParameterTypeRequiredDescription
fromBlocknumberYesStart block (inclusive)
toBlocknumberYesEnd block (inclusive)

Maximum range: 2000 blocks per request.

GEThttps://api.baseline.markets/v1/dexscreener/events?fromBlock=24921292&toBlock=24922675

Response

{
  "events": [
    {
      "block": { "blockNumber": 24921350, "blockTimestamp": 1776691000 },
      "eventType": "swap",
      "txnId": "0x7576a097a1680a8ec8a595212572b49e0d9cc8d64cfdcd891f5bc2bce2aa2178",
      "txnIndex": 4,
      "eventIndex": 0,
      "maker": "0xB2A9f3886134e5F6A19a1A87bD62343FE2685c64",
      "pairId": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
      "asset1In": "0.5",
      "asset0Out": "966424.684",
      "priceNative": "0.00000063",
      "reserves": {
        "asset0": "29569970.09",
        "asset1": "0.61"
      }
    }
  ]
}

Each event is a swap. asset0 is always the btoken; asset1 is always the reserve token.

FieldTypeDescription
eventType"swap"Always "swap"
txnIdstringTransaction hash
txnIndexnumberTransaction order within block
eventIndexnumberEvent order within transaction
makerstringWallet that submitted the transaction
pairIdstringbtoken address
asset1InstringReserve amount in (buy)
asset0Outstringbtoken amount out (buy)
asset0Instringbtoken amount in (sell)
asset1OutstringReserve amount out (sell)
priceNativestringPrice of asset0 quoted in asset1 (decimalized)
reserves.asset0stringPost-swap btoken pool balance
reserves.asset1stringPost-swap reserve pool balance

All amounts are decimalized (amount / 10 ** decimals).

Errors

StatusBodyCause
400{ error: "Block range exceeds max range of 2000" }Range greater than 2000 blocks
400{ error: [{ message: "..." }] }Missing or invalid query parameters

CoinGecko adapter

CoinGecko-related HTTP surfaces on Baseline: an on-chain index (latest-block, asset, pair, events) and a decentralized spot exchange feed (tickers, orderbook, historical_trades). All routes use the prefix /v1/coingecko/.

GET /v1/coingecko/latest-block

Returns the latest indexed block. This value should stay in sync with /events: it is the highest block for which event data is available for range queries.

GEThttps://api.baseline.markets/v1/coingecko/latest-block

Response

{
  "block": {
    "blockNumber": 24922675,
    "blockTimestamp": 1776706931
  }
}
FieldTypeDescription
block.blockNumbernumberLatest indexed block number
block.blockTimestampnumberUnix timestamp (seconds) of that block

GET /v1/coingecko/asset

Returns token metadata for a given contract address.

Query parameters

ParameterTypeRequiredDescription
idstringYesChecksummed token contract address
GEThttps://api.baseline.markets/v1/coingecko/asset?id=0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B

Response

{
  "asset": {
    "id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "name": "Based Liquidity Token",
    "symbol": "BLT",
    "decimals": 18,
    "totalSupply": "72000000",
    "circulatingSupply": "29569970.092404356096317215"
  }
}
FieldTypeDescription
asset.idstringContract address
asset.namestringToken name
asset.symbolstringToken symbol
asset.decimalsnumberToken decimals (also used to decimalize supply fields)
asset.totalSupplystringDecimalized total supply (omitted if unavailable)
asset.circulatingSupplystringDecimalized circulating supply (omitted if unavailable)

Errors

StatusBodyCause
400{ error: [{ message: "Invalid input: expected string, received undefined" }] }Missing or invalid id parameter
404{ error: "Asset not found" }Address not in the indexed token registry

GET /v1/coingecko/pair

Returns pool metadata for a given btoken contract address.

Query parameters

ParameterTypeRequiredDescription
idstringYesChecksummed btoken contract address
GEThttps://api.baseline.markets/v1/coingecko/pair?id=0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B

Response

{
  "pair": {
    "id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "dexKey": "baseline",
    "asset0Id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "asset1Id": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "createdAtBlockNumber": 24921292,
    "createdAtBlockTimestamp": 1776690287,
    "createdAtTxnId": "0x7576a097a1680a8ec8a595212572b49e0d9cc8d64cfdcd891f5bc2bce2aa2178",
    "creator": "0xB2A9f3886134e5F6A19a1A87bD62343FE2685c64"
  }
}
FieldTypeDescription
pair.idstringbtoken contract address (the pair identifier)
pair.dexKeystringAlways "baseline"
pair.asset0Idstringbtoken address
pair.asset1IdstringReserve token address (WETH on mainnet)
pair.createdAtBlockNumbernumberPool deploy block
pair.createdAtBlockTimestampnumberPool deploy Unix timestamp
pair.createdAtTxnIdstringPool deploy transaction hash
pair.creatorstringAddress that deployed the pool

Errors

StatusBodyCause
404{ error: "Pair not found" }No pool found for this address

GET /v1/coingecko/events

Returns swap events within an inclusive block range.

Query parameters

ParameterTypeRequiredDescription
fromBlocknumberYesStart block (inclusive)
toBlocknumberYesEnd block (inclusive)

Maximum range: 2000 blocks per request.

GEThttps://api.baseline.markets/v1/coingecko/events?fromBlock=24921292&toBlock=24922675

Response

{
  "events": [
    {
      "block": { "blockNumber": 24921350, "blockTimestamp": 1776691000 },
      "eventType": "swap",
      "txnId": "0x7576a097a1680a8ec8a595212572b49e0d9cc8d64cfdcd891f5bc2bce2aa2178",
      "txnIndex": 4,
      "eventIndex": 0,
      "maker": "0xB2A9f3886134e5F6A19a1A87bD62343FE2685c64",
      "pairId": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
      "asset1In": "0.5",
      "asset0Out": "966424.684",
      "priceNative": "0.00000063",
      "reserves": {
        "asset0": "29569970.09",
        "asset1": "0.61"
      }
    }
  ]
}

Each event is a swap. asset0 is always the btoken; asset1 is always the reserve token.

FieldTypeDescription
eventType"swap"Always "swap"
txnIdstringTransaction hash
txnIndexnumberTransaction order within block
eventIndexnumberEvent order within transaction
makerstringWallet that submitted the transaction
pairIdstringbtoken address
asset1InstringReserve amount in (buy)
asset0Outstringbtoken amount out (buy)
asset0Instringbtoken amount in (sell)
asset1OutstringReserve amount out (sell)
priceNativestringPrice of asset0 quoted in asset1 (decimalized)
reserves.asset0stringPost-swap btoken pool balance
reserves.asset1stringPost-swap reserve pool balance

All amounts are decimalized (amount / 10 ** decimals).

Errors

StatusBodyCause
400{ error: "Block range exceeds max range of 2000" }Range greater than 2000 blocks
400{ error: [{ message: "..." }] }Missing or invalid query parameters

GET /v1/coingecko/tickers

Returns all active Baseline pools with current price, volume, and liquidity data. Responses are cached for 30 seconds.

GEThttps://api.baseline.markets/v1/coingecko/tickers

Response

[
  {
    "ticker_id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B_0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "base_currency": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "target_currency": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "pool_id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
    "last_price": "0.00000063",
    "base_volume": "966424.68430129",
    "target_volume": "0.61341692",
    "liquidity_in_usd": "31086",
    "high": "0.00000064",
    "low": "0.00000060"
  }
]

ticker_id is formatted as BTOKEN_RESERVE. base_currency is the btoken; target_currency is the reserve asset.


GET /v1/coingecko/orderbook

Returns an empty orderbook stub. Baseline uses an AMM with no traditional order book.

Query parameters

ParameterTypeRequiredDescription
ticker_idstringYesPair ID in BTOKEN_RESERVE format
GEThttps://api.baseline.markets/v1/coingecko/orderbook?ticker_id=0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B_0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Response

{
  "ticker_id": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B_0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "timestamp": "1776770625054",
  "bids": [],
  "asks": []
}

GET /v1/coingecko/historical_trades

Returns historical trades for a pair within an optional time window.

Query parameters

ParameterTypeRequiredDescription
ticker_idstringYesPair ID in BTOKEN_RESERVE format
type"buy" | "sell"NoFilter by trade direction
limitnumberNoMax trades to return
start_timenumberNoUnix timestamp start (inclusive)
end_timenumberNoUnix timestamp end (inclusive)
GEThttps://api.baseline.markets/v1/coingecko/historical_trades?ticker_id=0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B_0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&limit=1

Response

{
  "buy": [
    {
      "trade_id": "0x7a68e9216c6e238e6388dd67e737e3de92c5c93b:1",
      "price": "0.00000063",
      "base_volume": "966424.68",
      "target_volume": "0.61",
      "trade_timestamp": "1776706931000",
      "type": "buy"
    }
  ],
  "sell": []
}

Points and leaderboard

GET /v1/points/:walletAddress

Returns points summary for a wallet — cumulative all-time points and per-week breakdown.

Path parameters

ParameterTypeDescription
walletAddressstringChecksummed EVM wallet address
GEThttps://api.baseline.markets/v1/points/0x89C6AD1CC1c22c8705670a8600541fEf162e77Cf

Response

{
  "wallet": "0x89C6AD1CC1c22c8705670a8600541fEf162e77Cf",
  "referralPoints": "0",
  "cumulative": {
    "totalPoints": "100000",
    "totalVolumeUsd": "209",
    "rank": 1
  },
  "currentWeek": {
    "weekStart": 1776056400,
    "points": "100000",
    "volumeUsd": "209",
    "rank": 1
  },
  "weeklyHistory": [
    {
      "weekStart": 1776056400,
      "weekEnd": 1776661200,
      "points": "100000",
      "volumeUsd": "209"
    }
  ]
}

GET /v1/leaderboard

Returns the points leaderboard with pagination.

Query parameters

ParameterTypeDefaultDescription
period"all" | "1w""all"All-time or weekly leaderboard
limitnumber10Results per page (max 500)
offsetnumber0Pagination offset
searchstringFilter by wallet address substring
week_startnumberUnix timestamp of a specific week start (overrides period)
GEThttps://api.baseline.markets/v1/leaderboard?period=1w&limit=1

Response

{
  "entries": [
    {
      "rank": 1,
      "wallet": "0xe8d6d566c2B9eBBCcb4072ab5FffbD1dfe016721",
      "points": "63935",
      "volumeUsd": "922",
      "weightedVolume": "922",
      "referralWeightedVolume": "0",
      "totalWeightedVolume": "922",
      "breakdown": [
        {
          "btokenAddress": "0x7a68e9216C6e238e6388Dd67E737E3De92C5C93B",
          "btokenSymbol": "BLT",
          "reserveSymbol": "WETH",
          "volumeUsd": 922.08,
          "multiplier": 1,
          "weightedVolume": 922.08
        }
      ],
      "referralCount": 0
    }
  ],
  "totalEntries": 4,
  "totalWeightedVolume": 1442,
  "totalPoints": 100000,
  "totalVolume": 1442
}

GET /v1/leaderboard/weeks

Returns a list of completed weeks with their points pool sizes, ordered most-recent first.

GEThttps://api.baseline.markets/v1/leaderboard/weeks

Response

{
  "weeks": [
    { "week_start": 1776056400, "points_pool": 100000 }
  ]
}