Skip to content

Conversation

@Pulkith
Copy link

@Pulkith Pulkith commented Nov 23, 2025

Pyth Examples Contribution

Type of Contribution

  • New Example Project (Adding a new example to demonstrate Pyth integration)
  • Bug Fix (Fixing an issue in existing examples)
  • Documentation Update (Improving README, comments, or guides)
  • Enhancement (Improving existing functionality or adding features)
  • Hackathon Submission (Submitting a project from a hackathon)

Project Information

Project/Example Name: StakedSocial

Pyth Product Used:

  • Pyth Price Feeds
  • Pyth Entropy
  • Multiple Products
  • Other: ___________

Blockchain/Platform:

  • Ethereum/EVM
  • Solana
  • Aptos
  • Sui
  • Fuel
  • Starknet
  • TON
  • Other: Celo

Description

What does this contribution do?

Adds StakedSocial, a full prediction-market for social circles and friend groups to the entropy examples, built at ETHGlobal Buenos Aires 2025.

How does it integrate with Pyth?

StakedSocial uses Pyth Entropy to provide verifiable randomness or nondeterministic markets as part of the betting app.
The contracts:

  • Request randomness through entropy.requestV2()
  • Receive the callback via the Pyth entropy consumer interface
  • Extract and transform the random value into outcome ranges (simple modulo, cascading-odds, or volatility-boost modes for added fun)
  • Resolve markets based entirely on Pyth’s cryptographically secure entropy
    Allows creating small low-stakes markets and casino-like games for a little bit of fun.

What problem does it solve or demonstrate?

It demonstrates an example that incorporates

  • Live prediction markets, including escrow/staking and resolution mechanisms
  • Using Pyth Entropy for randomness to add fun and nondeterminism to games, while keeping the resolution verifiable and hands-off with customizable settings.
  • Tying messaging, contracts, data storage, and markets into a real-time fun on-chain application

Directory Structure

It is slightly disorganized (code in places it ideally shouldn't be) since it was a hackathon project, but hopefully most of it is pretty self explanatory!

entropy/stakedsocial/
├── README.md
├── LICENSE
│
├── contract/
│   ├── contracts/
│   │   └── Betting.sol
│   ├── scripts/
│   │   └── deploy.ts
│   ├── test/
│   │   └── Betting.test.ts
│   ├── hardhat.config.ts
│   ├── package.json
│   ├── tsconfig.json
│   └── .env.local
│
├── app/
│   ├── package.json
│   ├── next.config.js
│   ├── postcss.config.js
│   ├── tailwind.config.ts
│   ├── tsconfig.json
│   ├── .env.local
│   │
│   └── src/
│       ├── app/
│       │   ├── page.tsx
│       │   ├── layout.tsx
│       │   ├── globals.css
│       │   └── chats/
│       │       └── [chatId]/
│       │           └── page.tsx
│       │
│       ├── components/
│       │   ├── bet-modal.tsx
│       │   ├── place-bet-modal.tsx
│       │   ├── bet-message-card.tsx
│       │   ├── bet-placement-card.tsx
│       │   ├── chat-input.tsx
│       │   ├── chat-message.tsx
│       │   ├── header.tsx
│       │   └── ui/
│       │       ├── button.tsx
│       │       ├── card.tsx
│       │       └── modal.tsx
│       │
│       ├── contexts/
│       │   ├── miniapp-context.tsx
│       │   ├── frame-wallet-context.tsx
│       │   └── socket-context.tsx
│       │
│       ├── hooks/
│       │   └── use-optimistic-messaging.ts
│       │
│       ├── lib/
│       │   ├── market-service.ts
│       │   ├── contract.ts
│       │   ├── chat-metadata.ts
│       │   └── utils.ts
│       │
│       └── public/
│           ├── favicon.ico
│           └── icons/
│
├── backend/
│   ├── server.ts
│   ├── package.json
│   ├── tsconfig.json
│   ├── .env.local
│   │
│   ├── routes/
│   │   ├── markets.ts
│   │   └── messaging.ts
│   │
│   ├── storage/
│   │   └── messages.json
│   │
│   └── utils/
│       ├── validation.ts
│       ├── wallet.ts
│       └── xmtp.ts
│
├── FARCASTER_SETUP.md
├── OPTIMISTIC_MESSAGING_SETUP.md
├── package.json
├── pnpm-workspace.yaml
├── turbo.json
└── tsconfig.json

Testing & Verification

How to Test This Contribution

Please refer to the setup instructions here!
instructions

Prerequisites

  • Node.js version: 22.15.0
  • Other dependencies: Python 3.13.7
  • ngrok

Deployment Information (if applicable)

Network: Celo Devnet + Mainet

Contract Address(es): 0xB0bD3b5D742FF7Ce8246DE6e650085957BaAC852

Demo URL: Did not put it on a dedicated server yet, but I'll keep my laptop on. Add this "https://maia-cymose-patronisingly.ngrok-free.dev" to Farcaster Developer to run the miniapp!

Checklist

Code Quality

  • Code follows existing patterns in the repository <- some (since its a hackathon project, but happy to work on it and finish)
  • Proper error handling implemented <- some (since its a hackathon project, but happy to work on it and finish)
  • No hardcoded values (use environment variables where appropriate)

Testing

  • Tested locally and works as expected
  • All existing functionality still works (no breaking changes) <-didn't do comprehensive tests.

Additional Context

Related Issues

Fixes #

Screenshots/Demo (if applicable)

A couple extra pictures!
BettingP1

BettingP2 png BettingP13png /> BettingP5 BettingP6

Notes for Reviewers

Comprehensive overview + explanations in the top-level README! (link here


Thank you for contributing to Pyth Examples!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant