@CanIBetOn
Bet on anything. Our AI agent launches betting pools for any topic. Outcomes are decided by AI via Chainlink Functions. Tag @CanIBetOn on X and you will be quoted with the link to your pool in ~30sec
Created on 1st March 2025
•
@CanIBetOn
Bet on anything. Our AI agent launches betting pools for any topic. Outcomes are decided by AI via Chainlink Functions. Tag @CanIBetOn on X and you will be quoted with the link to your pool in ~30sec
The problem @CanIBetOn solves
Current onchain betting markets suffer from two key issues:
- Permissionlessness
- Settlement
Permissionlessness
Popular prediction markets such as Polymarket rely on a team of manual reviewers to create new markets based on user requests. There is currently no way for users to launch arbitrary markets themselves, leading to unmet demand especially for niche proposition bets.
Settlement
All betting markets must rely on some entity or system for the final decision on which side has won. While solutions such as UMA provide a robust mechanism for determining the truth of a given proposition, it relies on a dispute resolution process which can be time-consuming and controversial. Furthermore, these solutions may struggle to scale to support thousands of individual bets per day.
Solution
Our agent solves both of these problems by enabling users to instantly launch betting pools directly from X posts and deciding bet outcomes via an AI oracle. By leveraging a ubiquitous and easy-to-use interface like X posts, anyone is now easily able to create a market for any bet without a manual approval process. Furthermore, utilizing an AI oracle to decide bet outcomes eliminates reliance on potentially-biased human arbiters or costly dispute resolution processes, while providing the potential for scalability which these solutions lack. By combining an instant bet creation with AI settlement, @CanIBetOn enables anyone to bet on anything.
User Interaction and Data Flow
Betting Pool Creation
- The user makes an X post on tagging the AI agent with a topic or specific proposition
- The AI agent receives the post and begins analysis.
2.1 If the post provides a specific proposition, a new betting pool is created onchain for the proposition.
2.2 If the post only provides a general topic, the agent will fetch recent news about the topic and generate a random new bet based on that context before creating the onchain betting pool. - Once the betting pool is created onchain, the agent posts to X quoting the user’s original post, providing all betting pool details and a link to the frontend where anyone submit bets.
Submitting Bets
- Users can place bets by visiting the frontend by clicking a direct link from an X post or by browsing the list of available pools from the homepage.
- Once a user attempts to place their bet, if they are not yet signed in, they will be prompted to sign in with Privy.
2.1 Users have the option to sign in with X, email, or using passkeys meaning that users can create accounts using Face ID on their phones or by leveraging an existing password manager.
2.2 Signing in with Privy automatically generates an embedded wallet for the user which they are able to use to place bets. - After signing in, users can place a bet by signing a message to permit a USDC allowance for the bet amount.
Deciding and Paying Out Bets
- To determine when to decide (ie: “grade”) and pay out a bet, the AI agent iterates through all open betting pools on a set interval to check if the conditions have been met for grading (ie: an event has occurred, a date has been reached, etc.).
- If the conditions to trigger grading have been met, the agent calls the smart contract function to grade the bet which sends a Chainlink Functions request to the decentralized oracle network.
- The oracle nodes then each run the verification, reaching consensus on the outcome for the bet before returning the winning option to the contrac
The project architecture and development process
Sponsors/Key tech
- Coinbase/Base - Our app has been powered by Base Sepolia testnet for the duration of the hackathon, and we started a mainnet deployment too. Our subgraph is also indexing Base Sepolia.Base is a natural pick for this project since it supports solidity and has extremely low gas fees.
- Chainlink - We use Chainlink Functions the manage grading betting pools in a decentralized way
- The Graph - We use The Graph to index our bets and pools to display stats + use it for real time updating in the frontend w/ subgraph subscriptions. Our production app runs against Subgraph Studio here
- Privy - We use Privy's embedded wallet universally across the app and intend to use its funding onramp later to avoid having to go through so many menus to place bets w/ traditional web3 wallets. You can see the privy integration in our automatic faucet/top up here, how we use it to sign in and sign up here
- Alchemy - Alchemy is our private RPC provider. Private RPCs were critical for managing gasless transactions, we built our backend around Alchemy
- LangGraph
Product Integrations
AI Agent
The AI agent was built using Langchain, GPT-4o, and Perplexity; it also uses Tavily for gathering real world real-time context data for generating and grading bets. Additionally, we also implemented support for launching betting pools directly from Telegram as we learned during live user testing that some users were hesitant to post betting pools from their public X accounts.
Frontend
The frontend was built using Next.js and is deployed to Vercel. It is supported by a custom blockchain indexer deployed to The Graph. Privy was used as the wallet provider to provide a “Web2-like” experience for interacting with the protocol and completely abstracting away any blockchain complexities.
Onchain Components
The smart contract is currently deployed to Base Sepolia and Base Mainnet, however only the Base Sepolia testnet deployment has been made available to users at this time. Additionally, Chainlink Functions provides decentralized, trustless infrastructure for LLM queries to grade bets. We also leveraged the EIP-2612 standard for gasless token approvals so that users only need to hold USDC to interact with the protocol. A mock deployment of the USDC contract was used on testnet such that we can automatically mint tokens to users for testing.
Key differentiators and uniqueness of the project
Our project takes inspiration from Polymarket for the concept of onchain betting markets, as well as Clanker which is an AI agent that allows users to automatically launch custom tokens via social media posts tagging the agent account.
The key differentiators from Polymarket are:
- Enables anyone to create a betting pool based on any topic or decidable statement
- Instantly creates betting pools without manual approval
- Eliminates dependence on potentially-biased human arbiters
- Provides infrastructure for grading bets at scale
The key differentiators from Clanker are:
- Creates betting pools instead of tokens, which are more familiar and accessible to traditional Web2 users, providing significantly higher potential for onboarding more normies
- Utilizes a more sophisticated AI agent to generate betting pools, determine when to grade bets, and grade bet outcomes
Additionally, we sought to set ourselves apart from many Web3 projects by completely abstracting away any blockchain complexity, providing users a simplified experience similar to many Web2 sports betting platforms that anyone can figure out how to use in under 30 seconds. Users are never prompted to connect to an existing Web3 wallet, manage their own transactions and gas, or directly interact with any tokens; they only need 2 clicks to place and confirm their bets. Furthermore, users don’t even need to create a new account as they can leverage an existing email address, passkey or X account for a seamless login experience. Finally for the mainnet deployment, the integrated Coinbase Onramp in Privy allows users to easily deposit funds using only a debit card or Apple Pay.
Trade-offs and shortcuts while building
The most significant simplification we made was ignoring many of the complexities of market-making and implementing something akin to an “order book” model for matching bets instead of an AMM model. This is why we implemented betting pools instead of continuous prediction markets. We made this simplification because we knew developing robust market-making logic would have significantly increased the scope. Furthermore, we also knew that there are already existing market-making techniques utilized by Polymarket and other protocols; therefore we preferred to focus on demonstrating novel functionality as opposed to replicating features from other products that we know we can add in the future.
Another simplification we made on the testnet deployment is running our AI grading logic in our centralized backend and having Chainlink Functions query a backend endpoint to get the result instead of running the LLM grading queries directly on the decentralized oracle network. While it is fully possible to implement the required logic entirely within Chainlink Functions, this would have added complexity when debugging due to the lack of access to logs within the Functions runtime and increased friction when deploying updates. However, as the AI logic is finalized, it can be implemented for the Chainlink Functions runtime on the mainnet deployment to ensure trustlessness and transparency.
Additional Features
This is a new project that our team started building during the BUIDLathon.
Tracks Applied (1)
Build an AI-powered app on Base
Base