Skip to content

phdargen/trueCastAgent

Repository files navigation

TrueCastAgent

TrueCast Logo

TrueCastAgent powers the TrueCast mini app on Farcaster, a new way to participate in prediction markets that's fast, social & onchain.

Tip

TrueCast

  • Daily notifications for trending prediction markets from TrueMarkets
  • Quick bets directly from the social feed
  • Notifications upon market resolutions and easy reward claims
  • Activity feed leveraging the social graph

TrueCastAgent

Built with CDP AgentKit, automates several key functions:

  • Maintains up-to-date onchain information of prediction markets
  • Categorizes markets (politics/sports/etc.)
  • Selects daily featured markets considering liquidity + latest news relevance
  • Posts market analysis on Farcaster
  • Makes automated bets using a $100 monthly allowance from a Safe wallet via 0x

Code: myAgent/

TrueCast API (x402)

A news aggregator for fact-checking and verified insights that aggregates real-time data sources and grounds them by prediction market odds:

  • Orchestrator model selects optimal data sources (Perplexity, X AI + Neynar, DeFiLlama, TrueMarkets)
  • AWS Bedrock ApplyGuardrail API provides contextual grounding checks with quality scores
  • x402-protected with agent access via CDP AgentKit integration
  • Farcaster integration: tag @truecastagent with queries, context-aware in cast threads
  • CDP v2 user wallets created per Farcaster ID for seamless payments
  • Optional IPFS storage via Pinata for immutable fact-checking records

Code: neynar-webhook/ (Farcaster integration), x402-next-standalone/ (API & chat interface)

Scripts

  • npm start: Runs the main TrueCastAgent that posts analysis and makes bets
  • npm run update-markets: Updates and categorizes market data from TrueMarkets
  • npm run select-featured-market: Selects the daily featured market based on liquidity and news relevance

GitHub Actions

  • update-markets.yml: update market data
  • featured-market.yml: select the featured market
  • truecast-agent.yml: post analysis and make automated bets

AgentKit Enhancements

This repository uses a forked version of CDP AgentKit with several new features:

  • Trading via 0x #681
  • Truemarkets information integration #614
  • Post embeds on Farcaster + media on Twitter #675
  • Safe wallet provider #330

Clone the Repository

This repository contains submodules. To clone the repository with all submodules, use:

git clone --recurse-submodules https://github.com/phdargen/trueCastAgent.git
cd trueCastAgent

If you've already cloned the repository without submodules, you can initialize and update them with:

git submodule init
git submodule update

Build Instructions

  1. Build the AgentKit module:

    cd cdp-agentkit/typescript
    pnpm i && pnpm build
  2. (Optional) Run the interactive chatbot example:

    cd cdp-agentkit/typescript/examples/langchain-cdp-chatbot
    pnpm run start
  3. Build and run myAgent:

    cd myAgent
    npm install
    npm start

About

TrueCastAgent powers the TrueCast mini app on Farcaster

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •