Program accounts
Every account the shader program owns, with its seeds, its size and each field.
Every account is a PDA of the program at 7zWT5PFYqHPiztwzvkDAANq7JdsLsV1MaLjFJeTLux22. Sizes include Anchor's 8-byte discriminator; rent depends on the cluster, so read it with getMinimumBalanceForRentExemption for the size given. Amounts in credits are in credit base units (1,000 per credit).
#AgentKey
A spending permission a wallet gives one agent. settle checks every line that names it against its caps.
Seeds "agent_key", wallet, key_id. Size 150 bytes with the 8-byte discriminator.
| Field | Type | Meaning |
|---|---|---|
wallet | pubkey | Wallet whose credits the key spends. |
key_id | [u8; 32] | Identifier of the API token bound to this key, chosen when the key is created. |
label | string | Name the owner gave the key. |
per_request_cap | u64 | Most credits, in base units, one settlement line may ask for. |
per_day_cap | u64 | Most credits, in base units, the key may be charged in one UTC day. |
day_index | i64 | UTC day (days since the Unix epoch) that spent_in_day counts. |
spent_in_day | u64 | Credits charged to the key in day_index, in base units. |
revoked | bool | True once revoke_agent_key has run. A revoked key stays on chain with its history. |
created_at | i64 | Unix time the key was created. |
bump | u8 | PDA bump. |
#Config
The one global account. It holds the authorities, the mints, the fee share rate and the running totals the cranks work from, and it owns the USDC treasury and the SHDR escrow.
Seeds "config". Size 284 bytes with the 8-byte discriminator.
| Field | Type | Meaning |
|---|---|---|
admin | pubkey | Authority for update_config, set_shdr_mint and the withdrawals. |
settler | pubkey | The only key settle accepts as signer. |
price_signer | pubkey | Key that co-signs deposit_shdr to attest the SHDR quote. |
launch_wallet | pubkey | Wallet whose USDC associated token account receives the fee share. |
usdc_mint | pubkey | USDC mint. |
nvdax_mint | pubkey | NVDAx mint paid out by Earn. |
shdr_mint | pubkey | SHDR mint, the default (all-zero) key until set_shdr_mint runs. |
fee_share_bps | u16 | Protocol share of used USDC-backed credits, in basis points. |
usdc_credits_outstanding | u64 | USDC-backed credits held by all credit accounts, in base units. |
shdr_credits_outstanding | u64 | SHDR-backed credits held by all credit accounts, in base units. |
used_usdc_unswept | u64 | USDC-backed credits spent, plus x402 revenue recorded, since the last sweep_fee_share. |
shdr_atoms_pending_burn | u64 | SHDR atoms tied to spent credits, waiting for burn_used. |
total_shdr_burned | u64 | SHDR atoms burned so far. |
total_fee_share_swept | u64 | USDC atoms paid to the launch wallet so far. |
bump | u8 | PDA bump. |
require_meter | bool | When true, settle refuses rental lines that carry no meter seal. Generation lines are unaffected. |
#CreditAccount
One per wallet, created by its first deposit. It holds the wallet's credits in two parts and the SHDR behind the SHDR-backed part.
Seeds "credit", wallet. Size 89 bytes with the 8-byte discriminator.
| Field | Type | Meaning |
|---|---|---|
wallet | pubkey | Owner of the credits. |
usdc_credits | u64 | USDC-backed credits, in base units. |
shdr_credits | u64 | SHDR-backed credits, in base units. |
shdr_escrowed | u64 | SHDR atoms in escrow behind shdr_credits. |
settle_nonce | u64 | Count of settlements so far; settle must name it as expected_nonce. |
lifetime_deposited | u64 | Credits ever deposited, in base units. |
lifetime_spent | u64 | Credits ever charged, in base units. |
bump | u8 | PDA bump. |
#EarnPool
The one Earn pool, created by set_shdr_mint. It owns the SHDR stake vault and the NVDAx reward vault.
Seeds "earn". Size 57 bytes with the 8-byte discriminator.
| Field | Type | Meaning |
|---|---|---|
total_staked | u64 | SHDR atoms staked by all wallets. |
acc_reward_per_share | u128 | NVDAx atoms earned per staked SHDR atom since the pool began, times REWARD_SCALE. |
undistributed | u64 | NVDAx atoms received but not yet shared out: funding that arrived while nothing was staked, and rounding dust. |
total_funded | u64 | NVDAx atoms ever received by fund_earn. |
total_claimed | u64 | NVDAx atoms ever claimed. |
bump | u8 | PDA bump. |
#EarnStake
One per wallet that stakes.
Seeds "stake", wallet. Size 81 bytes with the 8-byte discriminator.
| Field | Type | Meaning |
|---|---|---|
wallet | pubkey | Owner of the stake. |
amount | u64 | SHDR atoms staked. |
reward_debt | u128 | amount × acc_reward_per_share at the last accrual, so only later funding counts toward pending. |
pending | u64 | NVDAx atoms accrued and not yet claimed. |
total_claimed | u64 | NVDAx atoms this wallet has claimed. |
bump | u8 | PDA bump. |
#RentalMeter
One per metered rental: the meter key pinned for the job. The settler creates it at the job's first metered settlement and closes it on the line flagged last, returning its rent.
Seeds "meter", job_id. Size 93 bytes with the 8-byte discriminator.
| Field | Type | Meaning |
|---|---|---|
job_id | [u8; 16] | The rental id, 16 bytes. |
meter_key | pubkey | The meter agent's public key; every seal for the job must be signed by it. |
gpu_uuid_hash | [u8; 32] | SHA-256 of the GPU UUID the meter registered. |
highest_minute | u32 | The last minute settled; each new line must name a later minute. |
bump | u8 | PDA bump. |