cacaotracker / api docs
CACAOCACAO
MAYAMAYA
CacaoTracker
CACAOCACAO
MAYAMAYA
OverviewPositionsRewardsBondActivity

OpenAPI 3.0

API documentation

Use CacaoTracker data in your own apps: analytics, rewards, positions and pool metrics for Maya Protocol.

Raw OpenAPI spec
Authentication Required
All API requests require a valid API Key in the x-api-key header.
Get an API Key
Generate keys instantly. No email required.

Create Account

Get started in seconds

Dev

Instant, localhost

Prod

Any domain

Quick Start
Include your API key in every request header.
Base URLhttps://api.cacaotracker.xyz
Example Request
curl -H "x-api-key: mk_..." \
  https://api.cacaotracker.xyz/protocol/stats

Security Note

Save your access link securely—it's your only way to manage keys. API keys work client-side with domain whitelisting for security.

WebSocket Flow

TX Tracker

The TX tracker uses a two-step flow. First create a short-lived websocket session with your API key over HTTP, then connect to the returned wsUrl and subscribe to one or more transaction hashes. The websocket upgrade route itself is not described as a normal OpenAPI endpoint, so use the flow below.

1. Create Session
Call the authenticated HTTP endpoint to mint a short-lived websocket URL.
Create WS Session
curl -X POST \
  -H "x-api-key: mk_..." \
  https://api.cacaotracker.xyz/tx-tracker/session
Session Response
{
  "wsUrl": "wss://api.cacaotracker.xyz/ws/tx-tracker?session=...",
  "expiresAt": "2026-04-25T12:00:00.000Z",
  "heartbeatSeconds": 30
}
2. Connect and Subscribe
Open the returned websocket URL and send a subscribe message with tx hashes.
Browser Example
const session = await fetch("https://api.cacaotracker.xyz/tx-tracker/session", {
  method: "POST",
  headers: { "x-api-key": "mk_..." }
}).then((res) => res.json());

const ws = new WebSocket(session.wsUrl);

ws.onmessage = (event) => {
  console.log(JSON.parse(event.data));
};

ws.onopen = () => {
  ws.send(JSON.stringify({
    type: "subscribe",
    txHashes: ["F0C99532FB34E87D8525706F352F6464722BBE8CA4C57782FB52C5D52C135C91"]
  }));
};
Expected Message Order
A typical successful connection returns a ready event, subscription ack, immediate snapshot, then live updates while the swap changes.
WS Message Sequence
{"type":"ready","connectionId":"...","heartbeatSeconds":30}
{"type":"subscribed","accepted":["TX_HASH"],"rejected":[]}
{"type":"snapshot","state":{"txHash":"TX_HASH","status":"streaming","stage":"streaming"}}
{"type":"tx_update","state":{"txHash":"TX_HASH","status":"completed","stage":"final","isFinal":true},"changedFields":["status","stage","isFinal"]}

API Reference

Live

Explore all endpoints below. Click any endpoint to view parameters, request body schema, and example responses. For the TX tracker, use the websocket flow above together with the documented /tx-tracker/session and /tx-tracker/{txHash} HTTP endpoints.

Loading API documentation...