Workspace / Research tools
Vault accounting

ERC-4626 Withdrawal Rounding Model

Requesting an exact asset withdrawal answers a different rounding question from estimating shares for a deposit. This model compares the shares rounded upward for a withdrawal with a downward conversion quote. It also checks the entered owner balance, helping expose a one-share shortage that a rounded display price can hide when amounts approach the smallest accounting units.

Enable JavaScript to edit assumptions, calculate and compare a baseline locally. The formula and methodology below remain available without JavaScript.

Formula and accounting assumptions

Required shares equal ceil(requested assets × adjusted share supply ÷ adjusted assets). For comparison, the generic downward conversion uses floor of that same ratio. The difference measures the extra share unit required by the withdrawal direction. A separate redemption estimate takes owned shares, multiplies by adjusted assets, divides by adjusted supply and rounds down, bounded by the actual assets entered for the vault.

Worked hypothetical example

With three asset units and two issued share units, withdrawing two assets requires ceil(4 ÷ 3), or two shares. The downward conversion gives one share, which is insufficient for this exact withdrawal. An owner with only one share can model redemption of one asset unit instead. These examples use zero virtual offsets and no fees. Increasing the withdrawal in the scenario table shows when the owner's entered share balance stops covering the modeled requirement.

Interpret the scenarios and limits

The ownership check is accounting coverage, not confirmation of immediate withdrawability. A vault can have queues, strategy illiquidity, pauses, fees or account-specific limits. Virtual offsets are user-supplied modeling choices; the standard does not force every vault to use this formula. The model rejects ownership above issued supply and requests above actual entered assets. Keep asset units and share units separate and use the contract's corresponding preview and maximum functions when evaluating a real integration.

Primary documentation

Your research workspace

Save selected inputs and research notes explicitly in this browser. Compare assumptions and restore a saved setup without submitting a trade. JavaScript enables the controls.

Find a tool or research page