Skip to content
NAVIDocs
Open app
Skip to Content

Move interface reference

Look up objects, constants, entrypoints, view functions, events and abort codes.

10. Interface reference

Module: navi_vault::navi_vault. Events: navi_vault::events. String denotes std::ascii::String throughout.

External types:

TypeModule
Storagelending_core::storage
Pool<CoinType>lending_core::pool
IncentiveV2lending_core::incentive_v2::Incentive
IncentiveV3lending_core::incentive_v3::Incentive
RewardFund<T>lending_core::incentive_v3::RewardFund
PriceOracleoracle::oracle
SuiSystemStatesui_system::sui_system
Clocksui::clock

10.1 Objects

Vault<phantom CoinType> has key — shared

FieldTypeDescription
versionu64Must equal the package's VAULT_VERSION.
total_sharesu64All shares, including accrued but unclaimed fee shares.
idle_balanceBalance<CoinType>Assets held in the vault, not deployed.
default_marketaddressPool to which deposits are routed; 0x0 routes deposits to the idle balance.
management_feeu64WAD-scaled annual rate. Bounded by MAX_MANAGEMENT_FEE_APY_WAD.
_performance_feeu64WAD-scaled share of profit. Bounded by MAX_PERFORMANCE_FEE_WAD.
total_assetsu64Gross assets under management recorded at the last accrual; the performance-fee baseline. Not live AUM — use get_total_assets.
last_update_timestampu64Last accrual, in seconds.
marketsVecMap<address, MarketInfo>Keyed by pool address.
pending_management_fee_sharesu64Minted, not yet assigned to a Receipt.
pending_performance_fee_sharesu64As above.
reward_rulesvector<VaultRewardRule>Position is the rule_index argument. Append-only.
collected_rewardsBagReward coin type string → Balance<RewardCoinType>.
user_statesTable<address, UserState>Keyed by Receipt object address.
pausedboolSee §9.
vault_capu64Vault-level deposit cap; 0 denotes no limit.

Receipt has key, store — owned

FieldType
vault_addressaddress

The Receipt's object address is the key into user_states. Transferring the object transfers the position in full, including reward state.

UserState has store

FieldTypeDescription
sharesu64Share balance.
reward_indicesVecMap<String, u256>Per-rule index snapshot.
reward_totalVecMap<String, u256>Per-rule cumulative entitlement.
reward_claimedVecMap<String, u256>Per-rule amount already paid.

Rule keys are "{navi_pool_id}|{reward_coin_type}".

MarketInfo has store

FieldTypeDescription
capu64Upper bound on current_balance; 0 denotes no limit.
penaltyu64WAD-scaled additional share burn on non-default-market withdrawals. Bounded by MAX_PENALTY.
current_balanceu64Cached position in native decimals. Written only by sync_market_balance.
lossu64Recorded bad debt, in NAVI's 9-decimal representation.
last_sync_atu64Milliseconds. Reset to 0 by add_market and set_loss.
storage_addressaddressRequired Storage object.
asset_idu8Reserve index within that Storage.
incentive_v3_addressaddressRequired IncentiveV3 object.
incentive_v2_addressaddressRequired IncentiveV2 object.
account_capOption<AccountCap>The vault's NAVI account for this market. Internal.
statusMarketStatusActive (discriminant 0) or Disabled (1).

Disabled markets accept no deposits or allocations and cannot serve as the default market. Withdrawals and deallocations remain permitted, the balance continues to count toward assets under management, and synchronization remains required.

VaultRewardRule has drop, store

FieldTypeDescription
navi_pool_idaddressMarket the rule belongs to; 0x0 for vault-native rules.
reward_coin_typeStringFully qualified reward coin type.
incentive_rule_idaddressNAVI incentive rule identifier; 0x0 for vault-native rules.
vault_reward_indexu256RAY-scaled cumulative reward per share.
last_harvest_atu64Milliseconds. Last collect_reward for market rules; last index settlement for vault-native rules.
is_vault_nativebooltrue for operator-funded rules streamed at a rate; false for rules harvested from NAVI.
reward_rateu256RAY-scaled reward per millisecond. 0 for market rules.
is_activeboolSoft-delete flag. Inactive rules are skipped by collect_reward and by the harvest assertion; historical entitlements remain claimable.
total_reward_depositedu64Vault-native budget.
total_reward_distributedu64Vault-native amount streamed to date. Index growth halts at the budget.

