This code was AUTOGENERATED using the codama library.
Please DO NOT EDIT THIS FILE, instead use visitors
to add features, then rerun codama to update it.
This code was AUTOGENERATED using the codama library.
Please DO NOT EDIT THIS FILE, instead use visitors
to add features, then rerun codama to update it.
This code was AUTOGENERATED using the codama library.
Please DO NOT EDIT THIS FILE, instead use visitors
to add features, then rerun codama to update it.
The reward one settled play would credit, split into its channels for the
emitted event, as computed by hashrate_reward. loyalty_points + skill_points == total by construction.
Cap on the streak multiplier credited toward the hashrate reward, mirroring
the program’s REWARD_MAX_STREAK. The miner’s live streak
(Miner::current_streak_count) is uncapped; only the multiplier frozen
onto a deployment is clamped here.
Virtual share base used by the on-chain vault math (decimal offset of 3):
conversions behave as if SHARE_OFFSET extra shares and 1 extra satoshi
always exist, so an empty vault mints 1_000 shares per satoshi.
Shares minted for depositing btc_amount BTC into a vault holding
vault_amount BTC with vault_shares shares issued
(SatsVault::btc_amount / SatsVault::btc_shares): scaled by the vault’s
virtual (shares + SHARE_OFFSET) / (assets + 1) ratio and floored, so an
empty vault mints SHARE_OFFSET shares per satoshi. Errors when the
result exceeds u64::MAX.
cancel_public_automation: refund the full escrow balance and close the
automation and its token account. Unconditional; in-flight deployments
settle to the miner profile later.
claim_usd: withdraw amount of the miner authority’s unclaimed USD
winnings from the board’s USD pool to the authority’s USD account. No exit
fee — the full amount transfers.
close_round: tear down a Finished round, sweeping a no-winner round’s
orphaned pot (USD and BTC) into the treasury. Signed by the config’s admin
authority, which receives the round account’s rent.
create_public_automation: escrow deposit_usd_amount and configure the
crank to deploy per_round_usd_amount per round with the given strategy.
One automation per authority.
deploy_public: stake amount USD (base units; all fees are deducted from
it, so the miner parts with exactly amount) on the tiles
in selection_mask for round round_id, as the miner authority. The round
must be the board’s current one and open for deploys; the miner profile and
deployment record PDAs are created by the instruction.
execute_public_automation: crank-signed per-round deploy funded from
automation_authority’s escrow. selection_mask must be Some for
Discretionary automations and None otherwise.
Format raw hashrate units as the UI points amount with 2 decimals
(HASHRATE_DECIMALS): raw 101 → "1.01". Lossless for the full u64
range, unlike an f64 conversion.
rotate_round: reveal current_round_id’s winning tile, sweep the round’s
accumulated fee legs from the board pool to the epoch/1 BTC/treasury pools,
and deploy round current_round_id + 1 as the board’s new active round.
Signed by the config’s round authority; valid once the round’s window elapsed.
settle_deploy_public: settle deployment_authority’s deployment in a
Settled round. authority signs (the owner, or the round authority for
automated deployments); rent_recipient must be the round authority for
automated deployments and the owner for manual ones.
swap_round_stake: relay a pre-built aggregator route that converts part of
the revealed round’s USD into BTC. swap_data and route_accounts are the
route’s opaque instruction data and account list; the on-chain handler
enforces the economics against observed balance deltas. Signed by the
config’s round authority.
update_board_round_duration: overwrite the board’s round_duration (slots).
Applies to future round activations only; the active round keeps its window.
Signed by the config’s admin authority.
update_deployment_settle_grace_duration: admin retunes the settle grace
window (slots after a round settles before stale deployments may be
force-cleaned; 0 disables cleanup).
update_epoch_vault_iteration_duration: overwrite the config’s epoch vault
iteration length (slots). Applies to the currently accumulating iteration
immediately. Signed by the config’s admin authority.
update_min_deploy_usd_amount: overwrite the config’s minimum gross deploy
size (USD mint base units). Applies to every subsequent manual deploy,
automation creation and automation execution. Signed by the config’s admin
authority.
update_unclaimed_hashrate_bps: overwrite the config’s deferred hashrate
bonus ratio (bps of each settled play’s reward). Signed by the config’s
admin authority.
Streak multiplier a deploy into next_round_id would freeze onto its
PublicDeployment, computed from the miner’s live state without
submitting a transaction. Mirrors Miner::record_play followed by
Miner::get_hashrate_streak_multiplier; feed the result into
crate::hashrate_reward to preview the points a deploy would earn.
BTC value of shares against a vault holding vault_amount BTC with
vault_shares shares issued (SatsVault::btc_amount /
SatsVault::btc_shares). claim_fee_bps is
SatrushConfig::sats_vault_claim_fee_bps; pass 0 when only the gross
value matters. Zero shares value to zero without error; shares
exceeding vault_shares is rejected.