
Assay-2
A pay-per-query onchain credit bureau an AI agent buys from with only a wallet, no API key.
Demo
About
Assay is a pay-per-query onchain credit bureau with an autonomous transfer agent. It scores any wallet's creditworthiness from live on-chain lending data — account maturity, leverage, past liquidations, portfolio quality, and counterparty hygiene — using a transparent, deterministic model. The LLM never computes the score, so any result is fully recomputable and a blocked user can be told exactly why. Scores are sold per query behind an x402 paywall: a caller pays a fraction of a cent in HBAR and gets a score back — no signup, no API key, just a wallet. That makes the bureau consumable by AI agents, not only humans. On top runs an autonomous agent that buys scores, underwrites a tokenized credit line (an ERC-20 whose transfers are gated by an on-chain eligibility list), and issues or revokes it on Hedera. The payoff: when a holder is liquidated, the agent re-scores them, revokes the line, and their next transfer reverts on-chain — off-chain intelligence, enforced on-chain.
How it's made
A single Next.js 15 / React 19 app plus a Hardhat contract, TypeScript throughout, Neon Postgres for the console read-model. Everything is dependency-injected so mock and live adapters share interfaces, backed by 169 passing unit tests. The Graph — scores are computed from the Messari standardized lending subgraph (Aave V3) via the gateway with Bearer auth. The account-level liquidation counter was unreliable, so we count liquidations directly from liquidates events — that fix is what makes the re-score → revoke beat real on live data. Hedera — the CreditToken (ERC-20 + Ownable, with an eligibility control-list enforced in _update) is deployed to Hedera testnet via the Hashio JSON-RPC relay and verified on Sourcify. Pay-per-query is x402, settled by the Blocky402 facilitator in native HBAR (feePayer partial-signing). Privy — a Privy server wallet is the autonomous agent that signs every issue/revoke. Privy signs but doesn't broadcast to Hedera, so we sign the chain-296 transaction with Privy and self-broadcast via ethers — that's what unlocked Privy-on-Hedera. Hacky bits: we reverse-engineered Blocky402's x402 v2 payload from its validation errors — native HBAR is asset id 0.0.0, and the v2 payload carries the chosen requirements under accepted, not top-level scheme/network. We build the Hedera payment with @x402/hedera + @hiero-ledger/sdk because hand-rolled @hashgraph/sdk bytes drifted from what the facilitator decodes.