oil-fomo-api
API crate for the OIL Fomo game protocol on Solana. This crate provides types, instructions, and SDK functions for interacting with the Strike (Fomo3D-inspired) game.
Overview
The OIL Fomo game is a Fomo3D-inspired game where players buy "Barrels" to extend the timer and compete for the jackpot. Each purchase:
- Extends the timer by a configurable number of slots
- Distributes yield to existing barrel holders
- Adds to the buyback pool (for OIL token buyback and burn)
- Adds to the pot (for the jackpot winner)
Features
- Slot-based timing for MEV protection
- High-precision yield distribution using
Numerictype - Round tracking with historical data
- Independent buyback mechanism (swap integration)
- Pause functionality for emergencies
Account Types
Strike- Global game state (round ID, current leader, pot, timer, etc.)Round- Historical round data (winner, pot, stats)Wildcatter- Per-player state (barrels owned, yield, winnings)Treasury- SOL accounting (buyback balance, yield pool, total burned)Config- Admin-configurable parameters (BPS rates, prices, addresses)
Instructions
Initialize- Initialize the game with configurationBuy- Purchase barrels (extends timer, distributes yield, adds to pot)ClaimYield- Claim accumulated yield from barrel holdingsClaimJackpot- Claim the pot when timer expires (only current leader)Buyback- Independent buyback instruction (swap SOL for OIL and burn)Update- Admin-only configuration updatesClose- Close expired round accounts to reclaim rent
Usage
use *;
// Get Strike PDA
let = strike_pda;
// Build Buy instruction
let buy_ix = buy;
Documentation
See the ARCHITECTURE.md for complete design documentation.
License
Apache-2.0