DarkCircle Suite Docs
Docs / Circleswap

⚡ Circleswap Live reads

The Quai DeFi dashboard: real-time pool analytics, constant-product swap math, liquidity provision, and a chain-driven Farms & Pools page with an owner admin dashboard. Source: q0/ · Route: /q0/

What it does

Architecture

PackageWhat it is
apps/stats-app/React + TypeScript single-page dashboard on Vite; dark glassmorphism theme in vanilla CSS
packages/quai-service/Shared ESModule service client wrapping Quai JSON-RPC, AMM swap formulas and explorer REST APIs

Configuration: RPC https://rpc.quai.network/cyprus1, explorer https://quaiscan.io/api/v2, target shard Cyprus-1 (Region 0, Zone 0; byte prefix 0x00).

Build and run

cd q0
pnpm install
pnpm build        # compile the workspace
pnpm dev          # local dashboard on http://localhost:4100/

Wallet and signing

Transactions are signed by your own wallet extension (Pelagus, MetaMask). Every app in the suite treats an injected wallet as untrusted input: a provider that throws or lacks events is reported as absent rather than allowed to break the page, and Circleswap shows a crash screen with details instead of a blank page.

Static-hosting behaviour

CORS

Neither the explorer's indexed stats nor Quainance's launchpad catalog send a CORS header, so the hosted page does not request them: USD values come from pool reserves, and Hartii / POOP / curve launches come from a snapshot taken at deploy time and labelled with its date. Token metadata is unaffected: it uses the CORS-open /api/token/<address> endpoint and the RPC.

Token metadata decoding is chain-first: decimals never come from the explorer and are never defaulted to 0; icon URLs are resolved, TTLed and negative-cached. The gate is node --test q0/packages/quai-service/test/tokenMetadata.test.ts.

Audit status

q0/SECURITY_AUDIT.md is an internal, AI-assisted review — not an external audit.