---
title: "ERC-4626 Vault Share Math"
method: POST
path: "/v1/tools/recompute_erc4626_vault_share_math"
tags: ["payment_policy", "erc-4626", "tokenized-vault", "rounding", "share-price", "inflation-attack", "mcp:recompute_erc4626_vault_share_math"]
---

# ERC-4626 Vault Share Math

`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

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

## Request body

- object
  - `total_assets` string
  - `total_supply` string
  - `virtual_amounts` boolean
  - `decimals_offset` string
  - `operations` unknown[]
    - unknown
  - `round_trip_assets` string
  - `snapshot_b` object
  - `fee_bps` string
  - `fee_basis` string
  - `chain_id` string
  - `network_label` string

## Response `200`

Successful tool execution result

- object
  - `declared_context` object
  - `vault_state` object, nullable
  - `conversions` unknown[]
    - unknown
  - `fee` object, nullable
  - `round_trip` object, nullable
  - `rate_drift` object, nullable
  - `rounding_table` unknown[]
    - unknown
  - `note` string
  - `reasons` string[]

---

[API](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite.md) · [All operations](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/llms.txt) · [OpenAPI document](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/revisions/b462e4f5bb28?raw)
