An autonomous onchain trivia game hosted by artificial intelligence
Prize Pool
The idea behind this project was an AI-hosted onchain trivia game. Games are hosted autonomously, including everything from game creation to judging users responses and picking a winner.
The process works like this: first, the agent initiates a game with a title, entry fee, and rough guidelines including the number of questions that will be asked, the duration users will have to answer those questions, and the maximum number of players per game.
Following that is a period where players can pay an entry fee to join the game's lobby. After the countdown is complete, the agent will generate the previously specified number of questions, and a game will begin for the previously specified duration (both enforced onchain). Users can answer as many times as they'd like within this period, and their last answers will be taken as final.
Lastly, the agent judges all responses according to the questions and picks a winner to receive everybody else's entry fee.
This project uses AgentKit to autonomously operate the onchain game show. I added custom tools so it would know how to read from the contract, create custom transactions, and also do offchain tasks like notify Farcaster users when its time to play a game they'd previously joined via frame notifications.
I wanted to avoid using an offchain indexer, so ended up doing some weird log filtering on both the frontend and backend to get data directly from an RPC.