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

# Withdraw_queue

> Real-time withdrawal queue updates for the user



## AsyncAPI

````yaml api-reference/asyncapi.json withdraw_queue
id: withdraw_queue
title: Withdraw_queue
description: Real-time withdrawal queue updates for the user
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.aptoslabs.com/decibel/ws
    bindings: []
    variables: []
address: withdraw_queue:{userAddr}
parameters:
  - id: userAddr
    jsonSchema:
      type: string
      description: User wallet address (Aptos address format, e.g. 0x123...)
    description: User wallet address (Aptos address format, e.g. 0x123...)
    type: string
    required: true
    deprecated: false
bindings: []
operations:
  - &ref_3
    id: receivewithdraw_queue
    title: Receivewithdraw_queue
    description: Receive updates for real-time withdrawal queue updates for the user
    type: receive
    messages:
      - &ref_4
        id: WithdrawQueueMessage
        payload:
          - name: WithdrawQueueMessage
            description: Real-time withdrawal queue updates for the user
            type: object
            properties:
              - name: entries
                type: array
                required: true
                properties:
                  - name: cancel_reason
                    type: oneOf
                    required: false
                  - name: fungible_amount
                    type: number
                    description: >-
                      Requested withdrawal amount, normalized by collateral
                      decimals.
                    required: true
                  - name: market
                    type: &ref_0
                      - string
                      - 'null'
                    description: >-
                      The market address. Absent for non-market (cross-margin)
                      withdrawals.
                    required: false
                  - name: processed_amount
                    type: number
                    description: >-
                      Amount actually withdrawn. Equals `fungible_amount` for
                      Processed entries, 0 otherwise.
                    required: true
                  - name: queued_at_ms
                    type: &ref_1
                      - integer
                      - 'null'
                    description: >-
                      Timestamp when the withdrawal was originally queued.
                      Always present for Queued

                      entries. For Processed/Cancelled entries, enriched from
                      the corresponding Queued

                      row. HTTP responses enrich via same-page lookup + DB
                      backfill; WebSocket updates

                      only enrich from the same batch, so this may be absent.
                    required: false
                  - name: recipient
                    type: &ref_2
                      - string
                      - 'null'
                    description: >-
                      The intended recipient address. The on-chain
                      CancelledEvent omits this field,

                      so it is enriched from the corresponding Queued row. HTTP
                      responses enrich via

                      same-page lookup + DB backfill; WebSocket updates only
                      enrich from the same batch.
                    required: false
                  - name: request_id
                    type: string
                    required: true
                  - name: status
                    type: string
                    enumValues:
                      - Queued
                      - Processed
                      - Cancelled
                    required: true
                  - name: timestamp_ms
                    type: integer
                    description: >-
                      Timestamp of this specific event. For Processed entries
                      this is the settlement

                      time; for Cancelled entries the cancellation time. See
                      `queued_at_ms` for the

                      original queue time.
                    required: true
                  - name: transaction_version
                    type: integer
                    required: true
                  - name: user
                    type: string
                    required: true
              - name: topic
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Real-time withdrawal queue update pushed over WebSocket.


            All messages are **incremental deltas**, not full snapshots (the
            topic is

            `STREAMING_ONLY`). Consumers must merge entries by `request_id`,
            keeping

            the row with the highest `transaction_version`.


            Because the WS path does not perform DB backfill, `recipient` and

            `queued_at_ms` may be `None` on terminal events
            (`Processed`/`Cancelled`)

            when the corresponding `Queued` event arrived in a prior batch. Use
            the

            HTTP `GET /api/v1/withdraw_queue` endpoint for fully-enriched data.
          required:
            - topic
            - entries
          properties:
            entries:
              type: array
              items:
                type: object
                description: >-
                  A single withdrawal queue event (Queued, Processed, or
                  Cancelled).


                  The underlying table is an append-log: each state transition
                  is a separate row keyed

                  by `event_uid`. Unfiltered queries may return multiple rows
                  for the same `request_id`

                  (e.g., a Queued row and a Processed row). Clients should
                  deduplicate by `request_id`,

                  keeping the terminal state (Processed or Cancelled) over
                  Queued.
                required:
                  - user
                  - fungible_amount
                  - processed_amount
                  - request_id
                  - status
                  - timestamp_ms
                  - transaction_version
                properties:
                  cancel_reason:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-201>
                      - oneOf:
                          - type: string
                            enum:
                              - CancelledByUser
                            x-parser-schema-id: <anonymous-schema-202>
                          - type: string
                            enum:
                              - InsufficientWithdrawableBalance
                            x-parser-schema-id: <anonymous-schema-203>
                          - type: string
                            enum:
                              - DepositCheckFailed
                            x-parser-schema-id: <anonymous-schema-204>
                          - type: object
                            required:
                              - Unknown
                            properties:
                              Unknown:
                                type: string
                                x-parser-schema-id: <anonymous-schema-206>
                            x-parser-schema-id: <anonymous-schema-205>
                        description: >-
                          Cancel reason for a withdrawal request.


                          Serializes as a flat string for all variants
                          (including Unknown).
                        x-parser-schema-id: WithdrawCancelReason
                    x-parser-schema-id: <anonymous-schema-200>
                  fungible_amount:
                    type: number
                    format: double
                    description: >-
                      Requested withdrawal amount, normalized by collateral
                      decimals.
                    x-parser-schema-id: <anonymous-schema-207>
                  market:
                    type: *ref_0
                    description: >-
                      The market address. Absent for non-market (cross-margin)
                      withdrawals.
                    x-parser-schema-id: <anonymous-schema-208>
                  processed_amount:
                    type: number
                    format: double
                    description: >-
                      Amount actually withdrawn. Equals `fungible_amount` for
                      Processed entries, 0 otherwise.
                    x-parser-schema-id: <anonymous-schema-209>
                  queued_at_ms:
                    type: *ref_1
                    format: int64
                    description: >-
                      Timestamp when the withdrawal was originally queued.
                      Always present for Queued

                      entries. For Processed/Cancelled entries, enriched from
                      the corresponding Queued

                      row. HTTP responses enrich via same-page lookup + DB
                      backfill; WebSocket updates

                      only enrich from the same batch, so this may be absent.
                    x-parser-schema-id: <anonymous-schema-210>
                  recipient:
                    type: *ref_2
                    description: >-
                      The intended recipient address. The on-chain
                      CancelledEvent omits this field,

                      so it is enriched from the corresponding Queued row. HTTP
                      responses enrich via

                      same-page lookup + DB backfill; WebSocket updates only
                      enrich from the same batch.
                    x-parser-schema-id: <anonymous-schema-211>
                  request_id:
                    type: string
                    x-parser-schema-id: <anonymous-schema-212>
                  status:
                    type: string
                    enum:
                      - Queued
                      - Processed
                      - Cancelled
                    x-parser-schema-id: WithdrawQueueStatus
                  timestamp_ms:
                    type: integer
                    format: int64
                    description: >-
                      Timestamp of this specific event. For Processed entries
                      this is the settlement

                      time; for Cancelled entries the cancellation time. See
                      `queued_at_ms` for the

                      original queue time.
                    x-parser-schema-id: <anonymous-schema-213>
                  transaction_version:
                    type: integer
                    format: int64
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-214>
                  user:
                    type: string
                    x-parser-schema-id: <anonymous-schema-215>
                x-parser-schema-id: WithdrawQueueEntryDto
              x-parser-schema-id: <anonymous-schema-199>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-216>
          x-parser-schema-id: WithdrawQueueUpdateResponse
        title: Withdraw queue message
        description: Real-time withdrawal queue updates for the user
        example: |-
          {
            "topic": "withdraw_queue:0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
            "entries": [
              {
                "user": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
                "recipient": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
                "fungible_amount": 100,
                "processed_amount": 0,
                "request_id": "12345",
                "status": "Queued",
                "timestamp_ms": 1699564800000,
                "queued_at_ms": 1699564800000,
                "transaction_version": 12345678
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: WithdrawQueueMessage
          - id: x-parser-message-name
            value: WithdrawQueueMessage
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: withdraw_queue
sendOperations:
  - *ref_3
receiveOperations: []
sendMessages:
  - *ref_4
receiveMessages: []
extensions:
  - id: x-parser-unique-object-id
    value: withdraw_queue
securitySchemes: []

````