• Reading the docs…
Start trading

Program reference

Events

privium_pool emits twelve events, each through Anchor’s event CPI, so every event sits in the transaction’s inner instructions, where log truncation never reaches.

Event Emitted by Discriminator
Committed commit, when the root advances. 469ea2561d6f8fe2
CouncilTranscript council_log, for each payload. e634ca63dc5db42f
CrossingOpened open_crossing, on every open and reopen. d0a6061da35449aa
Deposited deposit, for each deposit. 6f8d1a2da1236439
EnclaveAdmitted register_enclave, when a key enters the Registry. 77974f0b586c067d
EscapeClaimed escape_claim, for each claim paid. b777d7416b223b79
EscapeTriggered trigger_escape, when the Escape opens. 50752ab85903f052
ExitReleased release_exit, for each Exit paid. 22b4e9a9328d524f
MeasurementActivated activate_measurement, when a measurement enters the Registry. f6fe7466672d9618
MeasurementProposed propose_measurement, for each proposal. 5c16d347aa3a8c89
ResidualRouted route_residual, for each fill. 7cfad16c9fa36547
VaultConsolidated consolidate_vault, for each consolidation. 816b7d3988b2ce4f

Reading an event#

An event is an inner instruction in which privium_pool invokes itself with one account, its event authority ["__event_authority"], as signer. Only the program can sign for that PDA, so an instruction that carries event bytes without that signature is not an event.

Bytes Holds
0..8 Anchor’s event tag, e445a52e51cb9a1d
8..16 the event’s discriminator, from the table above
16.. the event’s fields in Borsh, in the order below: integers little endian, keys and hashes as raw 32 bytes

A decoder reads the program’s own inner instructions from getTransaction, keeps those whose program is privium_pool and whose single account is the event authority as signer, and matches the discriminator. log_diff chunks, post_intent blobs and deposit notes are not events: they are read from their instruction’s data in the same transaction.

Deposited#

From deposit. The sequence and note_hash identify the queue entry a later Commit credits, and source_owner names the source token account’s owner as the deposit found it, which holds even when that account closes in the same transaction.

Field Type Meaning
mint Pubkey The asset's mint.
shard u8 Vault shard, 0 or 1.
sequence u64 The entry's sequence in its queue.
amount u64 Base units the vault received.
note_hash [u8; 32] SHA256("privium/note/v1" ‖ note).
source_owner Pubkey Owner of the source token account when the deposit ran.

CrossingOpened#

From open_crossing, on the first open and on every reopen. The hash is the one the Crossing’s Commit must sign.

Field Type Meaning
k u64 Crossing index.
mids_hash [u8; 32] Hash of the Crossing's verified mids.
mids Vec of OpenedMid Each mid as the Crossing recorded it, in remaining-account order; the CrossingState closes at Commit, so the event keeps them.

OpenedMid

One mid of CrossingOpened.mids, as the Crossing recorded it.

Field Type Meaning
mint Pubkey Asset the price is for.
price i64 Pyth price, in units of 10^exponent.
confidence u64 Pyth confidence, in the same units.
publish_time i64 Pyth publish time, Unix seconds.
exponent i32 Pyth exponent.
valid bool True when the program found the price valid: positive, published within max_price_age seconds (at most 1 second ahead) and its confidence within κ.

VaultConsolidated#

From consolidate_vault, at most once per mint per Crossing. spent and received are the measured changes of vault shards 1 and 0; their difference is the transfer fee the move lost, which the asset’s consolidation_loss records.

Field Type Meaning
k u64 Crossing index.
mint Pubkey The consolidated mint.
spent u64 Base units vault shard 1 paid.
received u64 Base units vault shard 0 received; less than spent by the mint's transfer fee.

ResidualRouted#

From route_residual, one per pair routed in the Crossing. spent and received are the measured vault deltas the Commit’s fills hash covers.

Field Type Meaning
k u64 Crossing index.
pair [u8; 32] Pair identifier.
input Pubkey Mint spent.
output Pubkey Mint received.
spent u64 Base units the input vault paid.
received u64 Base units the output vault received.

Committed#

From commit. root is the Ledger root every leaf path of Crossing k verifies against, and slot starts the liveness window.

Field Type Meaning
k u64 Crossing index.
root [u8; 32] The new Ledger root.
da [u8; 32] The Crossing's data availability accumulator.
slot u64 Slot of the Commit.

ExitReleased#

From release_exit, one per Exit paid.

Field Type Meaning
k u64 Crossing whose exits root the release proved against.
index u32 The Exit's index in that exits tree.
mint Pubkey The asset's mint.
amount u64 Base units paid.
destination Pubkey The address paid.

EnclaveAdmitted#

From register_enclave, when a key enters the Registry.

Field Type Meaning
epoch u64 Key epoch.
signing_key Pubkey The admitted Ed25519 key.
measurement [u8; 32] The quote's measurement.

MeasurementProposed#

From propose_measurement. activation_slot is the first slot at which activate_measurement can add the measurement.

Field Type Meaning
measurement [u8; 32] The proposed measurement.
source_commit [u8; 32] Digest of the source commit.
manifest_digest [u8; 32] Digest of the build manifest.
activation_slot u64 The first slot at which it can activate.

MeasurementActivated#

From activate_measurement, when the measurement enters the Registry.

Field Type Meaning
measurement [u8; 32] The measurement now in the Registry.
activation_slot u64 The activation slot its proposal set.

EscapeTriggered#

From trigger_escape. root is the frozen root every Escape request proves against.

Field Type Meaning
slot u64 Slot of the trigger.
root [u8; 32] The frozen Ledger root.

EscapeClaimed#

From escape_claim, one per request paid. The payouts across mints are the token transfers of the same transaction.

Field Type Meaning
request Pubkey The EscapeRequest account.
mint Pubkey The request's mint.
amount u64 The balance b the proof opened.
destination Pubkey The address paid.

CouncilTranscript#

From council_log, one per payload. member is the transaction’s signer as payer, not a Council member’s identity: a Council message carries its member number and that member’s signature inside the payload, where its readers check them (Checking the key generation transcript).

Field Type Meaning
member Pubkey The payer that signed council_log. A Council message names its member and carries that member's signature inside the payload.
payload bytes The payload as posted, at most 2,048 bytes.