> ## Documentation Index
> Fetch the complete documentation index at: https://developers.paxoslabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange Rate

> Read the share-to-asset exchange rate from the Accountant contract

The Accountant contract tracks the exchange rate between account shares and the underlying asset. Equivalent to SDK's internal `getRateInQuoteWithAssetDecimals()`.

## Contract Method

### `getRateInQuoteSafe(quote)`

Returns the amount of the quote asset per 1e18 account shares.

| Parameter | Type      | Description                                                 |
| --------- | --------- | ----------------------------------------------------------- |
| `quote`   | `address` | The 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

```json theme={null}
[
  {
    "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 [Account Discovery](/v0.5.2/intro/products/earn/developers/guides/direct-contract/vault-queries/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
```

<Info>
  The rate uses the quote asset's decimals. For example, if quoting in USDC
  (6 decimals) and the rate is `1050000`, that means 1 account share ≈ 1.05 USDC.
</Info>
