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:
| Type | Module |
|---|---|
Storage | lending_core::storage |
Pool<CoinType> | lending_core::pool |
IncentiveV2 | lending_core::incentive_v2::Incentive |
IncentiveV3 | lending_core::incentive_v3::Incentive |
RewardFund<T> | lending_core::incentive_v3::RewardFund |
PriceOracle | oracle::oracle |
SuiSystemState | sui_system::sui_system |
Clock | sui::clock |
10.1 Objects
Vault<phantom CoinType> has key — shared
| Field | Type | Description |
|---|---|---|
version | u64 | Must equal the package's VAULT_VERSION. |
total_shares | u64 | All shares, including accrued but unclaimed fee shares. |
idle_balance | Balance<CoinType> | Assets held in the vault, not deployed. |
default_market | address | Pool to which deposits are routed; 0x0 routes deposits to the idle balance. |
management_fee | u64 | WAD-scaled annual rate. Bounded by MAX_MANAGEMENT_FEE_APY_WAD. |
_performance_fee | u64 | WAD-scaled share of profit. Bounded by MAX_PERFORMANCE_FEE_WAD. |
total_assets | u64 | Gross assets under management recorded at the last accrual; the performance-fee baseline. Not live AUM — use get_total_assets. |
last_update_timestamp | u64 | Last accrual, in seconds. |
markets | VecMap<address, MarketInfo> | Keyed by pool address. |
pending_management_fee_shares | u64 | Minted, not yet assigned to a Receipt. |
pending_performance_fee_shares | u64 | As above. |
reward_rules | vector<VaultRewardRule> | Position is the rule_index argument. Append-only. |
collected_rewards | Bag | Reward coin type string → Balance<RewardCoinType>. |
user_states | Table<address, UserState> | Keyed by Receipt object address. |
paused | bool | See §9. |
vault_cap | u64 | Vault-level deposit cap; 0 denotes no limit. |
Receipt has key, store — owned
| Field | Type |
|---|---|
vault_address | address |
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
| Field | Type | Description |
|---|---|---|
shares | u64 | Share balance. |
reward_indices | VecMap<String, u256> | Per-rule index snapshot. |
reward_total | VecMap<String, u256> | Per-rule cumulative entitlement. |
reward_claimed | VecMap<String, u256> | Per-rule amount already paid. |
Rule keys are "{navi_pool_id}|{reward_coin_type}".
MarketInfo has store
| Field | Type | Description |
|---|---|---|
cap | u64 | Upper bound on current_balance; 0 denotes no limit. |
penalty | u64 | WAD-scaled additional share burn on non-default-market withdrawals. Bounded by MAX_PENALTY. |
current_balance | u64 | Cached position in native decimals. Written only by sync_market_balance. |
loss | u64 | Recorded bad debt, in NAVI's 9-decimal representation. |
last_sync_at | u64 | Milliseconds. Reset to 0 by add_market and set_loss. |
storage_address | address | Required Storage object. |
asset_id | u8 | Reserve index within that Storage. |
incentive_v3_address | address | Required IncentiveV3 object. |
incentive_v2_address | address | Required IncentiveV2 object. |
account_cap | Option<AccountCap> | The vault's NAVI account for this market. Internal. |
status | MarketStatus | Active (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
| Field | Type | Description |
|---|---|---|
navi_pool_id | address | Market the rule belongs to; 0x0 for vault-native rules. |
reward_coin_type | String | Fully qualified reward coin type. |
incentive_rule_id | address | NAVI incentive rule identifier; 0x0 for vault-native rules. |
vault_reward_index | u256 | RAY-scaled cumulative reward per share. |
last_harvest_at | u64 | Milliseconds. Last collect_reward for market rules; last index settlement for vault-native rules. |
is_vault_native | bool | true for operator-funded rules streamed at a rate; false for rules harvested from NAVI. |
reward_rate | u256 | RAY-scaled reward per millisecond. 0 for market rules. |
is_active | bool | Soft-delete flag. Inactive rules are skipped by collect_reward and by the harvest assertion; historical entitlements remain claimable. |
total_reward_deposited | u64 | Vault-native budget. |
total_reward_distributed | u64 | Vault-native amount streamed to date. Index growth halts at the budget. |
Capabilities and registries
| Object | Abilities | Scope |
|---|---|---|
Timelocks<CoinType> | key (shared) | vault_id, proposals: Table<ProposalKey, TimelockProposal<CoinType>>. |
Allocators | key, store (shared) | valid_caps: Table<ID, bool>. |
Curators | key, store (shared) | valid_caps: Table<ID, bool>. |
AdminCap | key, store | Global. Minted once in init. |
EmergencyCap | key, store | Global. set_loss, withdraw_reward. |
PauseCap | key only | Global, pause-only; the absence of store makes it non-transferable by the holder. No admin revocation path; the holder may call destroy_pause_cap. |
AllocatorCap | key, store | Bound to one vault_id. |
CuratorCap | key, store | Bound to one vault_id. |
ManagementFeeCap | key, store | Bound to one vault_id. |
PerformanceFeeCap | key, store | Bound to one vault_id. |
10.2 Constants
| Name | Value | Description |
|---|---|---|
TIMELOCK_DURATION | 86_400 | 24 hours, in seconds. |
TIMELOCK_GRACE_PERIOD | 604_800 | 7 days. Execution window after unlock. |
WAD | 1e18 | Fee and penalty scale. |
MAX_PENALTY | 0.3e18 | 30%. |
MAX_MANAGEMENT_FEE_APY_WAD | 0.2e18 | 20% annualized. |
MAX_PERFORMANCE_FEE_WAD | 0.4e18 | 40% of profit. |
VIRTUAL_SHARES | 1_000_000 | Inflation-attack offset. |
SECONDS_PER_YEAR | 31_536_000 | Management-fee denominator. |
| RAY | 1e27 | Reward index and rate scale (math::ray_math). |
10.3 Depositor entrypoints
create_receipt
public fun create_receipt<CoinType>(
self: &Vault<CoinType>,
ctx: &mut TxContext,
): ReceiptOptional; 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): u64get_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:
| Position | Field | Type |
|---|---|---|
| 0 | cap | u64 |
| 1 | penalty | u64 (WAD) |
| 2 | loss | u64 (9-decimal) |
| 3 | status | u8 — 0 Active, 1 Disabled |
| 4 | last_sync_at | u64 (ms) |
| 5 | storage_address | address |
| 6 | asset_id | u8 |
| 7 | incentive_v3_address | address |
| 8 | incentive_v2_address | address |
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:
| Position | Field | Type |
|---|---|---|
| 0 | navi_pool_id | address |
| 1 | reward_coin_type | String |
| 2 | incentive_rule_id | address |
| 3 | vault_reward_index | u256 (RAY) |
| 4 | last_harvest_at | u64 (ms) |
| 5 | is_vault_native | bool |
| 6 | reward_rate | u256 (RAY per ms) |
| 7 | is_active | bool |
| 8 | total_reward_deposited | u64 |
| 9 | total_reward_distributed | u64 |
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
| Code | Name | Cause |
|---|---|---|
| 10001 | E_UNAUTHORIZED | allocate or deallocate with an AllocatorCap absent from the registry. |
| 10002 | E_INSUFFICIENT_BALANCE | Insufficient shares, market balance, idle balance, or reward bag balance. |
| 10003 | E_MARKET_NOT_FOUND | Pool address is not a registered market. |
| 10004 | E_TIMELOCK_NOT_EXPIRED | exec_* before the unlock time. |
| 10005 | E_CAP_EXCEEDED | Market deposit cap exceeded. |
| 10006 | E_MARKET_NOT_READ | sync_market_balance missing for a market in the current block. |
| 10007 | E_REWARDS_NOT_COLLECTED | collect_reward missing for an active market rule. |
| 10008 | E_RECEIPT_NOT_FOUND | Receipt has no UserState; it has never held a deposit. |
| 10009 | E_VAULT_MISMATCH | Receipt, capability or Timelocks object belongs to a different vault. |
| 10010 | E_MARKET_INVALID | Target market is not Active. |
| 10011 | E_PAUSED | Vault is paused. |
| 10012 | E_DEPOSIT_TOO_SMALL | Deposit would mint zero shares. |
| 10013 | E_OVERFLOW | Numeric bound exceeded. |
| 10014 | E_INVALID_PENALTY | Recorded penalty exceeds MAX_PENALTY. |
| 10015 | E_ALLOCATOR_CAP_NOT_FOUND | remove_allocator for an unregistered capability. |
| 10016 | E_PROPOSAL_NOT_FOUND | No proposal for the given type and subject. |
| 10017 | E_MARKET_CONFIG_MISMATCH | Storage, IncentiveV2 or IncentiveV3 does not match the market's recorded address. |
| 10018 | E_TIMELOCK_EXPIRED | Grace period elapsed. |
| 10019 | E_CURATOR_CAP_NOT_VALID | CuratorCap absent from the registry. |
| 10020 | E_CURATOR_CAP_NOT_FOUND | remove_curator for an unregistered capability. |
| 10021 | E_AMOUNT_MISMATCH | deposit_coin.value() ≠ amount. |
| 10022 | E_DEFAULT_MARKET_MISMATCH | Pool is not the default market on a path that requires it. |
| 10023 | E_PROPOSAL_ALREADY_EXISTS | A live proposal already exists for the type and subject. |
| 10024 | E_PROPOSAL_NOOP | Proposal would produce no change. |
| 10025 | E_WRONG_PROPOSAL_TYPE | Proposal type code does not match the stored proposal. |
| 10026 | E_RULE_NOT_FOUND | Reward rule absent, or not vault-native where required. |
| 10027 | E_RULE_ALREADY_ACTIVE | Rule is already active, or collides with a vault-native rule. |
| 10028 | E_RULE_ALREADY_INACTIVE | Rule is already disabled. |
| 10029 | E_REWARD_COIN_TYPE_MISMATCH | RewardCoinType differs from the rule's recorded coin type. |
| 10030 | E_RULE_INDEX_OUT_OF_BOUNDS | Rule or market index out of range. |
| 10031 | E_FEE_OUT_OF_RANGE | Fee exceeds its maximum. |
| 10032 | E_INVALID_STATUS | target_status greater than 1. |
| 10033 | E_FEE_UNCHANGED | New fee equals the current fee. |
| 10034 | E_INVALID_AMOUNT | Amount is zero, or an internal amount invariant is violated. |
| 10035 | E_MARKET_ALREADY_EXISTS | Market addition for an existing pool address. |
| 10036 | E_INCORRECT_VERSION | Vault not migrated after a package upgrade. |
| 10037 | E_VERSION_UPGRADE_NOT_NEEDED | version_migrate on an already-current vault. |
| 10038 | E_ACCOUNTING_ERROR | Internal invariant violation. |
| 10039 | E_VAULT_CAP_EXCEEDED | Vault-level deposit cap exceeded. |
| 10040 | E_SLIPPAGE_EXCEEDED | Shares burned exceed max_shares. |
| 10041 | E_CANNOT_DISABLE_DEFAULT_MARKET | Attempt to disable the current default market. |
| 10042 | E_WITHDRAW_EXCEEDS_UNDISTRIBUTED | withdraw_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:
| Code | Origin | Cause |
|---|---|---|
| 1400 | incorrect_version | Any 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. |
| 1502 | invalid_price | withdraw or deallocate while the oracle price for the asset is outside update_interval (§3.3). Transient; prevented by the price update in §5.6. |
| 1506 | insufficient_balance | withdraw or deallocate while the reserve's utilization leaves insufficient free liquidity (§3.3). Transient; distinct from E_INSUFFICIENT_BALANCE (10002). |
| 1604 | exceeded_maximum_deposit_cap | deposit 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.
| Event | Fields |
|---|---|
CreateVaultEvent | vault, sender |
CreateReceiptEvent | vault, sender, receipt_id |
DepositEvent | vault, sender, receipt_id, pool_address (0x0 when routed to idle), amount, shares |
WithdrawEvent | vault, sender, receipt_id, pool_address (0x0 when served entirely from idle), amount, shares_burned |
ClaimRewardEvent | vault, sender, receipt_id, reward_coin_type, amount |
CollectRewardEvent | vault, rule_index, reward_coin_type, amount |
SyncMarketBalanceEvent | vault, pool_address, current_balance |
AllocateEvent | vault, sender, pool_address, amount |
DeallocateEvent | vault, sender, pool_address, amount |
ClaimManagementFeeEvent | vault, receipt_id, shares |
ClaimPerformanceFeeEvent | vault, receipt_id, shares |
ProposalCreatedEvent | vault, proposal_type, subject, executable_at (seconds) |
ProposalExecutedEvent | vault, proposal_type, subject |
ProposalCancelledEvent | vault, proposal_type, subject |
SetDefaultMarketEvent | vault, pool_address |
SetMarketStatusEvent | vault, pool_address, target_status |
SetManagementFeeEvent | vault, old_fee, new_fee |
SetPerformanceFeeEvent | vault, old_fee, new_fee |
AddMarketEvent | vault, pool_address, cap, penalty, storage_address, asset_id, incentive_v3_address, incentive_v2_address |
SetVaultCapEvent | vault, vault_cap |
SetMarketCapAndPenaltyEvent | vault, pool_address, cap, penalty |
SetPausedEvent | vault, paused |
SetLossEvent | vault, pool_address, loss (9-decimal) |
AllocatorAddedEvent | vault, cap_id, recipient |
AllocatorRemovedEvent | cap_id |
CuratorAddedEvent | vault, cap_id, recipient |
CuratorRemovedEvent | cap_id |
PauseCapMintedEvent | cap_id, recipient, sender |
PauseCapDestroyedEvent | cap_id, sender |
RewardRuleCreatedEvent | vault, navi_pool_id, reward_coin_type, incentive_rule_id |
RewardRuleReactivatedEvent | vault, navi_pool_id, reward_coin_type, incentive_rule_id |
RewardRuleDisabledEvent | vault, navi_pool_id, reward_coin_type |
DepositRewardBalanceEvent | vault, reward_coin_type, amount |
SetRewardRateEvent | vault, reward_coin_type, total_supply, duration_ms, rate (RAY per ms) |
WithdrawRewardEvent | vault, reward_coin_type, amount |
proposal_type codes: 1 management fee, 2 performance fee, 3 default market, 4 market addition, 5 market status.