Skip to main content

For Developers

Build on Oyrade's privacy prediction infrastructure.

Architecture Overview

Loading diagram...
ResourceDescription
Smart ContractsAnchor program reference
API ReferenceREST & WebSocket endpoints
GitHubSource code & examples

Tech Stack

On-Chain (Solana)

  • Anchor Framework - Type-safe Solana programs
  • SPL Tokens - YES/NO shares as SPL tokens
  • Token-2022 - Confidential transfers for privacy
  • PDAs - Market state & user positions

Oracles

  • Switchboard V3 - Financial data (prices, market caps)
  • UMA Optimistic - Custom event resolution
  • Helius - Real-time indexing & webhooks

Privacy

  • Solnado - Mixer pools for wallet unlinking
  • Ephemeral Wallets - One-time addresses for predictions

Development Setup

# Clone the repo
git clone https://github.com/oyrade/oyrade-contracts

# Install dependencies
cd oyrade-contracts
yarn install

# Build programs
anchor build

# Run tests
anchor test

# Deploy to devnet
anchor deploy --provider.cluster devnet

Devnet Resources

ResourceAddress/URL
Program IDOYRDxxxx... (TBA)
RPChttps://devnet.helius-rpc.com
Faucetsol-faucet.com

Integration Examples

Subscribe to Market Updates

import { Connection, PublicKey } from '@solana/web3.js';

const connection = new Connection('https://api.mainnet-beta.solana.com');
const marketPubkey = new PublicKey('MARKET_ADDRESS');

connection.onAccountChange(marketPubkey, (accountInfo) => {
const marketData = parseMarketAccount(accountInfo.data);
console.log('Updated odds:', marketData.yesPrice, marketData.noPrice);
});

Create a Prediction

import { Program } from '@coral-xyz/anchor';
import { OyradeIDL } from './idl';

const program = new Program(OyradeIDL, PROGRAM_ID, provider);

await program.methods
.placePrediction({
amount: new BN(100_000_000), // 100 USDC
side: { yes: {} },
shielded: true,
})
.accounts({
market: marketPubkey,
user: wallet.publicKey,
// ... other accounts
})
.rpc();

Next: Smart contract details →