To access subgraph queries, please reach out to us at [email protected]. As we are in the early rollout phase, data availability is being opened gradually.
1. Where subgraphs fit in
Internally, SuperEarn is structured in three layers (same high‑level idea as the SEProject docs):- Contract Layer (Kaia Chain) – vaults, routers, cooldown vaults; where deposits / redeems actually happen via SuperEarnRouter (CooldownVault is not directly callable by users).
- Subgraph Layer – indexes on‑chain events into raw, block‑level entities (accounts, vault snapshots, redeem requests, strategies, etc.).
- Backend Layer (PDM) – processes subgraph data into app‑ready, aggregated views and exposes them via a single GraphQL API that your integration talks to.
- You don’t need to construct Subgraph/The Graph queries.
- You can use
pdm_*queries on the backend endpoint.
2. Backend GraphQL endpoint (read layer)
SuperEarn exposes a Backend GraphQL API that already merges and processes the underlying subgraph data.- The schema contains PDM queries such as:
pdm_vaultspdm_accountpdm_totalBalanceInUSDLineChartpdm_totalEarningsInUSDLineChart
| Environment | Purpose | GraphQL endpoint | Notes |
|---|---|---|---|
| QA | Integration / QA | https://api.superearn.io/graphql | Token + IP allowlist required. |
2.1 Basic request shape
All reads are HTTP POSTs with a JSON body:- your backend server (recommended for partners/CEXes),
- or directly from a frontend if you manage the token securely.
3. Authentication & QA access control
3.1 Auth token (all environments)
Authentication requirement- Every external integration must use an Authorization token.
3.2 QA server ACL (IP allowlist)
The QA GraphQL endpoint is protected by an ACL (IP allowlist). To access QA:- Obtain an Authorization token (see above).
- Register the IP(s) of the machines that will call QA.
4. Core backend GraphQL queries for EarnUSDT
This section summarizes the minimal set of PDM queries you typically need as an EarnUSDT integrator. For end‑to‑end examples, see Integrate Earn USDT.Pattern:
- Contract integration →
accountAddress = your wrapper contract address- Frontend‑only integration →
accountAddress = user wallet address
4.1 Discover vaults – pdm_vaults
Use this to find the EarnUSDT Super Vault and other vault metadata.
-
Filter where
vaultNameorcontractAddressmatches the EarnUSDT Super Vault. -
Use the result to:
- show vault info in your UI,
- store
SUPER_VAULTfor laterdeposit/redeemcalls.
4.2 Get account positions & redeem requests – pdm_account
Get all SuperEarn positions and pending withdrawals for a given account:
- Contract integration –
account = your wrapper contract. - Frontend‑only –
account = user wallet. - Use client‑side filtering on
positions.vault.contractAddress == SUPER_VAULTto show EarnUSDT‑only data.
4.3 Balance / earnings charts – pdm_totalBalanceInUSDLineChart
Use this to build “Portfolio over time” or “EarnUSDT balance over time” charts.
vaultAddress = SUPER_VAULT→ chart for EarnUSDT only.vaultAddress = null / omitted→ chart for all vaults aggregated.
4.4 Earnings chart – pdm_totalEarningsInUSDLineChart
Use this to show “Total earnings over time” in USD.
- Always aggregates all vault earnings for the account (no
vaultAddressfilter). - Combine this with the balance chart to give users a complete performance view.
5. Quick checklist for integrators
Before you start calling the Backend GraphQL API:-
Get your Authorization token
- Email [email protected] with integration details.
-
(If using private endpoints)
- Share your IP address(es) for allowlisting to access
https://api.superearn.io/graphql.
- Share your IP address(es) for allowlisting to access
-
Implement reads using PDM queries
pdm_vaults→ discover EarnUSDT vaultpdm_account→ positions + redeem requestspdm_totalBalanceInUSDLineChart/pdm_totalEarningsInUSDLineChart→ charts
-
For write flows (deposit / redeem)
- Follow Integrate Earn USDT for smart contract calls; use Backend GraphQL only for reads.