Skip to documentation
Resources/Docs
Start hereSinjoh v2

Protocol architecture

How contracts, per-market accounting and off-chain services fit together.

3 min read·
On this page

The market is the accounting boundary

A market is identified by its original (hook, poolId). The hook owns its trading and liquidity rules; its vault owns reserve accounting. Approving a new hook version does not rewrite an existing pool’s address or economics. A pool ID alone is insufficient to select a Sinjoh market across versions.

ComponentResponsibility
Launch factoryCreate and initialize a fixed-supply token, vault, canonical pool and optional route/first buy atomically.
Launch hook / market hookSettle trades and taxes, manage liquidity, maintain market inventory, enforce creator controls and floor mechanics.
Market vaultTrack protected floor cash, spendable treasury and current/draining yield positions.
Settings / GovernanceRecord compatible versions, feeds, paths and service authority; execute current-Safe administration.
Lens / QuoterRead consistent accounting and simulate actual fills; neither is a treasury or signing authority.

Revenue and rewards are separate layers

  1. 01Hook fee buckets
  2. 02Creator route / platform router
  3. 03Converter or direct action
  4. 04Recipient / floor / treasury / reward pot

Creator routes allocate creator revenue. The platform router handles protocol revenue with a separate per-asset ledger. The converter executes approved conversions for recognized callers. Airdrop and raffle contracts reserve their own obligations; the rewards desk settles market-owned reward shares into the correct market.

Services observe and execute bounded work

ServiceWhat it does
KeepersCollect fees, maintain liquidity, run routes, sweep eligible inventory and settle rewards when authorized and economically due.
Reward attesterReconstruct holder history, apply eligibility rules, publish reproducible inputs/results and post closed-round commitments.
Randomness proverProduce proofs for posted raffle commitments; the on-chain verifier checks the result.
Indexer / APIDiscover market/version relationships and expose indexed history with observation blocks, confirmation state and lag.
Application / SDKPresent state, obtain quotes and build user-signed transactions against a specific manifest.

Where assets live

Uniswap PoolManager custody can represent balances as ERC-6909 claims. Hook inventory, fee buckets, vault floor cash, vault treasury, yield shares and reward reservations are different ledger categories. A raw contract balance is not a substitute for these accounts. Accounting must avoid counting an underlying asset, its receipt and its claim value more than once.