> ## 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.

# getMinimumMint

> Calculate expected account shares for a given deposit amount

Calculates the expected account shares a user will receive for a deposit. Uses the on-chain exchange rate from the Accountant contract.

## Import

```ts theme={null}
import { getMinimumMint } from '@paxoslabs/amplify-sdk'
```

## Usage

```ts theme={null}
import { getMinimumMint, getVaultsByConfig, YieldType } from '@paxoslabs/amplify-sdk'

const [vault] = await getVaultsByConfig({ yieldType: YieldType.CORE, chainId: 1 })

const result = await getMinimumMint({
  vaultName: vault.name,
  chainId: 1,
  depositAssetAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
  depositAmount: '1000.0',
})

console.log(result.expectedShares) // bigint
console.log(result.exchangeRate) // bigint
```

## Parameters

| Parameter             | Type      | Required | Description                                 |
| --------------------- | --------- | -------- | ------------------------------------------- |
| `vaultName`           | `string`  | Yes      | Account name from `getVaultsByConfig()`     |
| `chainId`             | `ChainId` | Yes      | Blockchain network ID                       |
| `depositAssetAddress` | `Address` | Yes      | Token contract address being deposited      |
| `depositAmount`       | `string`  | Yes      | Amount as decimal string (e.g., `"1000.0"`) |

```ts theme={null}
interface GetMinimumMintParams {
  vaultName: string
  chainId: ChainId
  depositAssetAddress: Address
  depositAmount: string
}
```

## Return Type

```ts theme={null}
interface MinimumMintResult {
  /** Expected vault shares to be minted */
  expectedShares: bigint
  /** On-chain exchange rate from Accountant */
  exchangeRate: bigint
  /** Vault share token decimals */
  shareDecimals: number
  /** Deposit asset decimals */
  assetDecimals: number
}
```

## Example: Display Expected Shares

```tsx theme={null}
import { getMinimumMint, getVaultsByConfig, YieldType } from '@paxoslabs/amplify-sdk'
import { formatUnits } from 'viem'

const [vault] = await getVaultsByConfig({ yieldType: YieldType.CORE, chainId: 1 })

const result = await getMinimumMint({
  vaultName: vault.name,
  chainId: 1,
  depositAssetAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  depositAmount: '1000.0',
})

const sharesFormatted = formatUnits(result.expectedShares, result.shareDecimals)
console.log(`You will receive ~${sharesFormatted} vault shares`)
```

## Error Handling

| Error Message Pattern   | Description                   | Resolution                       |
| ----------------------- | ----------------------------- | -------------------------------- |
| `"No vault found"`      | No account matches parameters | Verify yieldType, asset, chainId |
| `"SDK not initialized"` | SDK not initialized           | Call `initAmplifySDK()` first    |

## Related

* [Deposit Workflow](/v0.5.2/intro/products/earn/developers/api/deposit-workflow) - Execute deposits
* [Concepts](/v0.5.2/intro/products/earn/developers/getting-started/concepts) - Shares vs assets
