Shader
Events

DocsReference27 of 35 · 8 min read

Events

Every event the shader program emits, the instruction that emits it, and each field.

The program emits events with emit_cpi!: each one is an inner instruction of the program whose data is the 8-byte tag e445a52e51cb9a1d, the event's 8-byte discriminator (the first 8 bytes of sha256("event:<Name>")), and its fields in Borsh. Read receipts decodes one.

#Receipt

One per settlement line: the record of a charge. Emitted by settle.

FieldTypeMeaning
walletpubkeyWallet charged.
agent_keypubkeyAgentKey that spent, or the default key when none did.
job_id[u8; 16]Job identifier.
kindu80 rental, 1 generation.
unitsu64Seconds or job units.
requestedu64Credits the line asked for, base units.
chargedu64Credits debited, base units. Lower than requested only when the balance ran out.
usdc_partu64Part of charged taken from USDC-backed credits.
shdr_partu64Part of charged taken from SHDR-backed credits.
shdr_atomsu64SHDR atoms moved to the burn queue for shdr_part.
line_indexu16Position of the line in its settle instruction, from 0.
settle_nonceu64The credit account's nonce for this settlement.
timestampi64Unix time of the settlement.
meter_keyOption<pubkey>The meter key that sealed the line, or the default key for an unmetered or generation line.
minuteOption<u32>The sealed minute the line charged.
digestOption<[u8; 32]>That minute's digest.
signed_countOption<u32>Signed seconds in the minute, as sealed.

#AgentKeyCreated

An agent key was created. Emitted by create_agent_key.

FieldTypeMeaning
walletpubkeyOwner.
agent_keypubkeyKey address.
key_id[u8; 32]Token identifier.
labelstringLabel.
per_request_capu64Per-request cap.
per_day_capu64Per-day cap.
day_indexi64UTC day the first window counts.
timestampi64Unix time.

#AgentKeyRevokedEvent

An agent key was revoked. Emitted by revoke_agent_key.

FieldTypeMeaning
walletpubkeyOwner.
agent_keypubkeyKey address.
key_id[u8; 32]Token identifier.
timestampi64Unix time.

#AgentKeyUpdated

An agent key's caps changed. Emitted by update_agent_key.

FieldTypeMeaning
walletpubkeyOwner.
agent_keypubkeyKey address.
key_id[u8; 32]Token identifier.
per_request_capu64New per-request cap.
per_day_capu64New per-day cap.
timestampi64Unix time.

#Claimed

NVDAx was claimed. Emitted by claim.

FieldTypeMeaning
walletpubkeyStaker.
amountu64NVDAx atoms sent.
total_claimedu64This stake's total claimed after.
pendingu64Pending after, normally 0.
timestampi64Unix time.

#ConfigInitialized

initialize ran. Emitted by initialize.

FieldTypeMeaning
adminpubkeyAdmin.
settlerpubkeySettler.
price_signerpubkeyPrice signer.
launch_walletpubkeyLaunch wallet.
usdc_mintpubkeyUSDC mint.
nvdax_mintpubkeyNVDAx mint.
fee_share_bpsu16Fee share rate.
timestampi64Unix time.

#ConfigUpdated

update_config ran; the fields hold the values after it. Emitted by update_config.

FieldTypeMeaning
adminpubkeyAdmin.
settlerpubkeySettler.
price_signerpubkeyPrice signer.
launch_walletpubkeyLaunch wallet.
fee_share_bpsu16Fee share rate.
timestampi64Unix time.

#EarnFunded

NVDAx was added to the Earn pool. Emitted by fund_earn.

FieldTypeMeaning
funderpubkeySigner.
requestedu64NVDAx atoms sent.
receivedu64NVDAx atoms that arrived.
total_fundedu64Total funded so far.
total_stakedu64SHDR staked at the time.
acc_reward_per_shareu128Accumulator after.
undistributedu64Undistributed NVDAx after.
timestampi64Unix time.

#ExcessRewardsWithdrawn

