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

# getMinimumWithdrawalOrderSize

> Get the minimum withdrawal order size for an account

Reads the minimum withdrawal order size from the on-chain WithdrawQueue contract. Use this to validate user input before submitting a withdrawal order.

## Import

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

## Usage

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

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

const result = await getMinimumWithdrawalOrderSize({
  vaultName: vault.name,
  chainId: 1,
  assetAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
})

console.log(result.minimumOrderSize) // bigint
console.log(result.shareDecimals) // number
```

## Parameters

| Parameter      | Type      | Required | Description                             |
| -------------- | --------- | -------- | --------------------------------------- |
| `vaultName`    | `string`  | Yes      | Account name from `getVaultsByConfig()` |
| `chainId`      | `ChainId` | Yes      | Blockchain network ID                   |
| `assetAddress` | `Address` | Yes      | Asset address for account lookup        |

```ts theme={null}
interface GetMinimumWithdrawalOrderSizeParams {
  vaultName: string
  chainId: ChainId
  assetAddress: Address
}
```

## Return Type

```ts theme={null}
interface MinimumWithdrawalOrderSizeResult {
  /** Minimum order size in vault share units */
  minimumOrderSize: bigint
  /** Vault share token decimals */
  shareDecimals: number
}
```

## Example: Input Validation

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

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

const result = await getMinimumWithdrawalOrderSize({
  vaultName: vault.name,
  chainId: 1,
  assetAddress: usdcAddress,
})

const userAmount = parseUnits(userInput, result.shareDecimals)

if (userAmount < result.minimumOrderSize) {
  const min = formatUnits(result.minimumOrderSize, result.shareDecimals)
  console.error(`Minimum withdrawal is ${min} 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

* [Withdrawals Guide](/v0.5.2/intro/products/earn/developers/guides/withdrawals) - Complete withdrawal flow
* [getWithdrawalFee](./getWithdrawalFee) - Calculate withdrawal fees