Capabilities and registries

ObjectAbilitiesScope
Timelocks<CoinType>key (shared)vault_id, proposals: Table<ProposalKey, TimelockProposal<CoinType>>.
Allocatorskey, store (shared)valid_caps: Table<ID, bool>.
Curatorskey, store (shared)valid_caps: Table<ID, bool>.
AdminCapkey, storeGlobal. Minted once in init.
EmergencyCapkey, storeGlobal. set_loss, withdraw_reward.
PauseCapkey onlyGlobal, pause-only; the absence of store makes it non-transferable by the holder. No admin revocation path; the holder may call destroy_pause_cap.
AllocatorCapkey, storeBound to one vault_id.
CuratorCapkey, storeBound to one vault_id.
ManagementFeeCapkey, storeBound to one vault_id.
PerformanceFeeCapkey, storeBound to one vault_id.

10.2 Constants

NameValueDescription
TIMELOCK_DURATION86_40024 hours, in seconds.
TIMELOCK_GRACE_PERIOD604_8007 days. Execution window after unlock.
WAD1e18Fee and penalty scale.
MAX_PENALTY0.3e1830%.
MAX_MANAGEMENT_FEE_APY_WAD0.2e1820% annualized.
MAX_PERFORMANCE_FEE_WAD0.4e1840% of profit.
VIRTUAL_SHARES1_000_000Inflation-attack offset.
SECONDS_PER_YEAR31_536_000Management-fee denominator.
RAY1e27Reward index and rate scale (math::ray_math).

10.3 Depositor entrypoints

create_receipt

public fun create_receipt<CoinType>(
    self: &Vault<CoinType>,
    ctx: &mut TxContext,
): Receipt

Optional; deposit mints a Receipt when passed option::none. Emits CreateReceiptEvent.

Receipts minted implicitly inside deposit do not emit CreateReceiptEvent; indexers must treat DepositEvent.receipt_id as the authoritative source for position creation.

deposit

public fun deposit<CoinType>(
    self: &mut Vault<CoinType>,
    receipt_opt: Option<Receipt>,
    clock: &Clock,
    storage: &mut Storage,
    pool: &mut Pool<CoinType>,
    deposit_coin: Coin<CoinType>,
    amount: u64,
    incentive_v2: &mut IncentiveV2,
    incentive_v3: &mut IncentiveV3,
    ctx: &mut TxContext,
): (Receipt, u64)   // (receipt, shares_minted)

Preconditions: all markets synchronized and all active market rules harvested in the current block.

Execution order: version check → freshness assertions → update_vault_native_indices → accrue_interest → vault cap check → share computation against pre-deposit state → asset routing → share credit.

Emits DepositEvent, whose pool_address is 0x0 when assets were routed to the idle balance.

withdraw

public fun withdraw<CoinType>(
    self: &mut Vault<CoinType>,
    receipt: &mut Receipt,
    clock: &Clock,
    oracle: &PriceOracle,
    storage: &mut Storage,
    pool: &mut Pool<CoinType>,
    amount: u64,
    max_shares: u64,
    from_default: bool,
    incentive_v2: &mut IncentiveV2,
    incentive_v3: &mut IncentiveV3,
    system_state: &mut SuiSystemState,
    ctx: &mut TxContext,
): (Coin<CoinType>, u64)   // (coin_out, shares_burned)

Preconditions: all markets synchronized and all active market rules harvested in the current block. Semantics of amount, max_shares and from_default are specified in §5.2.

Emits WithdrawEvent.

claim_reward

public fun claim_reward<CoinType, RewardCoinType>(
    self: &mut Vault<CoinType>,
    receipt: &mut Receipt,
    clock: &Clock,
    ctx: &mut TxContext,
): Coin<RewardCoinType>

No freshness preconditions. Settles vault-native indices, then pays reward_total − reward_claimed summed across all rules denominated in RewardCoinType.

Returns a zero-valued coin, without aborting, when the Receipt has no UserState, the reward bag holds no entry for the coin type, the bag balance is zero, or nothing is claimable. If the bag holds less than the computed entitlement the payout is refused outright rather than partially settled. Emits ClaimRewardEvent.

10.4 Block support entrypoints

Both are permissionless.

sync_market_balance

