oil-fomo-api 0.0.6

API for interacting with the OIL Fomo game protocol on Solana
Documentation

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 Numeric type
  • 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 configuration
  • Buy - Purchase barrels (extends timer, distributes yield, adds to pot)
  • ClaimYield - Claim accumulated yield from barrel holdings
  • ClaimJackpot - Claim the pot when timer expires (only current leader)
  • Buyback - Independent buyback instruction (swap SOL for OIL and burn)
  • Update - Admin-only configuration updates
  • Close - Close expired round accounts to reclaim rent

Usage

use oil_fomo_api::prelude::*;

// Get Strike PDA
let (strike_pda, _) = strike_pda();

// Build Buy instruction
let buy_ix = oil_fomo_api::sdk::buy(
    signer,
    strike_pda,
    // ... other accounts
);

Documentation

See the ARCHITECTURE.md for complete design documentation.

License

Apache-2.0