Open the app

Events

The event every agora instruction emits, how to decode it, and every field.

Each successful instruction emits exactly one event, through Anchor's event CPI: the program calls itself with the event as instruction data, signed by its event authority PDA (seed "__event_authority"). The event is in the transaction's inner instructions, not its logs, so log truncation can't drop it.

Decoding

An event's inner instruction is addressed to the agora program, and its data is, in order:

  1. Anchor's 8-byte event CPI tag, e445a52e51cb9a1d.
  2. The event's 8-byte discriminator, from the table below.
  3. The event's fields, Borsh-encoded in the order listed on this page.

With the IDL, Anchor's BorshCoder decodes it: new BorshCoder(idl).events.decode(base64OfTheRest), where the rest is the data after the tag. The outer transaction gives the signature, slot and block time; the event's own timestamp is the Solana clock's Unix time in seconds.

EventDiscriminatorEmitted byWhat happened
Admissiona03af6fbbf3fe112admitRecords the wallet, role and rent for a completed admission.
CashMoved66cef1dfeb216694deposit, withdrawRecords the custody and register entries of a deposit or withdrawal.
Configured2136500eb18952ebinitialize, update_configRecords the active ledger authorities, custody accounts and fee settings.
IncomeClaimed155990e679125df3claim_incomeRecords cash collected by a position owner and the remaining income pool.
IncomePaidabd010eaa29ad866pay_incomeRecords an issuer's contribution to the pool and the updated per-unit index.
InstrumentListed80192b59c2e55ff3list_instrumentRecords the terms of the new security at listing.
OfferCancelled2d2aafd633c09a09cancel_offerRecords the remaining commitment released when a spot offer closes.
OfferPostedd531efdd6499d220post_offerRecords a maker's reserved units or cash when the offer opens.
RepoDefaulted52616990be93aa24settle_defaultRecords the lender's receipt of collateral after the unpaid repo matured.
RepoOfferCancelled9e0908a53bd468f9cancel_repo_offerRecords the lender's remaining cash released by cancellation.
RepoOfferPosted4bf00ef81dc63ed5post_repo_offerRecords the lender's terms and the cash locked for advances.
RepoOpenedfa89fc3918c3980ftake_repo_offerRecords collateral pledged, cash advanced, maturity and the fixed repurchase amount.
RepoRepaidf4284b80fb6ca0dfrepay_repoRecords payment in full and release of the borrower's collateral.
Trade18feda98fd2b1251take_offerRecords the units, gross cash and taker fee settled in a single fill.
UnitsIssued4e971048836443cdissueRecords the holder's credit and the resulting outstanding supply.

Legs

Every event except Configured, Admission and InstrumentListed carries legs, one per balance the instruction moved. A leg is a Leg: owner, asset, lane, amount and whether it was a credit. Register lanes (Free, Locked, Pledged) name a wallet as owner. IncomePool names the Instrument. Token legs name an SPL token account: they record custody moving between the vault, a wallet's cash ATA and the fee account.

The API turns legs into settlement legs, each with a from and a to: see Settlements.

Configured

The ledger was initialized or its config changed. Emitted by initialize and update_config.

FieldTypeDescription
initializedboolTrue when the ledger is first opened and false on a configuration update.
actorPubkeyWallet that authorized this change.
ledgerPubkeySingleton register configuration and vault authority.
adminPubkeyWallet authorized to update ledger settings.
operatorPubkeyWallet whose signature authorizes a new member.
cash_mintPubkeySix-decimal SPL mint accepted as ledger cash.
cash_vaultPubkeyToken account holding cash deposited into the register.
fee_recipientPubkeyWallet whose cash ATA receives the settlement fee.
fee_bpsu16Settlement fee in basis points of the gross cash leg.
timestampi64Unix second recorded by the chain for this event.

Admission

A wallet was admitted. Emitted by admit.

FieldTypeDescription
walletPubkeyWallet address of the admitted entity.
memberPubkeyPermanent membership record for the wallet.
operatorPubkeyWallet whose signature authorizes a new member.
roleRoleHolder or issuer permissions granted to the member.
entity_namestringRegistered name of the entity represented by the wallet.
rent_lamportsu64Lamports paid to keep the new membership record rent-exempt.
timestampi64Unix second recorded by the chain for this event.

CashMoved