public fun sync_market_balance<CoinType>(
    self: &mut Vault<CoinType>,
    storage: &mut Storage,
    pool: &Pool<CoinType>,
    clock: &Clock,
)

Calls lending::update_state_of_user, reads get_user_balance × supply_index, converts from NAVI's 9-decimal representation to native decimals, subtracts converted loss with a floor of zero, and writes current_balance and last_sync_at = clock.timestamp_ms().

The market is identified by object::id(pool); storage must match the market's recorded storage_address. Emits SyncMarketBalanceEvent.

collect_reward

public fun collect_reward<CoinType, RewardCoinType>(
    self: &mut Vault<CoinType>,
    clock: &Clock,
    storage: &mut Storage,
    incentive_v3: &mut IncentiveV3,
    reward_fund: &mut incentive_v3::RewardFund<RewardCoinType>,
    rule_index: u64,
)

Harvests the NAVI incentive for one rule into collected_rewards, advances vault_reward_index by harvested × RAY / total_shares, and sets last_harvest_at = clock.timestamp_ms().

Returns without effect when the rule is vault-native or inactive. When total_shares == 0 the harvested amount enters the reward bag without index growth; the resulting dust is unclaimable. Emits CollectRewardEvent.

10.5 View functions

// Position
public fun get_user_shares<CoinType>(&Vault<CoinType>, receipt: &Receipt): u64
public fun get_user_balance<CoinType>(&Vault<CoinType>, receipt: &Receipt): u64
public fun get_user_claimable_reward_amount<CoinType, RewardCoinType>(&Vault<CoinType>, receipt: &Receipt): u64

// Conversion
public fun convert_to_assets<CoinType>(&Vault<CoinType>, shares: u64): u64   // floor
public fun convert_to_shares<CoinType>(&Vault<CoinType>, assets: u64): u64   // floor

// Vault state
public fun get_total_assets<CoinType>(&Vault<CoinType>): u64
public fun get_total_shares<CoinType>(&Vault<CoinType>): u64
public fun get_idle_balance<CoinType>(&Vault<CoinType>): u64
public fun get_vault_cap<CoinType>(&Vault<CoinType>): u64
public fun get_vault_default_market<CoinType>(&Vault<CoinType>): address
public fun get_management_fee<CoinType>(&Vault<CoinType>): u64
public fun get_performance_fee<CoinType>(&Vault<CoinType>): u64
public fun get_baseline_total_assets<CoinType>(&Vault<CoinType>): u64
public fun get_last_update_timestamp<CoinType>(&Vault<CoinType>): u64
public fun get_pending_management_fee_shares<CoinType>(&Vault<CoinType>): u64
public fun get_pending_performance_fee_shares<CoinType>(&Vault<CoinType>): u64
public fun is_paused<CoinType>(&Vault<CoinType>): bool
public fun version<CoinType>(&Vault<CoinType>): u64

// Market enumeration
public fun num_markets<CoinType>(&Vault<CoinType>): u64
public fun get_market_address_at_index<CoinType>(&Vault<CoinType>, idx: u64): address
public fun get_market_info<CoinType>(&Vault<CoinType>, pool_address: address): u64
public fun get_market_config<CoinType>(&Vault<CoinType>, pool_address: address)
    : (u64, u64, u64, u8, u64, address, u8, address, address)

// Reward enumeration
public fun num_reward_rules<CoinType>(&Vault<CoinType>): u64
public fun get_rule_info<CoinType>(&Vault<CoinType>, idx: u64)
    : (address, String, address, u256, u64, bool, u256, bool, u64, u64)
public fun get_collected_reward_balance<CoinType, RewardCoinType>(&Vault<CoinType>): u64
public fun num_allocator_caps(&Allocators): u64

get_user_balance and get_user_claimable_reward_amount return 0 for a Receipt belonging to a different vault rather than aborting. convert_to_assets and convert_to_shares return 0 when the input is 0 or when total_shares == 0. get_market_info returns 0 for an unregistered pool address.

version_verification<CoinType>(&Vault<CoinType>) is also public. It is an assertion helper, not a getter: it returns nothing and aborts with E_INCORRECT_VERSION on mismatch. No other view function performs a version check (§9).

get_market_config return positions:

PositionFieldType
0capu64
1penaltyu64 (WAD)
2lossu64 (9-decimal)
3statusu8 — 0 Active, 1 Disabled
4last_sync_atu64 (ms)
5storage_addressaddress
6asset_idu8
7incentive_v3_addressaddress
8incentive_v2_addressaddress

