Docs
Sunrig docs
What the Sunrig program does and where the SOL goes, in plain words. Figures marked as defaults can be changed by the admin, only within fixed limits.
How Sunrig works
- 1.Your coin is a pump.fun coin on Solana. Its creator is the coin's RigVault, so pump.fun's creator fee from every trade flows into the vault.
- 2.The vault buys rigs only when someone calls sweep. Our keeper does it daily; anyone can.
- 3.Sunrig takes 2% only when a vault buys rigs. 70% of it goes to $SUNRIG stakers, 30% buys back and burns $SUNRIG.
- 4.Rigs earn only from the shared Sunrig pool. Every 5 minutes the pool pays all rigs a small slice of its balance, about 5% a day in total. That money comes from rig buys by every Sunrig coin; nothing is minted and nothing is mined off-chain.
- 5.Your mine sets your share. A mine's weight follows its price feed over the last 24 hours, from ×0.5 to ×2.
- 6.Payouts run every 5 minutes from the Sunrig keeper. If it is more than 15 minutes late, anyone can run the payout with equal weights.
- 7.Stake to earn. Holders stake the coin in its RigVault and earn the SOL its rigs mine while they're staked, second by second. Unstaked holders earn nothing. SOL mined while nobody is staked buys more rigs for the same coin.
- 8.Unstake and claim any time. The program has no way for anyone, Sunrig included, to withdraw a vault's SOL or staked coins. The program can be upgraded by the Sunrig team.
Launching
Anyone can launch a coin from the Launch page. You fill in the form and sign one transaction. It does three things, in this order:
- 1.pump.fun
create_v2makes the coin, with its RigVault set as the creator. - 2.Sunrig
register_coincreates the RigVault and its stake account. It checks that the coin's creator on pump.fun is that vault. - 3.If you set an initial buy, your own first buy runs in the same transaction, before anyone else can trade.
The coin's mint key is made in your browser and is never sent anywhere. Only the launch transaction can register the coin, so nobody else can claim to be its launcher.
At launch you pick a mine and your cut of mined SOL, from 0 to 10%. Neither can be changed later, by you or by the admin.
As the launcher you do not receive pump.fun's creator fee. It goes to the vault. Your cut of mined SOL builds up in the vault, and you can claim it from the coin page at any time.
Coins trade on pump.fun's bonding curve. When the curve fills, the coin graduates to PumpSwap. Creator fees keep flowing to the vault in both places.
RigVault and sweep
Every Sunrig coin has a RigVault. It is an account owned by the Sunrig program (a PDA), derived from the coin's mint. It has no private key, so only the program's rules can move its SOL.
The RigVault is the coin's creator on pump.fun. The creator fee from every trade, on the bonding curve and after graduation on PumpSwap, builds up for the vault on pump.fun.
sweep moves that money along. Our keeper calls it for every vault once a day. Anyone else can call it at any time. One sweep does three things:
- 1.Collects the vault's creator fees. The program does this with a CPI into pump.fun, which pays them only to the vault, so no signature is needed. Anyone can trigger it. PumpSwap fees are first moved to the same place by pump's own permissionless instructions, in the same transaction.
- 2.Collects what the vault's rigs earned from the pool. The launcher's cut is set aside. The rest goes to stakers (see Staking), or stays as free SOL if nobody is staked.
- 3.Spends the vault's free SOL on rigs. Sunrig's 2% rig fee comes off first. The other 98% goes to the shared pool, and the vault gets that much hashpower.
free = vault SOL − rent
− owed to stakers
− owed to launcher
− $SUNRIG share not paid yet
fee = free × 2%
rigs = free − feeFree SOL never includes what the vault already owes to stakers or the launcher. Buying rigs cannot spend it. The last line only applies to the $SUNRIG vault (see $SUNRIG).
Sweeping more often does not earn more. Rigs earn second by second whether anyone sweeps or not; a sweep only moves what they have earned so far. Stake, unstake and claim collect it too, and anyone can collect it on its own with harvest.
Rigs and hashpower
Rigs and hashpower are internal units of the Sunrig program. A rig is not a machine and does not compute anything. It is a number in the vault's account that sets the vault's slice of every payout.
Every lamport a vault puts into the pool is one unit of hash. The app shows H, where 1 H = 1,000,000 hash. So 1 SOL buys 1,000 H.
Rigs never wear out and cannot be sold. A vault's hashpower only grows. The SOL spent on rigs stays in the shared pool and is paid out to all rigs over time.
A vault's hashpower counts in one mine only: the mine picked at launch.
Mines and feeds
There are 4 mines. Each one follows the price of its asset. The move over the last 24 hours sets the mine's weight: how big a slice of each payout its rigs get.
A mine's price comes from Pyth when Pyth has a fresh one. For a mine without one, for example Silver and Oil, the Sunrig keeper posts a price from public market data: the futures index price on Binance, Bybit, OKX and Bitget, and the oracle price of the Hyperliquid perp. It posts only while the market is open and most of the venues that answer, at least two, agree within 1%. The program takes such a price only from the keeper key, and only if it is at most 10% away from the mine's last price for each started hour since then.
Keeper prices are only as reliable as the keeper. The worst a wrong one can do is move a mine's weight between ×0.5 and ×2, which shifts payouts between mines. It cannot move SOL out of the pool, vaults or stakes.
Oil's public sources follow the front-month WTI future, so the monthly contract roll can show up as a price move on that day.
Silver
XAG
Pyth feed id
f2fb02c32b055c805e7238d628e5e9dadef274376114eb1f012337cabe93871e
Keeper sources
XAGUSDT on Binance, Bybit and Bitget, XAG-USDT on OKX, xyz:SILVER on Hyperliquid
Oil
WTI
Pyth feed id
f2464139c45f26097e0173b03207c4a490dbd8bf1b72dfbf064eeb832c7c2933
Keeper sources
CLUSDT on Binance, Bybit and Bitget, CL-USDT on OKX, xyz:CL on Hyperliquid
Gold
XAU
Pyth feed id
765d2ba906dbc32ca17cc11f5310a89e9ee1f6420508c63861f2f8ba4ee34bb2
Keeper sources
XAUUSDT on Binance, Bybit and Bitget, XAU-USDT on OKX, xyz:GOLD on Hyperliquid
SOL
SOL
Pyth feed id
ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d
Keeper sources
SOLUSDT on Binance, Bybit and Bitget, SOL-USDT on OKX, SOL on Hyperliquid
How the weight is computed
- 1.At each payout the keeper passes a fresh price for each mine, from Pyth or its own from public market data. The program keeps the latest price of every hour for the last 24 hours and compares the new price with the one from 24 hours earlier.
- 2.Hours with no fresh price, for example a weekend when the market is closed, repeat the last known price. The very first price fills the whole day, so a mine starts at ×1.
- 3.
ris the change in basis points (1 bp = 0.01%). Both prices are first put on the same exponent. The result is cut toward zero, so a +1.239% move counts as 123. - 4.Each basis point of change moves the weight by
kbasis points, starting from ×1. The weight is held between ×0.5 and ×2. The defaultkis 10.
r = (p_now − p_24h) × 10,000 / p_24h
w = clamp(10,000 + k × r,
5,000, 20,000)
k = 10Example: a mine whose price rose 1.2% in 24 hours gets r = 120 and w = 10,000 + 10 × 120 = 11,200, which is ×1.12. With k = 10 the weight reaches ×2 at +10% and ×0.5 at −5%.
A mine weighs ×1 in a payout when:
- its price is older than 120 seconds or more than 60 seconds ahead of the chain clock, or no fresh price was passed, for example because the market is closed or the public sources disagree;
- a keeper price is more than 10% per started hour away from the last price;
- the price is not newer than the one used last time;
- the price is zero or below;
- there is no price history yet: the first payout, or the first one after a feed change;
- the payout runs on the late path (see Payouts).
A stale or missing price leaves the mine's hourly prices as they were, so the next comparison uses the last good ones. A keeper price that is more than 10% away from the last price (possible only after a gap of over an hour) starts the mine's 24-hour history over from it, so that payout weighs ×1.
Payouts every 5 minutes
Every 5 minutes, on the clock (:00, :05, :10 and so on), the shared pool pays a small slice of its balance to all rigs: about 5% a day in total (default).
Payouts run every 5 minutes from the Sunrig keeper. If it is more than 15 minutes late, anyone can run the payout with equal weights.
Why the keeper: Pyth accepts any signed price update, old ones too. If anyone could run the payout on time, they could pass an old price for another mine and pull the split toward their own. So on time only the keeper key can run it, with the freshest prices, and only the keeper can post its own prices. The late path uses no prices at all.
available = pool − rent − reserved
elapsed = min(now − last payout, 3,600 s)
payout = available × 5% × elapsed
/ 86,400 s
W = Σ w_m × hash_m (all mines)
share_m = payout × w_m × hash_m / Wreserved is SOL the pool already promised to mines that vaults have not collected yet. Each payout takes the time since the last one into account, so the pool pays about the same per day however the payouts are spaced. It is split between mines by weight times hashpower.
A mine does not get its share at once: it is paid to its rigs second by second over the next 5 minutes, and inside the mine each vault earns by its hashpower. Rigs bought in the middle of that time earn from the moment they are bought.
Example: Silver, Oil and Gold have equal hashpower and weigh ×1, ×2 and ×0.5 right now, and SOL has no rigs. They get 28.6%, 57.1% and 14.3% of the payout.
Rounding always goes down, and the dust stays in the pool. If no mine has hashpower, nothing is paid. A late payout pays for at most 1 hour of elapsed time, so a long gap is not made up in full.
The pool only pays a share of what it holds, so it cannot go below zero. If coins stop buying rigs, the pool shrinks and the payouts shrink with it.
Staking
Holders stake a coin in its RigVault from the coin page. The staked coins sit in a token account owned by the vault. Stakers earn SOL.
The vault's rigs earn second by second. Whenever the vault collects what they mined (at every sweep, stake, unstake and claim), the launcher's cut is set aside and the rest is split at once between the current stakers, by stake.
you = (mined − launcher cut)
× your stake / total stakedThe vault collects before any stake changes. So you earn only what the rigs mine while you're staked: staking right before a payout and leaving right after earns only those few seconds' share.
Your SOL to claim grows every second. The coin page counts what the rigs have mined since the vault last collected, so the number matches what a claim would pay.
Unstaked holders earn nothing. SOL mined while nobody is staked buys more rigs for the same coin at its next sweep.
You can unstake and claim at any time. No pause in the program can block unstake or claim.
$SUNRIG
$SUNRIG is Sunrig's official coin, launched through Sunrig itself. Its RigVault works like any other: it buys rigs, and its stakers share the mined SOL.
On top of that, $SUNRIG stakers get 70% of Sunrig's rig fee, in SOL. This share builds up in the program's config account. Every payout moves a slice of it to the $SUNRIG vault, in proportion to the time since the last payout (elapsed / 86,400 s of what is waiting, with elapsed capped at 60 minutes like the payout itself). The vault pays that slice to stakers second by second over the next 5 minutes. If nobody is staked, it buys rigs for $SUNRIG.
The other 30% goes to the buyback wallet. Anyone can send it there once it reaches 0.01 SOL. The owner uses it to buy back $SUNRIG and burn it. The program pays the wallet; the buyback and burn are done by the owner.
The admin can set the official coin only once. Until then, the 70% share waits in the config account.
Fees
- Trading
- pump.fun's own fees, on the curve and on PumpSwap. Sunrig adds nothing. The creator fee part goes to the coin's RigVault.
- Rig buys
- 2% of the SOL a vault spends on rigs (default). 70% of it goes to $SUNRIG stakers, 30% to the buyback wallet. The other 98% goes to the shared pool.
- Launcher cut
- 0 to 10% of the vault's mined SOL, fixed at launch. Stakers get the rest.
- Launch
- The network fee, rent for the coin's Sunrig accounts, what pump.fun charges to create a coin, and your initial buy, if any.
- Staking
- The network fee. Your first stake in a coin also creates your position account, about 0.0016 SOL of rent, which stays with it after you unstake.
- Sweep, harvest, payout, buyback
- Only the network fee, paid by whoever sends the transaction. Usually that is our keeper.
Program and admin powers
The program is upgradeable. Its upgrade authority is the owner of Sunrig. An upgrade could change any of the rules on this page, including the lists below.
The admin can
- Set the payout between 1% and 15% of the pool a day (default 5%).
- Set the rig fee between 0% and 3% (default 2%).
- Set the weight factor k between 0 and 30 (default 10).
- Pause new launches, rig buys in sweep, or payouts.
- Change the keeper key and the buyback wallet.
- Switch a mine's price feed, for example if a feed stops updating.
- Set the official $SUNRIG coin, once.
- Hand the admin role to a new key. The new key must accept it.
The admin cannot
- Withdraw SOL from the pool, a vault, the $SUNRIG share or the buyback share, beyond their normal payouts.
- Touch anyone's staked coins.
- Pause unstake or claim.
- Change a coin's mine or its launcher cut.
- Change a coin's creator. The program has no instruction for it.
- Set the payout, the rig fee or k outside those limits.
Outside Sunrig
pump.fun, PumpSwap and Pyth are run by others. Their rules and fees can change without Sunrig. pump.fun's own admin can change a coin's creator on pump.fun. If that happened, the coin's creator fees would stop reaching its RigVault.
Risks
Sunrig rigs are an on-chain game. Rig rewards come only from rig buys by Sunrig coins; nothing is mined off-chain and nothing is minted. Rewards depend on how much other coins buy and can drop to zero. Memecoins are risky. The program has not been audited. Not financial advice.