---
title: "Generate withdraw instructions"
method: POST
path: "/withdraw/ix"
tags: ["Withdrawals"]
---

# Generate withdraw instructions

`POST /withdraw/ix`

Generates raw Solana instructions for withdrawing from a strategy. Public keys in each instruction are serialized as 32-byte integer arrays.

## Request body

- StructuredInputForWithdraw
  - `params` InputForWithdraw, required
    - `all` boolean, nullable — Withdraw the complete position. Defaults to `false`.
    - `amount` integer, nullable — Amount in the token's smallest unit. Required unless `all` is `true`.
    - `base_asset` string, required — Base-asset mint address within the strategy. Required.
    - `create_wsol_ata` boolean, nullable — If base asset is WSOL and `user_token_account` is not provided, prepend an ATA-create ix. Defaults to `true` when omitted.
    - `detect_wsol_ata` boolean, nullable — If `true`, the API will do an RPC round-trip to detect whether the user's WSOL ATA exists. When enabled (and base asset is WSOL), this overrides the other WSOL ATA flags: - If the WSOL ATA does not exist: `create_wsol_ata=true` and `unwrap_wsol_ata=true` - If the WSOL ATA exists: `create_wsol_ata=false` and `unwrap_wsol_ata=false` Defaults to `false` when omitted.
    - `exclude_fees` boolean, nullable — Defaults to `false`, when true excludes fees from the amount
    - `fund_id` string, nullable — Deprecated and rejected by the API. Use `strategy_id` + `base_asset`.
    - `payer_key` string, nullable — Transaction payer. Required by `/withdraw/tx`; defaults to `user_key` for `/withdraw/ix`.
    - `strategy_id` string, required — Strategy identifier. Required.
    - `unwrap_wsol_ata` boolean, nullable — If base asset is WSOL, unwrap to SOL by syncing and closing the user's WSOL ATA at the end. Defaults to `false` when omitted.
    - `user_key` string, required — Withdrawing wallet address. Required.
    - `user_token_account` string, nullable — Destination token account. Defaults to the user's associated token account.

## Response `200`

Withdraw instructions prepared successfully

- WithdrawInstructions
  - `lookup_table` string, required — Address lookup table required when assembling the transaction.
  - `withdraw_instructions` SolanaInstruction[], required — Solana instructions serialized as byte-array public keys and instruction data.
    - `accounts` SolanaAccountMeta[], required
      - `is_signer` boolean, required
      - `is_writable` boolean, required
      - `pubkey` integer[], required — 32-byte public key.
    - `data` integer[], required — Raw instruction data.
    - `program_id` integer[], required — 32-byte program ID.

## Other responses

- `400` — Invalid withdraw request
- `401` — Missing API key
- `404` — Invalid, inactive, or expired API key
- `500` — Internal server error

---

[API](https://skmtc.net/breeze-baby/apis/breeze-api.md) · [All operations](https://skmtc.net/breeze-baby/apis/breeze-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/breeze-baby/breeze-api/versions/d0a18846aa92/schema)
