| Crates.io | ozon-oracle-sdk |
| lib.rs | ozon-oracle-sdk |
| version | 0.1.8 |
| created_at | 2025-10-18 10:24:05.589879+00 |
| updated_at | 2025-10-19 20:27:46.934941+00 |
| description | Ozon oracle sdk to interact with the Ozon AVS oracle program on Solana. |
| homepage | https://github.com/wildchain/ozon_contract |
| repository | https://github.com/wildchain/ozon_contract |
| max_upload_size | |
| id | 1889084 |
| size | 243,509 |
Command-line tool for AVS (Actively Validated Service) owners to create, manage, and monitor oracle validation tasks on Solana. Part of the Ozon Restaking Protocol.
AVS Oracle CLI enables AVS owners to:
Operators run validation nodes that automatically fetch Pyth Network price feeds and submit results for tasks created through this CLI.
cargo install avs-oracle-cli
git clone https://github.com/yourusername/ozon
cd ozon/avs/ozon-oracle-sdk
cargo install --path .
# Use your existing Solana wallet
export SOLANA_KEYPAIR=~/.config/solana/id.json
# Or create a new one
solana-keygen new -o avs-owner-keypair.json
# Airdrop SOL on devnet
solana airdrop 2 --url devnet
First, register your AVS using the main Ozon CLI:
ozon-cli register-avs \
--metadata "oracle:BTC/USD Price Feed" \
--registration-fee 3000000000 \
--cluster devnet
avs-oracle create-task \
--task-id 1 \
--pyth-feed-id e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 \
--deadline-slots 1000 \
--threshold-bps 100 \
--cluster devnet
# List all your tasks
avs-oracle list-tasks --cluster devnet
# View submissions for a specific task
avs-oracle get-submissions --task-id 1 --cluster devnet
create-taskCreate a new oracle validation task.
avs-oracle create-task \
--task-id <ID> \
--pyth-feed-id <FEED_ID> \
--deadline-slots <SLOTS> \
--threshold-bps <BPS> \
[--cluster <CLUSTER>] \
[--wallet <PATH>]
Options:
--task-id: Unique task identifier (incrementing number)--pyth-feed-id: Pyth Network price feed ID (32-byte hex string)--deadline-slots: Task deadline in slots from now (default: 1000)--threshold-bps: Verification threshold in basis points (default: 100 = 1%)--cluster: Solana cluster (devnet/testnet/mainnet-beta, default: devnet)--wallet: Path to keypair file (default: ~/.config/solana/id.json)Example:
avs-oracle create-task \
--task-id 1 \
--pyth-feed-id e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 \
--deadline-slots 2000 \
--threshold-bps 50 \
--cluster devnet
list-tasksList all tasks for your AVS.
avs-oracle list-tasks [--cluster <CLUSTER>] [--wallet <PATH>] [--active-only]
Options:
--cluster: Solana cluster (default: devnet)--wallet: Path to keypair file--active-only: Show only active tasksExample:
avs-oracle list-tasks --active-only --cluster devnet
get-submissionsView all submissions for a specific task.
avs-oracle get-submissions --task-id <ID> [--cluster <CLUSTER>] [--wallet <PATH>]
Options:
--task-id: Task ID to view submissions for--cluster: Solana cluster (default: devnet)--wallet: Path to keypair fileExample:
avs-oracle get-submissions --task-id 1 --cluster devnet
verify-submissionView verification details for a specific submission.
avs-oracle verify-submission \
--task-id <ID> \
--operator <PUBKEY> \
[--cluster <CLUSTER>] \
[--wallet <PATH>]
Options:
--task-id: Task ID--operator: Operator's public key--cluster: Solana cluster (default: devnet)--wallet: Path to keypair fileExample:
avs-oracle verify-submission \
--task-id 1 \
--operator CLuHUKKF2nUiBFNQCUAxKqJHbEiDiSrphsrYzJ12btHN \
--cluster devnet
close-taskClose an expired task.
avs-oracle close-task --task-id <ID> [--cluster <CLUSTER>] [--wallet <PATH>]
Options:
--task-id: Task ID to close--cluster: Solana cluster (default: devnet)--wallet: Path to keypair fileExample:
avs-oracle close-task --task-id 1 --cluster devnet
Common Pyth Network price feed IDs (mainnet):
| Asset | Feed ID |
|---|---|
| BTC/USD | e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 |
| ETH/USD | ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace |
| SOL/USD | ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d |
| USDC/USD | eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a |
| USDT/USD | 2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b |
Find more feeds at Pyth Network Price Feeds.
┌─────────────────────────────────────────────────────────┐
│ AVS Owner (You) │
│ Uses: avs-oracle-cli │
├─────────────────────────────────────────────────────────┤
│ 1. Create tasks with price feed validation params │
│ 2. Monitor operator submissions │
│ 3. Verify and close tasks │
└─────────────────────────────────────────────────────────┘
↓
Creates tasks on-chain
↓
┌─────────────────────────────────────────────────────────┐
│ Solana Blockchain │
│ Program: avs-oracle (On-chain) │
├─────────────────────────────────────────────────────────┤
│ • Task accounts store validation parameters │
│ • Submission accounts store operator results │
│ • Integrates with Pyth Network for verification │
└─────────────────────────────────────────────────────────┘
↓
Operators fetch tasks
↓
┌─────────────────────────────────────────────────────────┐
│ Operators │
│ Uses: ozon-cli run-operator │
├─────────────────────────────────────────────────────────┤
│ 1. Discover active tasks │
│ 2. Fetch Pyth price feeds │
│ 3. Submit results on-chain │
│ 4. Get slashed if wrong! │
└─────────────────────────────────────────────────────────┘
Create tasks for operators to validate price feeds for DeFi protocols.
Verify external data sources with multiple operators providing redundancy.
Monitor blockchain or off-chain metrics with operator consensus.
avs-oracle create-task \
--wallet ./my-avs-keypair.json \
--task-id 1 \
--pyth-feed-id <FEED_ID>
avs-oracle create-task \
--cluster mainnet-beta \
--task-id 1 \
--pyth-feed-id <FEED_ID>
avs-oracle create-task \
--task-id 1 \
--pyth-feed-id <FEED_ID> \
--threshold-bps 500 # 5% threshold instead of 1%
Problem: AVS account doesn't exist.
Solution: Register your AVS first using ozon-cli:
ozon-cli register-avs --metadata "oracle:My Oracle" --registration-fee 3000000000
Problem: Task ID is already used.
Solution: Use a different task ID:
avs-oracle create-task --task-id 2 ...
Problem: Not enough SOL in wallet.
Solution: Airdrop more SOL (devnet):
solana airdrop 2 --url devnet
Problem: Feed ID is not 32 bytes (64 hex characters).
Solution: Ensure you're using the correct format without 0x prefix or use it with prefix:
--pyth-feed-id e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
Contributions are welcome! Please feel free to submit a Pull Request.
# Clone the repository
git clone https://github.com/yourusername/ozon
cd ozon/avs/ozon-oracle-sdk
# Build
cargo build
# Run tests
cargo test
# Run locally
cargo run -- create-task --help
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the Solana ecosystem