Skip to main content
The Accountant contract tracks the exchange rate between vault shares and the underlying asset. Equivalent to SDK’s internal getRateInQuoteWithAssetDecimals().

Contract Method

getRateInQuoteSafe(quote)

Returns the amount of the quote asset per 1e18 vault shares.
ParameterTypeDescription
quoteaddressThe token address to quote the rate in (e.g., USDC address)
Returns: uint256 rateInQuote — amount of the quote asset per one full share (1e18)

ABI

[
  {
    "inputs": [{ "name": "quote", "type": "address" }],
    "name": "getRateInQuoteSafe",
    "outputs": [{ "name": "rateInQuote", "type": "uint256" }],
    "stateMutability": "view",
    "type": "function"
  }
]

Usage

Call on the Accountant contract (vault.accountantModuleId from Vault Discovery).

For deposits (calculating minimumMint)

rate          = Accountant.getRateInQuoteSafe(depositTokenAddress)
expectedShares = (depositAmount × 1e18) / rate
minimumMint    = expectedShares × (10000 − SLIPPAGE_BPS) / 10000

For withdrawals (converting want amount to shares)

rate         = Accountant.getRateInQuoteSafe(wantAssetAddress)
sharesNeeded = (wantAmount × 1e18) / rate
The rate uses the quote asset’s decimals. For example, if quoting in USDC (6 decimals) and the rate is 1050000, that means 1 vault share ≈ 1.05 USDC.