payment_policy
erc-4626
tokenized-vault
rounding
share-price
inflation-attack
mcp:recompute_erc4626_vault_share_math

ERC-4626 Vault Share Math

Recomputes ERC-4626 tokenized-vault share and asset conversions from caller-declared vault state, applying the rounding direction the standard mandates for each function and reporting which direction produced each result alongside what the opposite direction would have produced. ERC-4626 fixes those directions per function: convertToShares and convertToAssets round down towards 0, previewDeposit and previewRedeem round down, previewMint and previewWithdraw round up. Also computes a deposit-then-redeem round-trip loss bound against the post-deposit state, a signed exchange-rate drift between two declared snapshots, and a declared fee application. All arithmetic is exact uint256 integer math with no floating point. Never reads any chain: it cannot know whether the declared totals match a deployed vault, whether that vault applies these directions, or whether a rate change came from yield, loss, a donation, or an attack.

Tool URL: https://ainumbers.co/chaingraph/art-610-erc4626-vault-share-math.html

post/v1/tools/recompute_erc4626_vault_share_math

Request

  • Base URL: https://ainumbers.co
  • URL: https://ainumbers.co/v1/tools/recompute_erc4626_vault_share_math
  • Auth: none declared

Request body

total_assetsstring
total_supplystring
virtual_amountsboolean
decimals_offsetstring
round_trip_assetsstring
snapshot_bobject
fee_bpsstring
fee_basisstring
chain_idstring
network_labelstring

Response

Successful tool execution result

declared_contextobject
vault_stateobject nullable
feeobject nullable
round_tripobject nullable
rate_driftobject nullable
notestring
reasonsstring[]

Changes

No recorded changes to this operation across all 1 revision of this API.