Skip to content

Architecture

Twin.fun combines on-chain contracts with indexing infrastructure and the application client.

High-Level Flow

Diagram of Twin.fun showing users trading against the DigitalTwinSharesV1 contract, which streams events to the indexer and powers the application backend
Twin.fun routes trades through the bonding curve contract while downstream systems deliver real-time context to the client.
  1. Users / Wallets initiate buyShares or sellShares transactions against the bonding curve.
  2. DigitalTwinSharesV1 maintains balances, supply, and fee routing while emitting events for downstream consumers.
  3. Subgraph / Indexer ingests contract events to expose prices, holders, trades, candles, and protocol stats.
  4. App Backend / Client renders the user experience and verifies key ownership for access control.

OpenGradient 2025