The admin recovered excess reward-vault NVDAx. Emitted by withdraw_excess_rewards.

FieldTypeMeaning
adminpubkeyAdmin.
destinationpubkeyReceiving account.
amountu64NVDAx atoms.
available_beforeu64Recoverable before.
timestampi64Unix time.

#ExcessShdrWithdrawn

The admin recovered excess escrow SHDR. Emitted by withdraw_excess_shdr.

FieldTypeMeaning
adminpubkeyAdmin.
destinationpubkeyReceiving account.
amountu64SHDR atoms.
available_beforeu64Recoverable before.
timestampi64Unix time.

#ExcessStakeWithdrawn

The admin recovered excess stake-vault SHDR. Emitted by withdraw_excess_stake.

FieldTypeMeaning
adminpubkeyAdmin.
destinationpubkeyReceiving account.
amountu64SHDR atoms.
available_beforeu64Recoverable before.
timestampi64Unix time.

#FeeSwept

The fee share was paid to the launch wallet. Emitted by sweep_fee_share.

FieldTypeMeaning
crankerpubkeySigner.
launch_walletpubkeyRecipient.
used_usdcu64USDC-backed credits used since the last sweep.
amountu64USDC atoms paid.
total_fee_share_sweptu64Total paid so far.
timestampi64Unix time.

#RevenueWithdrawn

The admin withdrew USDC revenue. Emitted by withdraw_revenue.

FieldTypeMeaning
adminpubkeyAdmin.
destinationpubkeyReceiving account.
amountu64USDC atoms.
available_beforeu64Withdrawable before.
timestampi64Unix time.

#ShdrBurned

Queued SHDR was burned. Emitted by burn_used.

FieldTypeMeaning
crankerpubkeySigner.
amountu64SHDR atoms burned.
total_shdr_burnedu64Total burned so far.
timestampi64Unix time.

#ShdrDeposited

A SHDR deposit landed. Emitted by deposit_shdr.

FieldTypeMeaning
walletpubkeyDepositor.
requested_shdru64SHDR atoms sent.
received_shdru64SHDR atoms that arrived in escrow.
creditedu64Credits booked, base units.
shdr_creditsu64SHDR-backed balance after.
shdr_escrowedu64Escrowed SHDR after.
lifetime_depositedu64Lifetime deposits after.
expires_ati64Quote expiry.
timestampi64Unix time.

#ShdrMintSet

set_shdr_mint ran. Emitted by set_shdr_mint.

FieldTypeMeaning
adminpubkeyAdmin.
shdr_mintpubkeySHDR mint.
earn_poolpubkeyEarnPool address.
timestampi64Unix time.

#Staked

SHDR was staked. Emitted by stake.

FieldTypeMeaning
walletpubkeyStaker.
requestedu64SHDR atoms sent.
receivedu64SHDR atoms that arrived.
stake_amountu64Stake after.
total_stakedu64Pool total after.
pendingu64Pending NVDAx after accrual.
timestampi64Unix time.

#Unstaked

SHDR was withdrawn from Earn. Emitted by unstake.

FieldTypeMeaning
walletpubkeyStaker.
amountu64SHDR atoms withdrawn.
stake_amountu64Stake after.
total_stakedu64Pool total after.
pendingu64Pending NVDAx after accrual.
timestampi64Unix time.

#UsdcDeposited

A USDC deposit landed. Emitted by deposit_usdc.

FieldTypeMeaning
walletpubkeyDepositor.
requestedu64USDC atoms sent.
creditedu64Credits booked, base units: what arrived in the treasury.
usdc_creditsu64USDC-backed balance after.
lifetime_depositedu64Lifetime deposits after.
timestampi64Unix time.

#X402RevenueRecorded

x402 revenue was added to the fee-share count. Emitted by record_x402_revenue.

FieldTypeMeaning
amountu64USDC atoms recorded.
reference[u8; 32]Id of the payment recorded.
used_usdc_unsweptu64The fee-share count after.
timestampi64Unix time.