Aborts E_MARKET_NOT_FOUND for an unregistered pool address. get_market_address_at_index aborts E_RULE_INDEX_OUT_OF_BOUNDS when idx ≥ num_markets.

get_rule_info return positions:

PositionFieldType
0navi_pool_idaddress
1reward_coin_typeString
2incentive_rule_idaddress
3vault_reward_indexu256 (RAY)
4last_harvest_atu64 (ms)
5is_vault_nativebool
6reward_rateu256 (RAY per ms)
7is_activebool
8total_reward_depositedu64
9total_reward_distributedu64

10.6 Operator entrypoints

Not required for depositor-facing integration.

Allocator — AllocatorCap registered in the shared Allocators object and bound to the vault:

public fun allocate<CoinType>(
    self: &mut Vault<CoinType>, allocators: &Allocators, cap: &AllocatorCap, clock: &Clock,
    storage: &mut Storage, pool: &mut Pool<CoinType>, amount: u64,
    incentive_v2: &mut IncentiveV2, incentive_v3: &mut IncentiveV3, ctx: &mut TxContext,
)

public fun deallocate<CoinType>(
    self: &mut Vault<CoinType>, allocators: &Allocators, cap: &AllocatorCap, clock: &Clock,
    oracle: &PriceOracle, storage: &mut Storage, pool: &mut Pool<CoinType>, amount: u64,
    incentive_v2: &mut IncentiveV2, incentive_v3: &mut IncentiveV3,
    system_state: &mut SuiSystemState, ctx: &mut TxContext,
)

Both require the target market to be synchronized in the current block (E_MARKET_NOT_READ) and the capability to be registered (E_UNAUTHORIZED) and bound to the vault (E_VAULT_MISMATCH). allocate additionally requires Active status and respects the market cap. deallocate credits the amount actually received to the idle balance.

Fee recipient:

public fun claim_management_fee<CoinType>(&mut Vault<CoinType>, cap: &ManagementFeeCap, receipt: &Receipt, clock: &Clock)
public fun claim_performance_fee<CoinType>(&mut Vault<CoinType>, cap: &PerformanceFeeCap, receipt: &Receipt, clock: &Clock)

Curator — immediate effect:

public fun set_vault_cap_by_curator<CoinType>(&mut Vault<CoinType>, &Curators, &CuratorCap, vault_cap: u64)
public fun set_market_cap_and_penalty_by_curator<CoinType>(&mut Vault<CoinType>, &Curators, &CuratorCap, pool_address: address, cap: u64, penalty: u64)
public fun create_reward_rule_by_curator<CoinType, RewardCoinType>(&mut Vault<CoinType>, &Curators, &CuratorCap, navi_pool_id: address, incentive_rule_id: address)
public fun disable_reward_rule_by_curator<CoinType, RewardCoinType>(&mut Vault<CoinType>, &Curators, &CuratorCap, clock: &Clock, navi_pool_id: address)
public fun deposit_reward_balance_by_curator<CoinType, RewardCoinType>(&mut Vault<CoinType>, &Curators, &CuratorCap, coin: Coin<RewardCoinType>, _ctx: &mut TxContext)
public fun set_reward_rate_by_curator<CoinType, RewardCoinType>(&mut Vault<CoinType>, &Curators, &CuratorCap, clock: &Clock, total_supply: u64, duration_ms: u64)

Curator — timelocked:

public fun propose_management_fee<CoinType>(&Vault<CoinType>, &Curators, &CuratorCap, &mut Timelocks<CoinType>, &Clock, new_fee: u64)
public fun exec_management_fee<CoinType>(&mut Vault<CoinType>, &mut Timelocks<CoinType>, &Clock)

public fun propose_performance_fee<CoinType>(&Vault<CoinType>, &Curators, &CuratorCap, &mut Timelocks<CoinType>, &Clock, new_fee: u64)
public fun exec_performance_fee<CoinType>(&mut Vault<CoinType>, &mut Timelocks<CoinType>, &Clock)

public fun propose_default_market<CoinType>(&Vault<CoinType>, &Curators, &CuratorCap, &mut Timelocks<CoinType>, &Clock, pool_address: address)
public fun exec_default_market<CoinType>(&mut Vault<CoinType>, &mut Timelocks<CoinType>, &Clock)

