Building Apps on Twin.fun
Use the bonding curve contract and subgraph to build dashboards, bots, and custom experiences.
Read-Only Integrations
- Surface prices, candles, trades, and holders from the subgraph.
- Display supply, last trade price, estimated slippage, and fees.
Access Control
- Verify key ownership by reading
sharesBalance[id][user]on-chain or consuming theHolderentity from the subgraph. - Gate features based on balance thresholds (commonly ≥1 key).
Event-Driven UIs
- Subscribe to the
Tradeevent to update prices, holders, and activity feeds in real time. - Combine event streams with subgraph polling for resilient UX.
Security Checklist
- Display fee and value breakdowns before executing buys.
- Warn users that
buySharesrequires the exactmsg.value. - Handle chain reorgs by waiting for confirmations on critical UX state.
