Hartii developer docs

HartiiLabs

HartiiLabs

HartiiLabs (hartiilabs.com) is a pump.fun-style token launchpad on Quai Network. Anyone can launch an ERC-20 through a factory contract, trade it against a per-token bonding curve, and — once the curve sells out — have it graduate into an internal liquidity pool. Live in production on Cyprus-1 (chain 9) since 2026-07-05.

This section documents the developer-facing surface: the public HTTP API, how the indexer keeps it fresh, and integration recipes. Contract-level docs (ABIs, the bonding-curve math, how to launch a token from your own code) live in a separate set of pages — see Contracts for those; this section cross-links to them where relevant but does not duplicate them.

What it is

  • A launchpad: a TokenFactory deploys an EIP-1167 minimal-proxy clone of a LaunchToken (ERC-20) plus a BondingCurve for every new token. Buys and sells trade against the curve's constant-product (x*y=k) pricing until the curve sells out its allotted supply.
  • A graduation mechanism: sellout moves the token into an internal pool (never an external DEX) that continues to emit the same Buy/Sell events, so indexing is continuous across the launch → graduate lifecycle.
  • A read API + frontend: every trade, holder balance, candle, and derived stat (trending score, 24h volume, burns) is indexed off-chain into D1 and served over a public, unauthenticated, CORS-open HTTP API — the same API the hartiilabs.com frontend itself runs on.

Token images

Token lists and details reserve the same image area while artwork loads. Missing, loading or failed images show a letter on a transparent background instead of a filled badge or shimmer. When an image loads successfully, its usual frame returns. The market Flow view uses the same open letter treatment for tokens without an available image; hover and selection remain active.

Components

ComponentWhat it doesWhere
ContractsTokenFactory, LaunchToken, BondingCurve — immutable, non-upgradablesee Contracts
IndexerScans factory/curve/token logs in 2000-block windows, writes D1functions/api/indexer-run.js, workers/indexer-cron/
D1 (HARTII_LABS_DB)Tokens, trades, holders, candles, burns, creator claims, indexer cursorCloudflare D1
KV (HARTII_LABS_KV)Hidden-token list, draft metadata, logo bytes, throttle stateCloudflare KV
Pages Functions APIThe public HTTP surface documented in API referencefunctions/api/**
Live push hubWebSocket fan-out of new trades/burns, LiveHub Durable Objectfunctions/api/live/**
FrontendThe hartiilabs.com SPA — the reference consumer of every endpoint belowsrc/

How data flows

  1. A wallet calls the factory or a curve directly (launch, buy, sell, graduate, withdraw creator fees) — see Contracts for the on-chain interface.
  2. The chain emits TokenLaunched (factory), Buy/Sell/Graduated/CreatorFeesWithdrawn (curve), and standard ERC-20 Transfer (token) events.
  3. The indexer (POST /api/indexer-run, bearer-gated, operator only) scans a bounded window of new blocks, decodes and sanitizes those logs, and writes tokens/trades/holders/candles/burns to D1 — with an advisory lock so overlapping runs can't double-apply holder deltas. Two triggers drive it: a Worker on a one-minute cron, and a traffic-driven fallback throttled to once a minute. See Indexer for the exact mechanics.
  4. Every public API route reads from D1 (and a small KV layer for logos/hide state) — never from the chain directly on the request path. That keeps response times to a handful of milliseconds instead of RPC round-trips, at the cost of indexer lag (typically a few seconds to under a minute; see Indexer for freshness guarantees).
  5. New trades/burns also fan out over a WebSocket push hub for consumers that want live updates instead of polling.

Pages in this section

  • API reference — every public route: tokens, trades, holders, wallet/portfolio, burns, ecosystem stats, media (logos/OG/badges), live push. Admin/indexer routes are documented at the auth-model level only.
  • Indexer — what gets scanned, window sizes, the cursor/lock mechanism, how holder balances are derived from Transfer events, money-math rules, and what freshness a consumer can rely on.
  • Integration recipes — build a token list, a token page, a wallet portfolio, embed burn totals, polling/caching etiquette, CORS, rate limits.

Hatchers (Orchard testnet only, not on mainnet)

Labs has pages about the Hatchery, a proposed feature where every launched token is an egg that can hatch into a creature once its curve has raised enough QUAI: /developers/hatchers (progress, the stage ladder, 36 example creatures) and /developers/hatchers/guide (a plain-words guide).

Since Labs 1.32.0 you can also walk the Hatchery in 3D at Hatcher World: five wings of 60 example creatures, the real Quai block counter, and a labelled corner with the live Orchard testnet eggs (1.33.0). Since 1.35.0 you play it as a Keeper riding Elders; since 1.36.0 three sky isles float over the sea, and the live testnet eggs also grow on Egg Grove. Everything else there is an example.

Since Labs 1.31.0 there is also a public testnet playground: /developers/hatchers/testnet. The Hatchery contract is deployed on Orchard (chain 15000) at 0x007ae402147081E1920dbED40D8AF7DC5fDb94B6 (deploy block 8081720) and was rehearsed end to end (hatch, evolve to Juvenile, holder and Midwife Shells). Four Orchard test eggs are on the page. With Pelagus on Orchard and test QUAI from the Orchard faucet you can warm an egg, hatch it, evolve it, claim Shells, or launch a test egg of your own (the creation fee is read live). The page refuses to send unless the wallet is on chain 15000. Test QUAI has no value, and Orchard can be reset, which would take the test deployment with it.

The stage thresholds are confirmed by the deployed contract: Stirring at 100, Hatch at 500 and Juvenile at 5,000 QUAI raised, Elder when the curve graduates; the Shell window is 7 days and a holder needs at least 100,000 tokens to claim the holder Shell.

Contract-side docs (owned separately): Contracts overview, Token factory, Bonding curve, Launching a token, Integrating the contracts. (Staking is present in the contracts source tree but not yet wired into a live factory — see the note in Contracts — so there is no staking page yet.)

Quai Network mainnet · chain 9 · Cyprus-1. Figures marked "read on" a date were read from the chain that day; re-read before relying on them.