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

# withdrawFunds

Initiate a withdrawal from active positions to user's EOA. Supports both full and partial withdrawals. Processed asynchronously by backend.

Funds are always withdrawn to the Safe owner's address (the `userAddress` parameter).

**Supported assets:**

* **USDC** (default): 6 decimals
* **WETH**: 18 decimals
* **EURC**: 6 decimals (Mainnet and Base)

## Signature

```typescript theme={null}
withdrawFunds(userAddress: string, chainId: SupportedChainId, amount?: string, assetType?: "USDC" | "WETH" | "EURC"): Promise<WithdrawResponse>
```

## Parameters

| Parameter     | Type                         | Required | Description                                   |
| ------------- | ---------------------------- | -------- | --------------------------------------------- |
| `userAddress` | `string`                     | ✅        | User's EOA address (owner of the Safe)        |
| `chainId`     | `SupportedChainId`           | ✅        | Chain to withdraw from                        |
| `amount`      | `string`                     | ❌        | Amount to withdraw (omit for full withdrawal) |
| `assetType`   | `"USDC" \| "WETH" \| "EURC"` | ❌        | Asset to withdraw (default: `"USDC"`)         |

## Returns

Withdraw response with status message

## Return Type

```typescript theme={null}
interface WithdrawResponse {
  success: boolean;
  message: string;
  txHash?: string;
  type: 'full' | 'partial';
  amount: string;
}
```

## Example

### Withdraw USDC (default)

```typescript theme={null}
// Full USDC withdrawal (withdrawn to user's EOA)
const result = await sdk.withdrawFunds("0xUser...", 42161);
console.log(result.message); // "Withdrawal request sent"

// Partial withdrawal of 50 USDC (6 decimals)
const partial = await sdk.withdrawFunds(
  "0xUser...",
  42161,
  "50000000" // 50 USDC = 50 * 10^6
);
console.log(partial.type); // "partial"
```

### Withdraw WETH

```typescript theme={null}
// Full WETH withdrawal
const result = await sdk.withdrawFunds("0xUser...", 8453, undefined, "WETH");
console.log(result.message); // "Withdrawal request sent"

// Partial withdrawal of 0.25 WETH (18 decimals)
const partial = await sdk.withdrawFunds(
  "0xUser...",
  8453,
  "250000000000000000", // 0.25 WETH = 0.25 * 10^18
  "WETH"
);
console.log(partial.type); // "partial"
```

### Withdraw EURC

```typescript theme={null}
// Full EURC withdrawal (Mainnet / Base)
const result = await sdk.withdrawFunds("0xUser...", 8453, undefined, "EURC");
console.log(result.message); // "Withdrawal request sent"
```
