Production-ready permissionless oracle SDK with HTTP 402 micropayments on BNB Chain
π Website β’ π Twitter β’ π Docs β’ π Contract
S402Facilitator Contract:
0x605c5c8d83152bd98ecAc9B77a845349DA3c48a3
β Production Ready β’ β Verified on BSCScan β’ β Fully Functional
Sora Oracle is a fully permissionless oracle SDK that lets you create prediction markets with trustless data feeds. No centralized oracles, no gatekeepers - just AI-powered API discovery, cryptographic verification, and s402 micropayments.
β
Permissionless Oracle - AI discovers and verifies APIs automatically
β
s402 Micropayments - HTTP 402 payments using USDC on BNB Chain
β
Multi-Wallet Parallelization - 10x faster than sequential transactions
β
23 Smart Contracts - Production-ready market types (binary, multi-outcome, AMM, orderbook, conditional)
β
TypeScript SDK - React hooks for zero-boilerplate integration
β
Mainnet Deployed - Live on BNB Chain
npm install @sora-oracle/sdkimport { SoraOracleSDK } from '@sora-oracle/sdk';
const sdk = new SoraOracleSDK({
chainId: 56, // BNB Chain Mainnet
rpcUrl: 'https://bsc-dataseed.binance.org/',
s402FacilitatorAddress: '0x605c5c8d83152bd98ecAc9B77a845349DA3c48a3'
});
// Create a prediction market
const market = await sdk.createMarket({
question: "Will BTC hit $100k by Dec 31, 2025?",
type: "binary",
deadline: "2025-12-31T23:59:59Z",
payment: {
token: "USDC",
amount: "0.05" // $0.05 USDC payment
}
});
console.log(`Market created: ${market.id}`);sora-oracle-sdk/
β
βββ π README.md # You are here
βββ π QUICK_START.md # 5-minute guide
βββ π CONTRIBUTING.md # Contribution guide
βββ π LICENSE # MIT License
βββ π package.json # v5.0.0
β
βββ π contracts/ # 23 Smart Contracts
β βββ S402Facilitator.sol # β s402 payment settlement (DEPLOYED)
β βββ SoraOracle.sol # Core oracle with bounties
β βββ SimplePredictionMarket.sol # Binary (yes/no) markets
β βββ MultiOutcomeMarket.sol # 2-10 outcome markets
β βββ OrderBookMarket.sol # Limit order book trading
β βββ AMMPredictionMarket.sol # AMM-style liquidity pools
β βββ ConditionalMarket.sol # Markets with linked outcomes
β βββ RangeBettingMarket.sol # Bet on price ranges
β βββ TimeSeriesMarket.sol # Statistical predictions
β βββ PancakeTWAPOracle.sol # Manipulation-resistant TWAP
β βββ BatchOracleOperations.sol # Batch 20 questions (30% gas savings)
β βββ OracleReputationTracker.sol # Provider performance tracking
β βββ DisputeResolution.sol # Stake-based challenges
β βββ AutomatedMarketResolver.sol # AI-powered settlement
β βββ BatchPayoutDistributor.sol # Efficient winner payouts
β βββ MarketFactory.sol # Market registry
β βββ ReferralRewards.sol # Viral growth (5% rewards)
β βββ LiquidityIncentives.sol # Bootstrap new markets
β βββ AggregatedOracle.sol # Multi-source consensus
β βββ ScheduledFeeds.sol # Automated updates
β βββ CrossChainBridge.sol # Multi-chain data
β βββ DAOGovernance.sol # Community voting
β βββ OracleStaking.sol # Reputation staking
β βββ SlashingMechanism.sol # Penalty system
β
βββ π src/sdk/ # TypeScript SDK
β βββ MultiWalletS402Pool.ts # β 10x parallel speedup
β βββ S402Client.ts # s402 payment client
β βββ s402-config.ts # Mainnet configuration
β βββ SoraOracleClient.ts # Oracle interactions
β βββ PredictionMarketClient.ts # Market interactions
β βββ MultiOutcomeMarketClient.ts # Multi-outcome markets
β
βββ π src/ai/ # Permissionless Oracle
β βββ SelfExpandingResearchAgent.ts # β AI-powered API discovery
β βββ APIDiscoveryAgent.ts # Automatic API finding
β βββ DataSourceRouter.ts # Intelligent routing
β βββ TLSVerifier.ts # Certificate verification
β βββ IPFSClient.ts # Decentralized storage
β
βββ π server/ # Backend Examples
β βββ s402-middleware.js # β Payment verification
β βββ index.js # Blockchain indexer
β βββ storage.ts # Database layer
β
βββ π frontend/ # React UI Example
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # App pages
β β βββ config.ts # Contract addresses
β β βββ App.tsx # Main app
β βββ package.json
β
βββ π scripts/ # Deployment & Utils
β βββ deploy-s402-mainnet.js # β Mainnet deployment
β βββ ai-oracle-settler.js # AI-powered settlement
β βββ fund-workers.js # Fund worker wallets
β βββ check-worker-balances.js # Monitor balances
β βββ [15+ more utility scripts]
β
βββ π test/ # Test Suite
β βββ S402Facilitator.test.js
β βββ MultiOutcomeMarket.test.js
β βββ [comprehensive test coverage]
β
βββ π examples/ # SDK Usage Examples
β βββ sdk-usage.ts # Basic SDK usage
β βββ multi-wallet-demo.ts # Parallel payments
β βββ self-expanding-demo.ts # Permissionless oracle
β
βββ π docs/ # Documentation
βββ SORA_ORACLE_TECHNICAL_SPECIFICATION.md # β Complete architecture
βββ V5_PERMISSIONLESS_ORACLE_COMPLETE.md # β Self-expanding agent
βββ X402_VS_S402_COMPARISON.md # β s402 protocol explained
βββ USDC_USDT_BNB_CHAIN_IMPLEMENTATION.md # s402 implementation
βββ EIP_PAYMENT_STANDARDS_COMPARISON.md # EIP-2612 vs EIP-3009
βββ EIP3009_LOOPHOLE_ANALYSIS.md # Why EIP-3009 doesn't work
β = Core v5.0 features
Sora Oracle v5.0 introduces s402 - a custom HTTP 402 micropayment system for BNB Chain:
User Signs Payment β s402 Middleware Verifies β API Responds β Settlement On-Chain
(EIP-2612) (Payment Proof) (Data) (Multi-Wallet Pool)
Key Components:
- S402Facilitator.sol - Smart contract for payment settlement (1% platform fee)
- MultiWalletS402Pool - 10 worker wallets for parallel transactions (10x speedup)
- s402-middleware.js - Backend payment verification
- Permissionless Oracle - AI-powered API discovery and verification
x402 (Coinbase):
- β Uses EIP-3009 (random nonces, true parallel)
- β Only works on Base, Ethereum (chains with native Circle USDC)
- β Doesn't work on BNB Chain (no EIP-3009 support)
s402 (Sora):
- β Uses EIP-2612 (works on BNB Chain)
- β Multi-wallet pool solves sequential nonce problem
- β Achieves 10x parallel speedup
- β Honest branding - we don't claim x402 compliance
// AI automatically discovers and verifies APIs
const oracle = await sdk.createPermissionlessOracle({
question: "What's the current BTC price?",
sources: "auto", // AI discovers APIs
consensus: "median",
verification: "tls+sha256+ipfs"
});
// Oracle queries multiple sources, verifies cryptographically
const answer = await oracle.query();
console.log(`BTC: $${answer.value} (confidence: ${answer.confidence}%)`);// Users pay $0.05 USDC to create markets
const market = await sdk.createMarket({
question: "Will Ethereum merge happen in Q3?",
type: "binary",
payment: { token: "USDC", amount: "0.05" }
});
// Oracle automatically resolves using verified data
await market.resolve(); // AI-powered settlement// Create election markets
const election = await sdk.createMarket({
question: "Who wins 2024 election?",
type: "multi-outcome",
outcomes: ["Candidate A", "Candidate B", "Candidate C"],
payment: { token: "USDC", amount: "0.10" }
});Core Oracle (v3):
- SoraOracle - Question/answer oracle with bounties
- PancakeTWAPOracle - Manipulation-resistant TWAP pricing
Market Types (v3-v4):
- SimplePredictionMarket - Binary (yes/no) markets
- MultiOutcomeMarket - 2-10 outcome markets
- OrderBookMarket - Limit order book (institutional-grade)
- AMMPredictionMarket - AMM-style liquidity pools
- ConditionalMarket - Markets with linked outcomes
- RangeBettingMarket - Bet on price ranges
- TimeSeriesMarket - Statistical predictions
Automation (v4):
- AutomatedMarketResolver - AI-powered settlement
- AggregatedOracle - Multi-source consensus
- ScheduledFeeds - Automated oracle updates
- CrossChainBridge - Multi-chain oracle data
Operations:
- BatchOracleOperations - Batch 20 questions (30% gas savings)
- BatchPayoutDistributor - Efficient winner payouts
- DisputeResolution - Stake-based challenges
- OracleReputationTracker - Provider performance
Governance:
- DAOGovernance - Community voting
- OracleStaking - Reputation and rewards
- SlashingMechanism - Penalty system
Growth:
- ReferralRewards - Viral growth (5% fee sharing)
- MarketFactory - Market registry with categories
- LiquidityIncentives - Bootstrap new markets
v5.0 - s402 Payments:
- S402Facilitator - Payment settlement with 1% platform fee (View on BSCScan)
| Operation | Price (USDC) | Description |
|---|---|---|
| Data Source Access | $0.03 | Query permissionless oracle |
| Oracle Query | $0.01 | Single oracle question |
| Market Creation | $0.05 | Create prediction market |
| Market Resolution | $0.10 | Resolve market outcome |
| Batch Query | $0.05 | Multiple oracle queries |
| AI Resolution | $0.15 | GPT-4 powered settlement |
Platform Fee: 1% of all transactions (adjustable by owner, max 10%)
- β OpenZeppelin v5 - Battle-tested libraries
- β ReentrancyGuard - All withdrawal functions protected
- β Pausable - Emergency stop mechanism
- β Access Control - Role-based permissions
- β Input Validation - All user inputs sanitized
- β EIP-712 Signatures - Cryptographically secure payment authorizations
- β Replay Prevention - Used payment tracking
- β Recipient Binding - Payments cryptographically bound to recipient (prevents front-running)
- β Deadline Enforcement - All payments have expiration times
- β Dual-Signature - EIP-2612 permit + EIP-712 authorization
| Operation | Gas | BNB (3 Gwei) | USD ($600 BNB) |
|---|---|---|---|
| Create Binary Market | ~200K | ~0.0006 BNB | ~$0.36 |
| Create Multi-Outcome | ~250K | ~0.00075 BNB | ~$0.45 |
| Place Bet | ~50K | ~0.00015 BNB | ~$0.09 |
| Claim Winnings | ~45K | ~0.000135 BNB | ~$0.08 |
| s402 Payment Settlement | ~180K | ~0.00054 BNB | ~$0.32 |
| Batch Oracle Operations | ~35K ea | ~0.000105 BNB | ~$0.06 |
Total Cost: ~$0.40 to create + settle a market with s402
- Chain ID: 56
- RPC: https://bsc-dataseed.binance.org/
- Explorer: https://bscscan.com
- S402 Contract:
0x605c5c8d83152bd98ecAc9B77a845349DA3c48a3 - USDC:
0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d(Binance-Bridged, EIP-2612) - USDT:
0x55d398326f99059fF775485246999027B3197955(18 decimals!)
- Chain ID: 97
- RPC: https://data-seed-prebsc-1-s1.binance.org:8545/
- Explorer: https://testnet.bscscan.com
- Faucet: https://testnet.bnbchain.org/faucet-smart
- SORA_ORACLE_TECHNICAL_SPECIFICATION.md - Complete architecture and design
- V5_PERMISSIONLESS_ORACLE_COMPLETE.md - How the permissionless oracle works
- USDC_USDT_BNB_CHAIN_IMPLEMENTATION.md - s402 payment implementation
- X402_VS_S402_COMPARISON.md - Why we built s402 instead of using x402
- EIP_PAYMENT_STANDARDS_COMPARISON.md - EIP-2612 vs EIP-3009 deep-dive
- EIP3009_LOOPHOLE_ANALYSIS.md - Why "EIP-3009 on BNB" claims are false
- QUICK_START.md - Get started in 5 minutes
- CONTRIBUTING.md - How to contribute
# Install dependencies
npm install
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test
# Deploy to testnet
npx hardhat run scripts/deploy-s402.js --network bscTestnetcd frontend
npm install
npm run devWe welcome contributions! This is open-source MIT licensed software.
# Fork and clone
git clone https://github.com/YOUR_USERNAME/sora-oracle-sdk
# Install and test
npm install && npx hardhat test
# Create feature branch
git checkout -b feature/amazing-feature
# Submit PRSee CONTRIBUTING.md for detailed guidelines.
MIT License - See LICENSE for details.
Use it, fork it, modify it, sell it - whatever you want! All smart contracts are fully permissionless and open source.
| Feature | Sora Oracle | Chainlink | UMA |
|---|---|---|---|
| Permissionless | β Anyone can add data | β Whitelisted nodes | |
| AI-Powered | β GPT-4 discovery | β Manual | β Manual |
| Micropayments | β s402 ($0.01-0.15) | β LINK tokens | β UMA bonds |
| Multi-Source | β Automatic consensus | ||
| BNB Chain | β Native support | β Supported | |
| Verification | β TLS+SHA256+IPFS |
| Feature | Sora Oracle | Polymarket | Augur |
|---|---|---|---|
| Chain | BNB (low fees) | Polygon | Ethereum |
| Oracle | Permissionless | Centralized UMA | Decentralized |
| Market Types | 8 types | Binary only | Binary + Categorical |
| Payments | s402 (USDC) | Free | ETH gas |
| Orderbook | β Limit orders | β Limit orders | β Shares only |
| Mainnet | β Live | β Live | β Live |
- Website: sora-oracle.xyz
- π Twitter: @SoraOracle
- Email: [email protected]
- GitHub Issues: Report bugs & request features
- Contract: View on BSCScan
Sora Oracle v5.0 - The first production-ready permissionless oracle with integrated micropayments π
β Permissionless | β AI-Powered | β s402 Payments | β BNB Chain | β Mainnet Live
No gatekeepers. No permissions. Just secure, verifiable prediction markets.
Built by the community, for the community π
Get Started β β’ View Contract β β’ Follow on π β