Cash was deposited or withdrawn. Emitted by deposit and withdraw. A deposit's legs debit the wallet's cash ATA, credit the vault and credit the owner's free cash; a withdrawal's run the other way.

FieldTypeDescription
directionCashDirectionWhether cash entered the vault or left it.
ownerPubkeyMember wallet that owns this register position.
legsVec<Leg>Ordered debits and credits that settled together.
timestampi64Unix second recorded by the chain for this event.

InstrumentListed

An instrument was listed. Emitted by list_instrument.

FieldTypeDescription
instrumentPubkeyRegister account of the security involved in this operation.
issuerPubkeyWallet authorized to issue this instrument and pay its income.
codestringUnique uppercase instrument code used to derive its register account.
namestringIssuer's display name for the instrument.
termsTermsEquity designation or bond coupon and maturity.
faceu64Face value per bond unit in cash atoms, or zero for an equity.
timestampi64Unix second recorded by the chain for this event.

UnitsIssued

Units were issued. Emitted by issue, with one leg crediting the recipient's free lane.

FieldTypeDescription
instrumentPubkeyRegister account of the security involved in this operation.
issuerPubkeyWallet authorized to issue this instrument and pay its income.
recipientPubkeyAdmitted wallet receiving newly issued units.
outstandingu64Whole units of this instrument on the register.
legsVec<Leg>Ordered debits and credits that settled together.
timestampi64Unix second recorded by the chain for this event.

OfferPosted

An offer was posted. Emitted by post_offer, with two legs: the maker's free lane debited and locked lane credited.

FieldTypeDescription
offerPubkeySpot offer whose reserved balance changes.
idu64Wallet-local sequential ID used in the account's PDA seeds.
makerPubkeyMember wallet that posted the offer.
instrumentPubkeyRegister account of the security involved in this operation.
sideSideBuy locks cash and sell locks units.
priceu64Cash atoms per whole unit offered.
units_openu64Whole units still available to fill after this operation.
created_ati64Unix second when this record was created.
legsVec<Leg>Ordered debits and credits that settled together.

OfferCancelled

An offer was cancelled. Emitted by cancel_offer, with the lock's two legs reversed.

FieldTypeDescription
offerPubkeySpot offer whose reserved balance changes.
makerPubkeyMember wallet that posted the offer.
instrumentPubkeyRegister account of the security involved in this operation.
sideSideBuy locks cash and sell locks units.
units_cancelledu64Whole units returned or released by cancellation.
units_openu64Whole units still available to fill after this operation.
timestampi64Unix second recorded by the chain for this event.
legsVec<Leg>Ordered debits and credits that settled together.

Trade

An offer was filled. Emitted by take_offer, with seven legs in this order: units out of the seller, units into the buyer's free lane, cash out of the buyer, cash into the seller's free lane, the fee out of the taker's free cash, the fee out of the vault and the fee into the fee account.

FieldTypeDescription
offerPubkeySpot offer whose reserved balance changes.
makerPubkeyMember wallet that posted the offer.
takerPubkeyMember wallet filling another member's offer and paying the fee.
instrumentPubkeyRegister account of the security involved in this operation.
sideSideBuy locks cash and sell locks units.
unitsu64Whole instrument units involved in this operation.
last_priceu64Cash atoms per unit at the last fill, or zero before the first fill.
units_openu64Whole units still available to fill after this operation.
gross_cashu64Cash atoms exchanged before the settlement fee.
feeu64Cash atoms charged to the taker and delivered to the fee recipient.
fee_recipientPubkeyWallet whose cash ATA receives the settlement fee.
timestampi64Unix second recorded by the chain for this event.
legsVec<Leg>Ordered debits and credits that settled together.

RepoOfferPosted

A repo offer was posted. Emitted by post_repo_offer, with the lender's cash moving from free to locked.

FieldTypeDescription
repo_offerPubkeyLender's offer from which the advance is drawn.
idu64Wallet-local sequential ID used in the account's PDA seeds.
lenderPubkeyMember wallet lending cash against the instrument.
instrumentPubkeyRegister account of the security involved in this operation.
advance_per_unitu64Cash atoms advanced per pledged whole unit.
rate_bpsu16Annual simple interest in basis points, using actual seconds and a 365-day year.
term_secondsu32Seconds between opening the repo and its maturity.
cash_availableu64Cash atoms remaining for further advances from the offer.
created_ati64Unix second when this record was created.
legsVec<Leg>Ordered debits and credits that settled together.

