Depredict is a decentralized prediction market protocol on Solana. Anyone can spin up their own prediction market using our open-source smart contract and TypeScript SDK.
- Documentation — Full guides, API reference, and examples
- SDK on npm
- END Corp. — Project lead
Program ID: deprZ6k7MU6w3REU6hJ2yCfnkbDvzUZaKE4Z4BuZBhU
| Component | Location | Description | Tech Stack |
|---|---|---|---|
| On-chain Program | programs/depredict/ |
Solana smart contracts for prediction markets | Rust, Anchor |
| TypeScript SDK | sdk/ |
Client library for protocol interaction | TypeScript, Solana Web3.js |
| Documentation | depredict-docs/ |
Comprehensive guides and API docs | Vocs, React |
| Directory | Purpose |
|---|---|
tests/ |
Integration tests and test utilities |
deploy/ |
Deployment scripts and configuration |
migrations/ |
Database and state migrations |
Anchor.toml |
Anchor framework configuration |
depredict/
├── 📄 Anchor.toml # Anchor configuration & test scripts
├── 📄 package.json # Root dependencies & scripts
├── 🦀 programs/depredict/ # Solana smart contracts
│ ├── src/instructions/ # Program instructions
│ ├── src/state/ # Account state structures
│ └── Cargo.toml # Rust dependencies
├── 📚 sdk/ # TypeScript SDK
│ ├── src/types/ # TypeScript definitions
│ ├── src/utils/ # Utility functions
│ └── package.json # SDK package config
├── 📖 depredict-docs/ # Documentation site
│ ├── docs/pages/ # Documentation pages
│ └── package.json # Docs dependencies
├── 🧪 tests/ # Integration tests
│ ├── market/ # Market-related tests
│ ├── trade/ # Trading tests
│ └── helpers.ts # Test utilities
├── 🚀 deploy/ # Deployment scripts
└── 🔄 migrations/ # State migrations
-
Install the SDK:
npm install @endcorp/depredict
-
Create a Market (TypeScript Example):
import { Connection, PublicKey } from '@solana/web3.js'; import DepredictClient from '@endcorp/depredict'; const connection = new Connection('https://api.devnet.solana.com'); const adminKey = new PublicKey('...'); // Your admin public key const feeVault = new PublicKey('...'); // Your fee vault public key const usdcMint = new PublicKey('...'); // USDC mint address const client = new DepredictClient(connection, adminKey, feeVault, usdcMint); await client.trade.createMarket({ startTime: Date.now() / 1000, endTime: (Date.now() + 86400000) / 1000, // 24 hours from now question: 'Will SOL be above $200 by tomorrow?', metadataUri: 'https://your-metadata-url', payer: adminKey, oracleType: 'manual', // or 'switchboard' });
For more details, see the Getting Started Guide and SDK API Reference.
We welcome contributions to the Depredict protocol and SDK!
-
Clone the repo:
git clone https://github.com/endcorp-hq/depredict.git cd depredict -
Install dependencies:
yarn install
-
Build the program:
anchor build
-
Run tests:
anchor run test-runner-continue
- On-chain Program: Work in
programs/depredict/for smart contract changes - SDK: Work in
sdk/for TypeScript client library updates - Documentation: Work in
depredict-docs/for guides and API docs - Tests: Add integration tests in
tests/directory
📖 For detailed guidelines, see CONTRIBUTING.md
- Depredict Docs — Full protocol and SDK documentation
- GitHub Issues — Bug reports & feature requests
- END Corp. — Project lead
MIT License
