Skip to main content
All x0 programs emit Anchor events for off-chain indexing, analytics, and real-time monitoring. Events are logged via emit!() and can be consumed using any Solana event subscription mechanism.

Guard Events

PolicyCreated

Emitted when a new agent policy is initialized.
FieldTypeDescription
policyPubkeyPolicy PDA address
ownerPubkeyOwner’s wallet address
agent_signerPubkeyAgent’s signing key
daily_limitu64Initial daily spending limit
timestampi64Unix timestamp

PolicyUpdated

Emitted when an agent policy is modified.
FieldTypeDescription
policyPubkeyPolicy PDA address
daily_limitOption<u64>New daily limit (if changed)
agent_signerOption<Pubkey>New agent signer (if rotated)
timestampi64Unix timestamp

AgentRevoked

Emitted when an agent’s authority is revoked.
FieldTypeDescription
policyPubkeyPolicy PDA address
revoked_signerPubkeyThe revoked agent signer
timestampi64Unix timestamp

TransferValidated

Emitted when a transfer passes guard validation.
FieldTypeDescription
policyPubkeyPolicy PDA address
amountu64Transfer amount
recipientPubkeyRecipient address
current_spend_24hu64Running 24h spend after this transfer
remaining_allowanceu64Remaining daily allowance
is_confidentialboolWhether this was a confidential transfer
timestampi64Unix timestamp

TransferRejected

Emitted when a transfer is rejected by the guard.
FieldTypeDescription
policyPubkeyPolicy PDA address
amountu64Attempted transfer amount
recipientPubkeyAttempted recipient
reason_codeu16Error code (see Errors reference)
timestampi64Unix timestamp

BlinkGenerated

Emitted when a Blink is generated for human-in-the-loop approval.
FieldTypeDescription
policyPubkeyPolicy PDA address
agentPubkeyAgent that triggered the Blink
amountu64Requested amount
recipientPubkeyRequested recipient
expires_ati64Blink expiration timestamp
timestampi64Unix timestamp

WhitelistUpdated

Emitted when the whitelist configuration is changed.
FieldTypeDescription
policyPubkeyPolicy PDA address
modeStringNew mode: "none", "merkle", "bloom", "explicit" (max 32 chars)
timestampi64Unix timestamp

Escrow Events

EscrowCreated

FieldTypeDescription
escrowPubkeyEscrow PDA address
buyerPubkeyBuyer address
sellerPubkeySeller address
arbiterOption<Pubkey>Optional arbiter
amountu64Escrow amount
memo_hash[u8; 32]SHA-256 of service description
timeouti64Escrow timeout timestamp
timestampi64Unix timestamp

EscrowFunded

FieldTypeDescription
escrowPubkeyEscrow PDA address
amountu64Amount funded
timestampi64Unix timestamp

DeliveryMarked

FieldTypeDescription
escrowPubkeyEscrow PDA address
proof_hashOption<[u8; 32]>Optional delivery proof hash
timestampi64Unix timestamp

DisputeInitiated

FieldTypeDescription
escrowPubkeyEscrow PDA address
initiatorPubkeyParty that initiated the dispute
evidence_hash[u8; 32]SHA-256 of dispute evidence
timestampi64Unix timestamp

FundsReleased

FieldTypeDescription
escrowPubkeyEscrow PDA address
amountu64Amount released
recipientPubkeyRecipient (seller)
is_auto_releaseboolWhether this was auto-release on timeout
timestampi64Unix timestamp

FundsRefunded

FieldTypeDescription
escrowPubkeyEscrow PDA address
amountu64Amount refunded
recipientPubkeyRecipient (buyer)
reasonStringReason for refund (max 128 chars)
timestampi64Unix timestamp

DisputeResolved

FieldTypeDescription
escrowPubkeyEscrow PDA address
resolverPubkeyArbiter or auto-resolver
winnerPubkeyWinner of the dispute
amountu64Amount awarded
timestampi64Unix timestamp

Registry Events

AgentRegistered

FieldTypeDescription
registry_entryPubkeyRegistry entry PDA
agent_idPubkeyAgent’s policy PDA
endpointStringService endpoint URL (max 200 chars)
capability_countu8Number of capabilities registered
timestampi64Unix timestamp

RegistryUpdated

FieldTypeDescription
registry_entryPubkeyRegistry entry PDA
updated_fieldsVec<String>Fields that changed (max 10, each max 32 chars)
timestampi64Unix timestamp

AgentDeregistered

FieldTypeDescription
registry_entryPubkeyRegistry entry PDA
agent_idPubkeyAgent’s policy PDA
timestampi64Unix timestamp

Reputation Events

ReputationInitialized

FieldTypeDescription
reputationPubkeyReputation PDA
agent_idPubkeyAgent’s policy PDA
timestampi64Unix timestamp

ReputationUpdated