RepoOfferCancelled

A repo offer was cancelled. Emitted by cancel_repo_offer, with the remaining cash moving from locked to free.

FieldTypeDescription
repo_offerPubkeyLender's offer from which the advance is drawn.
lenderPubkeyMember wallet lending cash against the instrument.
instrumentPubkeyRegister account of the security involved in this operation.
cash_availableu64Cash atoms remaining after cancellation, always zero.
cancelled_ati64Unix second when the lender released its remaining cash.
legsVec<Leg>Ordered debits and credits that settled together.

RepoOpened

A repo opened. Emitted by take_repo_offer, with four legs: the borrower's units from free to pledged, and the lender's locked cash to the borrower's free cash.

FieldTypeDescription
repoPubkeyRegister account for this borrowing agreement.
repo_offerPubkeyLender's offer from which the advance is drawn.
idu64Wallet-local sequential ID used in the account's PDA seeds.
borrowerPubkeyMember wallet pledging its units and receiving the advance.
lenderPubkeyMember wallet lending cash against the instrument.
instrumentPubkeyRegister account of the security involved in this operation.
units_pledgedu64Whole collateral units pledged by the borrower.
cash_advancedu64Cash atoms transferred from the lender to the borrower at opening.
repurchase_amountu64Full cash atom amount due at repayment, including fixed interest.
opened_ati64Unix second when the borrower drew the advance.
maturityi64Unix second when the obligation matures.
statusRepoStatusCurrent repo state, active, repaid or defaulted.
cash_availableu64Cash atoms remaining for further advances from the offer.
legsVec<Leg>Ordered debits and credits that settled together.

RepoRepaid

A repo was repaid. Emitted by repay_repo, with four legs: the repurchase amount from the borrower's free cash to the lender's, and the units from pledged to free.

FieldTypeDescription
repoPubkeyRegister account for this borrowing agreement.
repo_offerPubkeyLender's offer from which the advance is drawn.
borrowerPubkeyMember wallet pledging its units and receiving the advance.
lenderPubkeyMember wallet lending cash against the instrument.
instrumentPubkeyRegister account of the security involved in this operation.
repaid_ati64Unix second when repayment released the collateral.
repurchase_amountu64Full cash atom amount due at repayment, including fixed interest.
statusRepoStatusCurrent repo state, active, repaid or defaulted.
legsVec<Leg>Ordered debits and credits that settled together.

RepoDefaulted

A matured repo defaulted. Emitted by settle_default, with two legs: the borrower's pledged units out, the lender's free units in.

FieldTypeDescription
repoPubkeyRegister account for this borrowing agreement.
repo_offerPubkeyLender's offer from which the advance is drawn.
borrowerPubkeyMember wallet pledging its units and receiving the advance.
lenderPubkeyMember wallet lending cash against the instrument.
instrumentPubkeyRegister account of the security involved in this operation.
callerPubkeyWallet submitting permissionless default settlement.
defaulted_ati64Unix second when the lender received the collateral after maturity.
statusRepoStatusCurrent repo state, active, repaid or defaulted.
legsVec<Leg>Ordered debits and credits that settled together.

IncomePaid

An issuer paid income. Emitted by pay_income, with two legs: the issuer's free cash out, the instrument's income pool in.

FieldTypeDescription
instrumentPubkeyRegister account of the security involved in this operation.
issuerPubkeyWallet authorized to issue this instrument and pay its income.
outstandingu64Whole units of this instrument on the register.
income_indexu128Cumulative cash atoms per unit scaled by 10 to the twelfth power.
income_poolu64Cash atoms still held for distributions to unit owners.
legsVec<Leg>Ordered debits and credits that settled together.
timestampi64Unix second recorded by the chain for this event.

IncomeClaimed

A holder claimed income. Emitted by claim_income, with two legs: the income pool out, the owner's free cash in.

FieldTypeDescription
instrumentPubkeyRegister account of the security involved in this operation.
ownerPubkeyMember wallet that owns this register position.
income_indexu128Cumulative cash atoms per unit scaled by 10 to the twelfth power.
income_poolu64Cash atoms still held for distributions to unit owners.
legsVec<Leg>Ordered debits and credits that settled together.
timestampi64Unix second recorded by the chain for this event.