gVault contract
Purpose
gVault enables users (and integrators) to opt into per‑validator delegation while retaining a reward‑bearing, non‑rebasing share model that is friendly to DeFi integrations.
gVault protection (slashing isolation)
gVault depositors are isolated from the slashing that could occur within CoreVault. Losses impacting CoreVault do not propagate to gVault positions.
gVault users remain exposed only to the risk of the specific validator(s) they choose inside gVault.
Shares, multipliers, and caps
Per‑validator shares (ERC‑4626‑style accounting): Each validator maintains its own total shares and user share balances; gVault converts between shares and assets using the current stake accounting for that validator.
Multiplier P with scaling (Liquity‑style): gVault tracks a cumulative multiplier per “scale” to fairly adjust user principal units during admin liquidity events (e.g., protocol‑wide outflows). Rescaling avoids precision loss when cumulative multipliers get too small.
Deposit caps:
Per‑validator absolute caps (optional).
A defaultCapBps cap based on Magma’s total assets when no absolute cap is set.
Caps prevent over‑concentration in any single validator.
Deposits (synchronous)
Deposits are synchronous and mint gVault shares for a chosen validator immediately.
Users can deposit MON (native) or WMON (ERC‑20). Funds are staked to the selected validator, enforcing per‑validator caps.
Non‑rebasing design: balances do not increase; instead, the share‑to‑asset rate appreciates as rewards accrue.
Withdrawals (asynchronous)
For redemptions sourced from gVault, undelegations are created against the specific validator.
A maxWithdrawableFromGVault guard ensures a user’s claim is bounded by their compounded principal (after any admin multipliers).
Completion occurs once undelegations mature; a withdrawal fee is applied at the point of payout.
Rewards
Rewards can be claimed and compounded per validator; a rewards fee is applied before re‑staking.
Validator management
The owner can add validators to gVault’s whitelist and execute removal via the standard pause/undelegate/withdraw lifecycle.
gVault disallows re‑adding a validator that has been fully removed under certain lifecycle states.
Compatibility
Works with Monad’s staking precompile and inherits the same epoch‑based undelegation/withdrawal semantics. See Monad Staking.
Last updated