FieldTypeDescription
reputationPubkeyReputation PDA
update_typeStringOne of: "success", "dispute", "resolution", "decay" (max 32 chars)
total_transactionsu64New total transaction count
score_scaledu32New reputation score (scaled by 1000)
timestampi64Unix timestamp

Token Events

ConfidentialTransferExecuted

FieldTypeDescription
sourcePubkeySource account (agent)
destinationPubkeyDestination account
encrypted_amountOption<[u8; 64]>Encrypted amount (for auditor)
timestampi64Unix timestamp

AuditLog

FieldTypeDescription
agentPubkeyAgent’s policy PDA
ciphertext[u8; 64]Encrypted amount (decryptable by auditor)
timestampi64Unix timestamp

Protocol Events

ProtocolConfigUpdated

FieldTypeDescription
configPubkeyProtocol config PDA
adminPubkeyAdmin who made the update
update_descriptionStringDescription of change (max 256 chars)
timestampi64Unix timestamp

ProtocolPaused

FieldTypeDescription
configPubkeyProtocol config PDA
is_pausedboolWhether protocol is now paused
reasonStringReason for pause (max 128 chars)
timestampi64Unix timestamp

Wrapper Events

WrapperInitialized

FieldTypeDescription
configPubkeyWrapper config PDA
usdc_mintPubkeyUSDC mint address
wrapper_mintPubkeyx0-USD mint address
reserve_accountPubkeyReserve account address
adminPubkeyInitial admin
timestampi64Unix timestamp

DepositMinted

FieldTypeDescription
userPubkeyUser who deposited
usdc_amountu64USDC deposited
wrapper_mintedu64x0-USD minted (1:1)
reserve_balanceu64New reserve balance
outstanding_supplyu64New outstanding supply
timestampi64Unix timestamp

RedemptionCompleted

FieldTypeDescription
userPubkeyUser who redeemed
amount_burnedu64x0-USD burned
usdc_paidu64USDC paid out (after fee)
fee_collectedu64Fee collected
reserve_balanceu64New reserve balance
outstanding_supplyu64New outstanding supply
timestampi64Unix timestamp

ReserveAlert

FieldTypeDescription
reserve_ratiou64Reserve ratio scaled by 10000
reserve_balanceu64Current reserve balance
outstanding_supplyu64Current outstanding supply
severityAlertLevelWarning or Critical
timestampi64Unix timestamp
AlertLevel enum:
  • Warning — Reserve ratio below 1.01 (less than 1% overcollateralization)
  • Critical — Reserve ratio below 1.0 (undercollateralized)

WrapperPausedEvent

FieldTypeDescription
configPubkeyWrapper config PDA
is_pausedboolWhether wrapper is now paused
adminPubkeyAdmin who triggered the action
timestampi64Unix timestamp

FeeRateUpdated

FieldTypeDescription
configPubkeyWrapper config PDA
old_fee_bpsu16Previous fee rate in basis points
new_fee_bpsu16New fee rate in basis points
adminPubkeyAdmin who made the change
timestampi64Unix timestamp

AdminActionScheduled

FieldTypeDescription
actionPubkeyAdmin action PDA
action_typeStringType of governance action
scheduled_timestampi64When the action can be executed
adminPubkeyAdmin who scheduled
timestampi64Unix timestamp

AdminActionExecuted

FieldTypeDescription
actionPubkeyAdmin action PDA
action_typeStringType of action executed
adminPubkeyAdmin who executed
timestampi64Unix timestamp

AdminActionCancelled

FieldTypeDescription
actionPubkeyAdmin action PDA
adminPubkeyAdmin who cancelled
timestampi64Unix timestamp

EmergencyWithdrawal

FieldTypeDescription
configPubkeyWrapper config PDA
amountu64Amount withdrawn
destinationPubkeyDestination address
adminPubkeyAdmin who executed
timestampi64Unix timestamp

AdminTransferred

FieldTypeDescription
configPubkeyWrapper config PDA
old_adminPubkeyPrevious admin
new_adminPubkeyNew admin
timestampi64Unix timestamp

Subscribing to Events

Using Anchor

import { Program, AnchorProvider } from '@coral-xyz/anchor';

const program = new Program(idl, programId, provider);

// Listen for specific events
const listener = program.addEventListener('TransferValidated', (event, slot) => {
  console.log(`Transfer of ${event.amount} validated at slot ${slot}`);
  console.log(`24h spend: ${event.currentSpend24h}`);
});

// Remove listener
program.removeEventListener(listener);

Using Transaction Logs

Events are encoded in Solana transaction logs. Parse them from confirmed transactions:
const tx = await connection.getTransaction(signature, {
  commitment: 'confirmed',
});

const eventParser = new EventParser(programId, new BorshCoder(idl));
for (const event of eventParser.parse(tx.meta.logMessages)) {
  console.log(event.name, event.data);
}
Last modified on February 8, 2026