public fun propose_set_market_status<CoinType>(&Vault<CoinType>, &Curators, &CuratorCap, &mut Timelocks<CoinType>, &Clock, pool_address: address, target_status: u8)
public fun exec_set_market_status<CoinType>(&mut Vault<CoinType>, &mut Timelocks<CoinType>, &Clock, pool_address: address)

public fun propose_add_market<CoinType>(&Vault<CoinType>, &Curators, &CuratorCap, &mut Timelocks<CoinType>, &Clock,
    pool_address: address, cap: u64, storage_address: address, asset_id: u8,
    incentive_v3_address: address, incentive_v2_address: address, penalty: u64)
public fun exec_add_market<CoinType>(&mut Vault<CoinType>, &mut Timelocks<CoinType>, &Clock,
    &Storage, &Pool<CoinType>, &IncentiveV2, &IncentiveV3, ctx: &mut TxContext)

public fun cancel_proposal<CoinType>(&Vault<CoinType>, &Curators, &CuratorCap, &mut Timelocks<CoinType>, proposal_type_code: u8, subject: address)

exec_management_fee and exec_performance_fee require all markets synchronized and all active market rules harvested in the same block, because they settle fees at the prior rate before applying the new one. exec_add_market requires no capability: all applied values originate from the stored proposal, and the supplied objects are verified against it.

Admin — AdminCap, immediate effect:

public fun create_vault<CoinType>(&AdminCap, ctx: &mut TxContext)
public fun version_migrate<CoinType>(&AdminCap, &mut Vault<CoinType>)
public fun set_paused<CoinType>(&mut Vault<CoinType>, &AdminCap, paused: bool)
public fun mint_pause_cap(&AdminCap, recipient: address, ctx: &mut TxContext)
public fun set_default_market_by_admin<CoinType>(&mut Vault<CoinType>, &AdminCap, pool_address: address)
public fun set_market_status_by_admin<CoinType>(&mut Vault<CoinType>, &AdminCap, pool_address: address, target_status: u8)
public fun set_management_fee_by_admin<CoinType>(&mut Vault<CoinType>, &AdminCap, new_fee: u64, clock: &Clock)
public fun set_performance_fee_by_admin<CoinType>(&mut Vault<CoinType>, &AdminCap, new_fee: u64, clock: &Clock)
public fun set_market_cap_and_penalty_by_admin<CoinType>(&mut Vault<CoinType>, &AdminCap, pool_address: address, cap: u64, penalty: u64)
public fun add_market_by_admin<CoinType>(&mut Vault<CoinType>, &AdminCap, &Storage, &Pool<CoinType>, &IncentiveV2, &IncentiveV3, cap: u64, asset_id: u8, penalty: u64, ctx: &mut TxContext)
public fun cancel_proposal_by_admin<CoinType>(&Vault<CoinType>, &AdminCap, &mut Timelocks<CoinType>, proposal_type_code: u8, subject: address)
public fun create_allocators(&AdminCap, ctx: &mut TxContext)
public fun add_allocator<CoinType>(&AdminCap, &mut Allocators, &Vault<CoinType>, recipient: address, ctx: &mut TxContext)
public fun remove_allocator<CoinType>(&AdminCap, &mut Allocators, &Vault<CoinType>, cap_id: ID)
public fun create_curators<CoinType>(&AdminCap, &Vault<CoinType>, ctx: &mut TxContext)
public fun add_curator<CoinType>(&AdminCap, &mut Curators, &Vault<CoinType>, recipient: address, ctx: &mut TxContext)
public fun remove_curator(&AdminCap, &mut Curators, cap_id: ID)
public fun create_reward_rule_by_admin<CoinType, RewardCoinType>(&mut Vault<CoinType>, &AdminCap, navi_pool_id: address, incentive_rule_id: address)
public fun disable_reward_rule_by_admin<CoinType, RewardCoinType>(&mut Vault<CoinType>, &AdminCap, clock: &Clock, navi_pool_id: address, is_forced: bool)
public fun deposit_reward_balance_by_admin<CoinType, RewardCoinType>(&mut Vault<CoinType>, &AdminCap, coin: Coin<RewardCoinType>, _ctx: &mut TxContext)
public fun set_reward_rate_by_admin<CoinType, RewardCoinType>(&mut Vault<CoinType>, &AdminCap, clock: &Clock, total_supply: u64, duration_ms: u64)

