System
Architecture
PrimerPad is an application layer around native Meteora programs. It decides which quote assets are allowed, compiles and owns the configs, watches markets through their lifecycle, and accounts for what PrimerPad earns.
System layers
User experience
Primer application
Solana infrastructure
Liquidity engine
Financial Primitives
| Component | Code | Role |
|---|---|---|
| Primitive Registry | src/primitives | Primitive to quote mint mapping, statuses. |
| Certification engine | src/certification | Mint inspection, live DBC simulation, proof linkage, routing and supply checks. |
| Config Factory | src/config-factory, src/policy | Compiles Primer Standard v1 per quote; graduation-gated; persists config addresses and history. |
| Launch service | src/engine | Thin facade over the Meteora DBC and DAMM v2 SDKs. Every transaction goes through one safety-checked sender. |
| Indexer | src/indexer | Event stream and market state per PrimerPad market. |
| Migration watcher | src/services/migration-watcher.ts | Graduates PrimerPad markets; idempotent state machine. |
| Treasury accounting | src/treasury | Read-only accrued, claimable, claimed per quote mint; manual buyback ledger. |
| Network layer | src/lib/network.ts | The only place cluster endpoints resolve; cluster identity checks; secret redaction. |
Transaction safety
- 01Verify clustergenesis hash must match
- 02Fresh blockhash
- 03Expected accountsquote mint, config, pool present
- 04Simulateabort on error
- 05Payer balance
- 06Send + confirmrecord slot, time, accounts
Mainnet sends additionally require that execution was armed by an interactive confirmation (and --execute-mainnet). An environment change cannot point a devnet run at mainnet: the genesis hash check fails first.
Helius infrastructure
Helius provides infrastructure, not market logic. Meteora remains the launch and liquidity engine.
- 01User
- 02PrimerPad app
- 03Primer backendlaunch service, indexer, watcher, accounting
- 04Helius RPC / WebSocketreads, simulation, transaction submission, log subscriptions
- 05Solana
- 06Meteora DBC / DAMM v2
- Endpoints come from
HELIUS_MAINNET_RPC_URL,HELIUS_DEVNET_RPC_URLand the matching WSS variables in server-side environment files. They are never bundled into the browser, and logs redact the API key. primer rpc-checkverifies reachability, cluster identity, blockhash, slot, latency, WebSocket and both Meteora program accounts. LIVE CHAIN READ
Indexer
Browsers read PrimerPad's index instead of polling Solana. RPC reconciliation is the source of truth: the indexer backfills every transaction touching a market's DBC pool (and, after graduation, its DAMM v2 pool) from a persisted cursor, so it recovers after downtime. WebSocket log subscriptions only trigger reconciliation early.
| Event | Detected from |
|---|---|
| TOKEN_CREATED, PAIR_LAUNCHED | InitializeVirtualPool instruction |
| SWAP | Swap / Swap2 instruction; amount = exact quote-vault balance change |
| CURVE_PROGRESS | graduation crossing a 10% step between reconciliations |
| FEE_ACCRUAL | pool fee metrics increasing |
| PARTNER_FEE_CLAIM, CREATOR_FEE_CLAIM | ClaimTradingFee / ClaimCreatorTradingFee; amount = vault outflow |
| MIGRATION_READY | quoteReserve reaching the threshold |
| MIGRATED | MigrationDammV2 instruction |
| DAMM_SWAP, LP_FEE_CLAIM | DAMM v2 Swap / ClaimPositionFee on the graduated pool |
Per market it maintains: mint, quote mint, Primitive, config, DBC pool, DAMM v2 pool, creator, created time, status, price, market cap (quote and USD where priced), quote reserve, graduation %, volume, trade count, PrimerPad fees and creator fees (claimed, claimable, accrued), and the migration transaction.
PUBLIC DEVNET Indexed devnet markets: 3. Events recorded: TOKEN_CREATED 3, PAIR_LAUNCHED 3, SWAP 9, PARTNER_FEE_CLAIM 3, CREATOR_FEE_CLAIM 3, MIGRATED 3, DAMM_SWAP 2, LP_FEE_CLAIM 2, MIGRATION_READY 1, FEE_ACCRUAL 1. Claim amounts match the proof logs to the unit.
What PrimerPad builds vs what Meteora builds
| Meteora (on-chain programs) | PrimerPad |
|---|---|
| Bonding curve math and virtual reserves | Financial Primitive registry |
| Quote vault and base vault behaviour | Primitive certification (including TokenBadge verification) |
| Swap execution | Quote selection: Primitive to quote mint |
| Fee mechanics and the protocol fee | Config management (Primer Standard v1, per-quote normalisation) |
| Migration instruction | Creator launch experience |
| DAMM v2 pools and fees | Operational status (engine compatibility vs launch availability) |
| Liquidity positions and permanent lock | Graduation feasibility |
| TokenBadge issuance | Migration monitoring and submission |
| Market indexing, treasury accounting, discovery (Explore), analytics | |
| Routing abstraction (planned) |
Why this is not a reskinned frontend
A frontend cannot decide which financial assets are safe quote mints, compile per-asset configs, refuse launches an asset cannot support, graduate markets an external keeper may skip, or account for multi-asset fee revenue. Those decisions are the PrimerPad layer; Meteora supplies the market primitives they act on.
Routing
The canonical pair is always TOKEN / PRIMITIVE. Routing changes how a buyer pays, not what the market is.
| Mode | Meaning | Status |
|---|---|---|
| DIRECT_QUOTE | The buyer already holds the quote Primitive and swaps on the DBC pool. | Live in the engine |
| AGGREGATED_INPUT | A router converts SOL (or USDC) into the quote Primitive, then buys on DBC, in one transaction. | Architecture only, not deployed |
Aggregated input depends on route depth: today only USDX has a usable SOL route; the Ondo tokens have none or very thin ones, which certification reports.
See also: Evidence, Security model, TokenBadges