01/Getting started

The LP risk desk that pays its own way

Parity is an autonomous agent on Hedera mainnet that manages its own HBAR/USDC inventory on SaucerSwap V2 and sells the same risk judgement to other agents over x402, with an on-chain slippage guarantee. An optional LLM proposes, a deterministic risk kernel decides, and every verdict is hashed and written to the Hedera Consensus Service (HCS) before anything executes.

It exists because liquidity providers lose money to arbitrageurs in a way most tools never measure, and because an agent buying risk advice has no way to check the seller. Parity measures that loss (loss-versus-rebalancing, LVR), refuses to provide liquidity when fees do not cover it, publishes falsifiable forecasts so anyone can score it, and refunds its fee when a trade it cleared slips more than promised. Its revenue pays for its own HCS messages, swaps, refunds and inference; when the money runs low it slows down instead of asking for a top-up.

  • Risk kernel - eight deterministic guardrails decide; the LLM can only propose
  • x402 desk - toxicity quotes, range plans and guaranteed clearances, paid per call in USDC
  • Public record - decisions, forecasts, P&L, clearances and refunds on three HCS topics

Where everything lives

Gateway paths below are relative to the gateway this build points at, https://parity.mrnetwork.tech (set by NEXT_PUBLIC_GATEWAY_URL). Hedera ids are the mainnet preset in packages/quant-kernel/src/networks.ts.

Landing page
/
Live dashboard
/appPolls GET /status every 8 s and reads HCS topics straight from the Mirror Node in your browser.
These docs
/docs
Gateway status (what /app polls)
GET /status
ERC-8004 registration file
/agent.jsonAlso at /.well-known/agent-registration.json
UCP agent card
/.well-known/ucpAlso at /ucp.json. Live prices, guarantee policy, audit topics.
Track record
GET /track-record
Guarantees and claims
GET /guarantees, GET /guarantees/:id, POST /guarantee/claim
Paid x402 endpoints
GET /x402/toxicity-quote, POST /x402/rebalance-plan, POST /x402/protected-execute
HCS decision topic
0.0.10977368
HCS P&L topic
0.0.10977369
HCS track-record topic
0.0.10977370
SaucerSwap V2 HBAR/USDC pool
0.0.3964804The pool the desk trades, prices and clears against.
USDC (x402 asset and pool stable)
0.0.456858
WHBAR (treated as HBAR in claims)
0.0.1456986
Hedera Mirror Node
https://mainnet.mirrornode.hedera.com
x402 facilitator (Blocky402)
https://api.blocky402.com
ERC-8004 IdentityRegistry (Ethereum)
0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
ENS Universal Resolver
0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe
ENS name
ENS_SUBNAMEThe example in .env.example is desk.parity-vault.eth.
Uniswap v4 PoolManager (Unichain 130)
0x1F98400000000000000000000000000000000004The LVR Shield hook is not deployed yet; see the hook page.

The stack, in one paragraph

A pnpm 9 workspace on Node 22 or newer. packages/quant-kernel is pure TypeScript with no I/O: volatility, toxicity, LVR and range EV, the risk kernel, forecasts, pool math, guarantee adjudication, pricing and treasury. apps/agent runs the loop with @hashgraph/hedera-agent-kit 4.2, saucer-swap-plugin 0.3, @hiero-ledger/sdk 2.91 and viem 2.58, and keeps its memory in .parity/agent-state.json. apps/x402-gateway is a Hono 4 server with @x402/hono and @x402/hedera 2.33 settling through the Blocky402 facilitator; it persists its books to .parity/gateway-state.json. apps/web is Next.js 16 on React 19 with no UI library. contracts/ens (@parity/ens, viem) reads and writes the ENS mandate, and contracts/uniswap-v4 is a Foundry project for the hook. Every service loads the repo-root .env through --env-file-if-exists=../../.env; the operator key lives only in the agent and gateway processes, and the web app sees nothing but NEXT_PUBLIC_* values.

Reading order

  1. 01

    How it works: the loop in five stages and the life of one decision

  2. 02

    Risk kernel: why an LLM can propose a trade but never force one

  3. 03

    Slippage guarantee: what a paying agent gets, and when the fee comes back

  4. 04

    Track record: how to recompute the forecasts yourself from HCS

  5. 05

    HTTP API: every route, price and payload in one place

  6. 06

    Limits and FAQ: what is live, what is preview, and what is not built