set_management_fee_by_admin and set_performance_fee_by_admin carry the same freshness preconditions as the corresponding exec_* functions.

Pause guardian — PauseCap:

public fun pause_by_cap<CoinType>(&mut Vault<CoinType>, &PauseCap)
public fun destroy_pause_cap(cap: PauseCap, ctx: &mut TxContext)

pause_by_cap can only set paused = true; lifting the pause requires AdminCap.

Emergency — EmergencyCap:

public fun set_loss<CoinType>(&mut Vault<CoinType>, &EmergencyCap, pool_address: address, loss: u64)
public fun withdraw_reward<CoinType, RewardCoinType>(&mut Vault<CoinType>, &EmergencyCap, clock: &Clock, rule_index: u64, amount: u64, ctx: &mut TxContext): Coin<RewardCoinType>

set_loss takes loss in NAVI's 9-decimal representation (§1.2) and resets last_sync_at to 0. withdraw_reward reaches only the undistributed remainder of a vault-native rule, total_reward_deposited − total_reward_distributed, and reduces total_reward_deposited accordingly.

The *_for_testing helpers present in the module source are annotated #[test_only] and are absent from the published package and its ABI.

10.7 Error codes

CodeNameCause
10001E_UNAUTHORIZEDallocate or deallocate with an AllocatorCap absent from the registry.
10002E_INSUFFICIENT_BALANCEInsufficient shares, market balance, idle balance, or reward bag balance.
10003E_MARKET_NOT_FOUNDPool address is not a registered market.
10004E_TIMELOCK_NOT_EXPIREDexec_* before the unlock time.
10005E_CAP_EXCEEDEDMarket deposit cap exceeded.
10006E_MARKET_NOT_READsync_market_balance missing for a market in the current block.
10007E_REWARDS_NOT_COLLECTEDcollect_reward missing for an active market rule.
10008E_RECEIPT_NOT_FOUNDReceipt has no UserState; it has never held a deposit.
10009E_VAULT_MISMATCHReceipt, capability or Timelocks object belongs to a different vault.
10010E_MARKET_INVALIDTarget market is not Active.
10011E_PAUSEDVault is paused.
10012E_DEPOSIT_TOO_SMALLDeposit would mint zero shares.
10013E_OVERFLOWNumeric bound exceeded.
10014E_INVALID_PENALTYRecorded penalty exceeds MAX_PENALTY.
10015E_ALLOCATOR_CAP_NOT_FOUNDremove_allocator for an unregistered capability.
10016E_PROPOSAL_NOT_FOUNDNo proposal for the given type and subject.
10017E_MARKET_CONFIG_MISMATCHStorage, IncentiveV2 or IncentiveV3 does not match the market's recorded address.
10018E_TIMELOCK_EXPIREDGrace period elapsed.
10019E_CURATOR_CAP_NOT_VALIDCuratorCap absent from the registry.
10020E_CURATOR_CAP_NOT_FOUNDremove_curator for an unregistered capability.
10021E_AMOUNT_MISMATCHdeposit_coin.value() ≠ amount.
10022E_DEFAULT_MARKET_MISMATCHPool is not the default market on a path that requires it.
10023E_PROPOSAL_ALREADY_EXISTSA live proposal already exists for the type and subject.
10024E_PROPOSAL_NOOPProposal would produce no change.
10025E_WRONG_PROPOSAL_TYPEProposal type code does not match the stored proposal.
10026E_RULE_NOT_FOUNDReward rule absent, or not vault-native where required.
10027E_RULE_ALREADY_ACTIVERule is already active, or collides with a vault-native rule.
10028E_RULE_ALREADY_INACTIVERule is already disabled.
10029E_REWARD_COIN_TYPE_MISMATCHRewardCoinType differs from the rule's recorded coin type.
10030E_RULE_INDEX_OUT_OF_BOUNDSRule or market index out of range.
10031E_FEE_OUT_OF_RANGEFee exceeds its maximum.
10032E_INVALID_STATUStarget_status greater than 1.
10033E_FEE_UNCHANGEDNew fee equals the current fee.
10034E_INVALID_AMOUNTAmount is zero, or an internal amount invariant is violated.
10035E_MARKET_ALREADY_EXISTSMarket addition for an existing pool address.
10036E_INCORRECT_VERSIONVault not migrated after a package upgrade.
10037E_VERSION_UPGRADE_NOT_NEEDEDversion_migrate on an already-current vault.
10038E_ACCOUNTING_ERRORInternal invariant violation.
10039E_VAULT_CAP_EXCEEDEDVault-level deposit cap exceeded.
10040E_SLIPPAGE_EXCEEDEDShares burned exceed max_shares.
10041E_CANNOT_DISABLE_DEFAULT_MARKETAttempt to disable the current default market.
10042E_WITHDRAW_EXCEEDS_UNDISTRIBUTEDwithdraw_reward exceeds the undistributed remainder.

