Skip to main content
VaultAssertion evaluates onchain or caller-supplied evidence and returns a report. It does not authorize actions or replace program checks. Import it from @exponent-labs/exponent-sdk.

Evaluate a plan

Report

Missing or invalid evidence appears in the report; unexpected evaluator failures become blocking checks. A slot baseline is not an atomic multi-account snapshot.

Conditions

Capacity resize options report the decision; they do not rewrite your action amount. Amounts ending in Atomic use token base units. APY, LTV, spread, and slippage bounds use basis points (10_000 = 100%); token prices and exchange rates use numeric bounds. A backing snapshot accepts sySupplyAtomic, underlyingBackingAtomic, exchangeRate, and lastUpdatedSlot. Numeric inputs accept number, string, bigint, BN, or Decimal.

Thresholds and custom checks

Numeric thresholds accept warnAbove, blockAbove, warnBelow, and blockBelow. Bps thresholds use the corresponding ...Bps names. Bounds are inclusive; empty threshold objects are invalid. Optional freshness or spread bounds do not replace a condition’s required primary bound. A custom evaluator receives connection, vault context, reference slot, slotAge, cached fetchAccountInfo, fetchTokenAmount, fetchKaminoObligation, and allow/warn/block evidence helpers. Return { decision, message, cause?, observed?, thresholds?, accounts? }.

Attach to a transaction builder

beforeSend is the default. beforeTransaction evaluates before each set. A factory receives the connection, build-time vault, signer, build result, and current set’s label/index/count when applicable. Reload state inside the factory if the check needs a newer snapshot. A blocking report stops sending; warnings remain in the send result. plan.simulate() does not run assertions. See Transaction builder for result and lifecycle contracts.