> ## Documentation Index
> Fetch the complete documentation index at: https://perps-api.vooi.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare a withdraw from an exchange



## OpenAPI

````yaml https://vooi-api-app.fly.dev/swagger/json post /withdraw/prepare
openapi: 3.1.0
info:
  title: VOOI API
  description: Unified perps API
  version: '1.0'
  contact: {}
servers:
  - url: https://perps-api.vooi.io
security: []
tags: []
paths:
  /withdraw/prepare:
    post:
      tags:
        - Withdraw
      summary: Prepare a withdraw from an exchange
      operationId: WithdrawController_prepareWithdraw
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareWithdrawBodyDto'
      responses:
        '200':
          description: Withdraw preparation data
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AsterWithdrawResponseDto'
                  - $ref: '#/components/schemas/HyperliquidWithdrawResponseDto'
                  - $ref: '#/components/schemas/LighterWithdrawResponseDto'
                  - $ref: '#/components/schemas/OndoWithdrawResponseDto'
                  - $ref: '#/components/schemas/RobinhoodWithdrawResponseDto'
                type: object
                discriminator:
                  propertyName: exchange
                  mapping:
                    aster:
                      $ref: '#/components/schemas/AsterWithdrawResponseDto'
                    hyperliquid:
                      $ref: '#/components/schemas/HyperliquidWithdrawResponseDto'
                    lighter:
                      $ref: '#/components/schemas/LighterWithdrawResponseDto'
                    ondo:
                      $ref: '#/components/schemas/OndoWithdrawResponseDto'
                    robinhood:
                      $ref: '#/components/schemas/RobinhoodWithdrawResponseDto'
        '503':
          description: ExchangeApiError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDTO'
      security:
        - bearer: []
components:
  schemas:
    PrepareWithdrawBodyDto:
      type: object
      properties:
        address:
          type: string
          description: Wallet address to withdraw to
          example: '0x1234567890abcdef1234567890abcdef12345678'
        amount:
          type: string
          pattern: \d+(\.\d+)?
          description: Amount to withdraw
          example: '0.001'
        chainId:
          description: >-
            Target chain ID for withdraw (Aster and Ondo only, defaults to 42161
            Arbitrum)
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        exchange:
          type: string
          enum:
            - aster
            - binance
            - bybit
            - extended
            - gate
            - hyperliquid
            - lighter
            - mexc
            - ondo
            - robinhood
          description: Supported perpetual exchange
        symbol:
          description: Token symbol to withdraw (Aster only, defaults to USDC)
          type: string
          enum:
            - USDC
            - USDT
            - USDC.e
            - USD1
            - USDF
            - lisUSD
      required:
        - address
        - amount
        - exchange
      title: PrepareWithdrawBody
    AsterWithdrawResponseDto:
      type: object
      properties:
        exchange:
          type: string
          enum:
            - aster
        fee:
          type: number
          description: Withdraw fee amount
        signData:
          type: object
          properties:
            domain:
              type: object
              properties:
                chainId:
                  type: number
                name:
                  type: string
                verifyingContract:
                  type: string
                  description: Ethereum address
                  example: '0x1234567890abcdef1234567890abcdef12345678'
                version:
                  type: string
              required:
                - name
                - version
            message:
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
            primaryType:
              type: string
            types:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    type:
                      type: string
                  required:
                    - name
                    - type
          required:
            - domain
            - message
            - primaryType
            - types
          description: EIP-712 typed data to sign
        withdrawId:
          type: string
          description: Pending withdraw identifier
        withdrawLimit:
          type: string
          description: Maximum withdraw amount
      required:
        - exchange
        - fee
        - signData
        - withdrawId
        - withdrawLimit
      title: AsterWithdrawData
    HyperliquidWithdrawResponseDto:
      type: object
      properties:
        exchange:
          type: string
          enum:
            - hyperliquid
        fee:
          type: number
          description: Withdraw fee amount
        signData:
          type: object
          properties:
            domain:
              type: object
              properties:
                chainId:
                  type: number
                name:
                  type: string
                verifyingContract:
                  type: string
                  description: Ethereum address
                  example: '0x1234567890abcdef1234567890abcdef12345678'
                version:
                  type: string
              required:
                - name
                - version
            message:
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
            primaryType:
              type: string
            types:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    type:
                      type: string
                  required:
                    - name
                    - type
          required:
            - domain
            - message
            - primaryType
            - types
          description: EIP-712 typed data to sign
        withdrawId:
          type: string
          description: Pending withdraw identifier
        withdrawLimit:
          type: string
          description: Maximum withdraw amount
      required:
        - exchange
        - fee
        - signData
        - withdrawId
        - withdrawLimit
      title: HyperliquidWithdrawData
    LighterWithdrawResponseDto:
      type: object
      properties:
        exchange:
          type: string
          enum:
            - lighter
        fee:
          type: number
          description: Withdraw fee amount
        signData:
          type: string
          description: Message that needs to be signed by the user
        withdrawId:
          type: string
          description: Pending withdraw identifier
        withdrawLimit:
          type: string
          description: Maximum fast withdraw amount
      required:
        - exchange
        - fee
        - signData
        - withdrawId
        - withdrawLimit
      title: LighterWithdrawData
    OndoWithdrawResponseDto:
      type: object
      properties:
        exchange:
          type: string
          enum:
            - ondo
        fee:
          type: number
          description: Withdraw fee amount in USD
        signData:
          type: 'null'
          description: >-
            Always null: the address is already whitelisted in the Ondo address
            book, so nothing needs signing. Call execute with signature "0x"
        withdrawId:
          type: string
          description: Pending withdraw identifier
        withdrawLimit:
          type: string
          description: >-
            Maximum withdraw amount: the withdrawable margin minus the fee,
            which Ondo debits on top of the amount, capped by the remaining
            period limit
      required:
        - exchange
        - fee
        - signData
        - withdrawId
        - withdrawLimit
      title: OndoWithdrawData
    RobinhoodWithdrawResponseDto:
      type: object
      properties:
        exchange:
          type: string
          enum:
            - robinhood
        fee:
          type: number
          description: Withdraw fee amount
        signData:
          type: string
          description: Message that needs to be signed by the user
        withdrawId:
          type: string
          description: Pending withdraw identifier
        withdrawLimit:
          type: string
          description: Maximum fast withdraw amount
      required:
        - exchange
        - fee
        - signData
        - withdrawId
        - withdrawLimit
      title: RobinhoodWithdrawData
    ErrorResponseDTO:
      type: object
      properties:
        message:
          type: string
          example: 'Invalid order id: 123'
        statusCode:
          example: 503
          type: number
      required:
        - message
      title: ErrorResponse
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.