Aborts in the 10001–10042 range originate in navi_vault. Calls that reach the lending and oracle packages can also abort with their codes, which occupy a different range. Those an integrator encounters on normal paths are:

CodeOriginCause
1400incorrect_versionAny call reaching lending_core while the vault package is linked against an older lending_core than the live Storage.version (§3.4). Requires a vault package upgrade; not recoverable client-side. Raised in a module named version, like the vault's own 10036 — discriminate on code and package.
1502invalid_pricewithdraw or deallocate while the oracle price for the asset is outside update_interval (§3.3). Transient; prevented by the price update in §5.6.
1506insufficient_balancewithdraw or deallocate while the reserve's utilization leaves insufficient free liquidity (§3.3). Transient; distinct from E_INSUFFICIENT_BALANCE (10002).
1604exceeded_maximum_deposit_capdeposit or allocate while NAVI's reserve supply ceiling for the asset is reached (§3.3), independently of the vault and market caps.

Codes are from lending_core::error. This is not an exhaustive enumeration of lending-side aborts; it covers the constraints reachable on the deposit, withdrawal and allocation paths.

10.8 Events

Module navi_vault::events. All events carry vault: address except where noted.

EventFields
CreateVaultEventvault, sender
CreateReceiptEventvault, sender, receipt_id
DepositEventvault, sender, receipt_id, pool_address (0x0 when routed to idle), amount, shares
WithdrawEventvault, sender, receipt_id, pool_address (0x0 when served entirely from idle), amount, shares_burned
ClaimRewardEventvault, sender, receipt_id, reward_coin_type, amount
CollectRewardEventvault, rule_index, reward_coin_type, amount
SyncMarketBalanceEventvault, pool_address, current_balance
AllocateEventvault, sender, pool_address, amount
DeallocateEventvault, sender, pool_address, amount
ClaimManagementFeeEventvault, receipt_id, shares
ClaimPerformanceFeeEventvault, receipt_id, shares
ProposalCreatedEventvault, proposal_type, subject, executable_at (seconds)
ProposalExecutedEventvault, proposal_type, subject
ProposalCancelledEventvault, proposal_type, subject
SetDefaultMarketEventvault, pool_address
SetMarketStatusEventvault, pool_address, target_status
SetManagementFeeEventvault, old_fee, new_fee
SetPerformanceFeeEventvault, old_fee, new_fee
AddMarketEventvault, pool_address, cap, penalty, storage_address, asset_id, incentive_v3_address, incentive_v2_address
SetVaultCapEventvault, vault_cap
SetMarketCapAndPenaltyEventvault, pool_address, cap, penalty
SetPausedEventvault, paused
SetLossEventvault, pool_address, loss (9-decimal)
AllocatorAddedEventvault, cap_id, recipient
AllocatorRemovedEventcap_id
CuratorAddedEventvault, cap_id, recipient
CuratorRemovedEventcap_id
PauseCapMintedEventcap_id, recipient, sender
PauseCapDestroyedEventcap_id, sender
RewardRuleCreatedEventvault, navi_pool_id, reward_coin_type, incentive_rule_id
RewardRuleReactivatedEventvault, navi_pool_id, reward_coin_type, incentive_rule_id
RewardRuleDisabledEventvault, navi_pool_id, reward_coin_type
DepositRewardBalanceEventvault, reward_coin_type, amount
SetRewardRateEventvault, reward_coin_type, total_supply, duration_ms, rate (RAY per ms)
WithdrawRewardEventvault, reward_coin_type, amount

proposal_type codes: 1 management fee, 2 performance fee, 3 default market, 4 market addition, 5 market status.

On this page