Skip to main content

Architecture overview

Foundry project, Solidity 0.8.28 (via-IR), OpenZeppelin 5.x. Every index launch is a pair of cheap contracts (an EIP-1167 clone + a tiny treasury) wired to four shared singletons.

Contract inventory

ContractKindRole
FeeRegistrySingletonGovernance config: reserve asset (USDG), router, protocol treasury, launch fee, fee cap, stock allow-list, guardian pause
IndexFactorySingletonPermissionless launchpad — clones the token, deploys the RFV treasury, mints 1%/99%
FeeProcessorSingletonPermissionless fee conversion: swap → split → buy stocks → distribute
TreasurySingletonInterim protocol fee sink (Ownable2Step; migrates to the $IPAD-redeemable ProtocolTreasury later)
IndexTokenPer index (clone)Fixed-supply fee-on-transfer ERC-20 with the embedded keeper-free dividend accumulator
IndexTreasuryPer indexRFV vault: accrues USDG, redeem() burns tokens for pro-rata reserve — see RFV & redemption
FeeTokenBase (abstract)Fee-on-transfer base: immutable fees, AMM-pair registry, releaseFees()
ProtocolToken / ProtocolTreasuryIn repo, not deployedFuture $IPAD token + redeemable treasury — the migration target once $IPAD launches

Protocol constants

All in libraries/Constants.sol, enforced on-chain:

ConstantValueMeaning
MAX_FEE_BPS1000Hard cap on buy/sell fee (10%) — per-token fees immutable after launch
PROTOCOL_SHARE_BPS100010% of every converted fee → protocol treasury (fixed)
NON_PROTOCOL_BPS9000The creator-splittable pool: rfvShareBps + distribution share
DEFAULT_RFV_SHARE_BPS1500UI default: 15% RFV / 75% holder distribution
LAUNCH_PROTOCOL_BPS1001% of supply minted to the protocol at launch
MAX_BASKET_SIZE16Gas bound on the O(N) accumulator

Trust model

  • Immutable per token: fees, basket, rfvShareBps, supply. The creator's only post-launch power is registering genuine AMM pairs.
  • Governance (registry owner): the stock allow-list, router, treasury addresses, launch fee, and a guardian pause (blocks new launches and conversions — never claims or RFV redemptions).
  • Nobody: can mint, change a fee, touch the RFV reserve, or block a holder's claim/redeem.

Off-chain stack (optional, non-trusted)

ComponentWhereNotes
Indexer (Ponder + Postgres)RailwayRead-only event indexing for the app — API reference
Web app (Next.js + wagmi/viem)VercelUI only; every action is a direct wallet transaction
Convert poker (keeper/)anywhereOptional cron that calls the permissionless convert() — no special rights