Trade internet attention itself through onchain long/short markets settled by a live index.
World Attention Markets is a topic-based trading system for internet attention. Instead of buying a proxy asset and hoping it reflects a trend, users can trade a market tied directly to a live Attention Index for a keyword or narrative. The index is computed offchain from external data sources, smoothed for stability, and committed onchain through Chainlink CRE for deterministic settlement.
This repo contains:
contracts/: Foundry smart contracts for market creation, trading, settlement, and oracle storagefrontend/: Next.js app for creating markets, trading positions, and using the faucetcre/: Chainlink CRE workflow that computes the attention index from external data and submits reports onchain
The system has two layers:
- CRE pipeline: fetches attention data from Google Trends, Twitter, and YouTube, combines it into a weighted score, smooths it with an EMA, and normalizes it into a bounded index.
- Onchain market layer: creates topic-specific markets, supports long and short exposure, and settles against the official index values written onchain by the CRE workflow.
Chainlink CRE is the orchestration layer between those two parts. It runs the workflow that reads external data, computes the latest Attention Index, and writes settlement data onchain.
cre/wam-workflow/main.gocre/wam-workflow/aggregator.gocre/wam-workflow/fof/list.gocre/wam-workflow/lens/read.gocre/wam-workflow/mf/balance.gocre/wam-workflow/mf/read.gocre/wam-workflow/mf/write.gocre/wam-workflow/sourcer/google_trends.gocre/wam-workflow/sourcer/twitter.gocre/wam-workflow/sourcer/youtube.go
contracts/src/keystone/ReceiverTemplate.solcontracts/src/MarketFactory.solcontracts/src/Oracle.sol
cre/wam-workflow/main.go: workflow entrypointcre/wam-workflow/aggregator.go: weighted attention score aggregationcre/wam-workflow/sourcer/google_trends.go: Google Trends ingestioncre/wam-workflow/sourcer/twitter.go: Twitter ingestioncre/wam-workflow/sourcer/youtube.go: YouTube ingestioncre/wam-workflow/mf/write.go: report generation and onchain writes through CRE
FactoryOfMarketFactories: deploys topic-specificMarketFactoryclones and collects creation feesMarketFactory: owns one oracle, manages market rollover, receives CRE reports, settles the previous market, and seeds the next oneMarket: holds collateral, tracks long/short pools, and handles mint, burn, and redeem flowsOracle: stores index rounds and a rolling EMA windowLens: batches read operations for the frontend and workflowRouter: shared app write entrypoint
The system has an initial creation flow and a recurring update flow.
- A user calls
FactoryOfMarketFactories.createMarketFactory(name, symbol). - The factory-of-factories deploys a new
MarketFactoryclone for that keyword and transfers the creation liquidity into it. - The new
MarketFactoryinitializes its ownOracleclone and enters a pre-live state, waiting for its first workflow report. - The CRE workflow detects the new factory, fetches external attention signals for the keyword, computes the Attention Index and EMA, and submits that report onchain.
- The
MarketFactoryreceives the report, stores the new oracle round, creates the firstMarket, and seeds its long and short collateral pools using the factory’s deposited liquidity. - The market is now live and users can mint or burn long and short position tokens against the active pool.
- On each scheduled workflow run, CRE reads the latest onchain state for a factory and fetches fresh offchain attention data for the same keyword.
- The workflow recomputes the latest Attention Index and EMA, then generates and submits a new signed report onchain.
- When
MarketFactoryprocesses that report, it first updates theOraclewith the new round. - If a previous market is active, the factory settles it against the new oracle round and redeems the remaining long and short collateral back into the factory.
- The factory then creates a fresh market and reseeds it using the recycled collateral balance, split between long and short according to the new index value.
- Users continue trading on the new active market until the next workflow update rolls the system forward again.
├── contracts/ Foundry project
├── frontend/ Next.js 16
├── cre/ Go-based Chainlink CRE workflow
├── deployment.txt
├── LICENSE
└── README.md
This software is experimental and unaudited, and is provided on an 'as is' and 'as available' basis. We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.