Town Square is a cross-chain 1:1 simulation of live on-chain activity - we mirror every user of popular dApps and protocols as an avatar inside of a 2D virtual metaverse world. These avatars can be seen interacting with contract functions as "booths," coming in and out of on-chain sessions (represented as navigation in and out of the main game area), and moving between protocols and chains, all in real time. Our vision for Town Square is to recreate the bustling energy of real-world spaces and bring together DeFi traders, degens, NFT communities in a single persistent game world that evolves in sync with the blockchain.
From the bottom of the stack, up:
- Our on-chain data firehose / backend taps directly into on-chain activity with a series of event listeners that ingests and indexes a steady stream of blockchain data.
- This stream is then filtered to target specific dApp protocols - Aave, Opensea, Uniswap, and ENS, across the Optimism, Polygon, and ETH chains.
- The core business logic tracks these tx's block-by-block, using a number of session identification heuristics to group each wallet's transactions into combined user journeys across chains and protocols (e.g. bridge to Optimism -> swap to USDC -> lend in AAVE).
- Once interpreted, this data is then translated to action sequences (e.g. SPAWN -> MOVETO (Uniswap Swap Booth) -> APPROVE -> [after TIMEOUT_BLOCKS] MOVETO (exit) -> DESPAWN) that an in-game avatar replays inside the game world.
- In-game crowd and player pathfinding with some basic randomization tweaks to simulate real-time crowd movement and flocking behavior.
- In-game map with waypoints ("booths") for each contract function tracked, across protocols (built with Tiled Map Editor)
- Action Popups that use common Game UI (status popups) to represent a continuous feed of on-chain actions.
- (Real) Town Square players can move around, interact with, and people watch as cross-chain activity is recreated 1:1 in real time inside of the game - all of the game's NPCs are real people interacting with Web3 in real life!