| Crates.io | oil-api |
| lib.rs | oil-api |
| version | 0.6.3 |
| created_at | 2026-01-07 21:32:23.402923+00 |
| updated_at | 2026-01-25 15:09:00.341174+00 |
| description | API for interacting with the OIL protocol on Solana |
| homepage | https://oil.supply |
| repository | https://github.com/oil-protocol/oil |
| max_upload_size | |
| id | 2029050 |
| size | 252,353 |
API for interacting with the OIL protocol on Solana. OIL is a crypto mining protocol that allows users to deploy SOL to claim space on a board, mine OIL tokens, and stake for yield.
steel and bytemuckAdd to your Cargo.toml:
[dependencies]
oil-api = "0.3.3"
use oil_api::prelude::*;
use solana_program::pubkey::Pubkey;
// Derive a Miner PDA
let (miner_pda, _bump) = miner_pda(&signer.pubkey());
// Build a Deploy instruction
let deploy_ix = deploy(
&signer.pubkey(),
amount, // Amount in lamports
square_id, // Square ID (0-24)
referrer, // Optional referrer address
);
// Build a ClaimOIL instruction
let claim_oil_ix = claim_oil(&signer.pubkey());
// Build a Deposit instruction for staking
let deposit_ix = deposit(
&signer.pubkey(),
amount, // Amount in OIL (grams)
);
consts - Program constants including addresses, time constants, and token decimalserror - Custom program error typesevent - Program event typesinstruction - Instruction types and builderssdk - High-level SDK functions for common operationsstate - Account state types and PDA derivation functionsAuction - Auction stateAutomation - Automation configurationBid - Auction bid accountBoard - Current round stateConfig - Global program configurationMiner - User mining statePool - Mining pool stateAuctionPool - Auction pool stateReferral - Referral trackingRig - Rig configurationRound - Round-specific stateStake - Staking accountTreasury - Treasury accountWell - Well statedeploy - Deploy SOL to claim space on the boardclaim_oil - Claim OIL mining rewardsclaim_sol - Claim SOL mining rewardscheckpoint - Checkpoint rewards from a prior roundautomate - Configure automationreload_sol - Reload SOL mining rewards into automationreset - Reset the board for a new roundplace_bid - Set a bid in the auction (automatically syncs accumulated OIL and halvings)claim_auction_oil - Claim OIL from auctionclaim_auction_sol - Claim SOL from auctiondeposit - Deposit OIL into a stake accountwithdraw - Withdraw OIL from a stake accountclaim_yield - Claim staking yieldcreate_referral - Create a referral accountclaim_referral - Claim referral rewardsThe OIL program ID is: rigwXYKkE8rXiiyu6eFs3ZuDNH2eYHb1y87tYqwDJhk
Full API documentation is available at:
This crate depends on:
entropy-rng-api - For entropy-based randomnessoil-mint-api - For OIL token minting operationssolana-program - Solana program SDKsteel - Solana instruction building frameworkspl-token - SPL token programspl-token-2022 - SPL token 2022 programLicensed under Apache-2.0