Module prelude

Source
Expand description

Broad import surface for vault consumers.

Prefer use templar_common::vault::prelude::*; at call sites that need most vault types, constants, and wad/math helpers.

Re-exports§

pub use super::event::AllocationPositionIssueKind;
pub use super::event::Event;
pub use super::event::PositionReportOutcome;
pub use super::event::QueueAction;
pub use super::event::QueueStatus;
pub use super::event::Reason;
pub use super::event::UnbrickPhase;
pub use super::event::WithdrawProgressPhase;
pub use super::event::WithdrawalAccountingKind;
pub use super::require_at_least;
pub use super::storage_bytes_for_account_id;
pub use super::AllocationDelta;
pub use super::AllocationPlan;
pub use super::AllocationWeights;
pub use super::Delta;
pub use super::DepositMsg;
pub use super::Error;
pub use super::EscrowSettlement;
pub use super::Fee;
pub use super::FeeAccrualAnchor;
pub use super::Fees;
pub use super::IdleBalanceDelta;
pub use super::IdleResyncOutcome;
pub use super::Locker;
pub use super::MarketConfiguration;
pub use super::MarketId;
pub use super::PendingWithdrawal;
pub use super::RealAssetsReport;
pub use super::ResyncIdleReport;
pub use super::VaultConfiguration;
pub use super::external::*;
pub use super::gas::*;
pub use super::params::*;
pub use super::restrictions::*;

Structs§

ActualIdx
Actual index reached during processing.
CapGroupId
CapGroupRecord
Record tracking the state of a cap group.
ExpectedIdx
Expected index in a queue or plan.
Number
A 256-bit unsigned integer wrapper for precise arithmetic.
TimestampNs
Timestamp in nanoseconds.
Wad
An 18-decimal fixed-point value (1e18 = 100%), backed by U256.

Enums§

CapGroupUpdate
A cap-group governance update (shared across chains).
CapGroupUpdateKey
Identifies a cap-group governance update for accept/revoke operations.

Constants§

MAX_FEE_WAD
Backwards-compatible alias for MAX_PERFORMANCE_FEE_WAD.
MAX_MANAGEMENT_FEE_WAD
Maximum annualized management fee rate: 5%.
MAX_PERFORMANCE_FEE_WAD
Maximum performance fee rate on profits: 50%.

Functions§

compute_fee_shares
Computes fee shares to mint given:
compute_fee_shares_from_assets
Computes fee shares to mint from a raw fee_assets amount, given current total assets and supply. Returns 0 when fee is zero, supply is zero, or fee consumes all assets.
mul_div_ceil
Multiplies and divides with ceiling: ceil(x * y / denom). Uses 512-bit intermediate (U512) to avoid overflow; returns 0 if denom is 0. Implemented via quotient/remainder to avoid relying on addition overflow behavior.
mul_div_floor
Multiplies and divides with flooring: floor(x * y / denom). Uses 512-bit intermediate (U512) to avoid overflow; returns 0 if denom is 0.
mul_wad_floor
Multiplies x by y/Wad::SCALE and floors: floor(x * y / 1e18). y is a WAD-scaled fraction (1e18 = 100%), and x is an unscaled amount.

Type Aliases§

WIDE
Wider type for intermediate calculations.