openapi: 3.0.0
info:
  title: REST API
  version: 1.1.0
  description: ''
servers:
  - url: https://api.kraken.com/0
    description: Production Server
security:
  - API-Key: []
    API-Sign: []
tags:
  - name: Market Data
  - name: Account Data
  - name: Trading
  - name: Funding
  - name: Subaccounts
    description: >-
      Subaccounts are currently only available to institutional clients. Please
      contact your Account Manager for more details.
  - name: Earn
    description: >
      The earn API allows interacting with all of Kraken's yield generating
      products. It replaces the old `/staking` part of the API.


      The different available earn products are represented by earn strategies.
      This corresponds to the legacy `Staking/Assets`. `Stake`/`Unstake` are
      replaced by `Allocate`/`Deallocate`.


      ### Overview of the available endpoints under `/Earn`:


      - `Strategies` - list all earn strategies for which you are eligible or
      have a balance.

      - `Allocations` - lists the balance in your earn account for each
      strategy. Requires the `Query Funds` API key permission.

      - `Allocate`/`Deallocate` - allocate/deallocate to an earn strategy
      through an async operation. Requires the `Earn Funds` API key permission.

      - `AllocateStatus`/`DeallocateStatus` - verifies the state of the last
      allocation/deallocation. Requires the `Earn Funds` or `Query Funds` API
      key permission.


      ### Example usage:


      ### Determine which funds are earning rewards:


      1. Call `Strategies` to obtain information about the relevant strategy.
      The `lock_type` field shows whether bonding/unbonding funds are earning
      yield. The relevant fields are `bonding_rewards`/`unbonding_rewards`.

      2. Call `Allocations` for the relevant strategy. From the previous step,
      for strategies where bonding/unbonding does not earn yield, substract
      these balances from `amount_allocated.total` to determine which balances
      are currently earning.


      ### Get allocatable balance:


      Call `/0/private/BalanceEx`, subtract `hold_trading` amount. Remaining
      balance is available for allocation to a strategy.


      ### Geo restrictions:


      Some earn strategies are not available in all geographic regions.
      `Strategies` will return only strategies available to the caller.
  - name: Transparency
paths:
  /public/Time:
    get:
      tags:
        - Market Data
      summary: Get Server Time
      description: |
        Get the server's time.
      operationId: getServerTime
      security: []
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/time'
                example:
                  error: []
                  result:
                    unixtime: 1688669448
                    rfc1123: Thu, 06 Jul 23 18:50:48 +0000
  /public/SystemStatus:
    get:
      tags:
        - Market Data
      summary: Get System Status
      description: |
        Get the current system status or trading mode.
      operationId: getSystemStatus
      security: []
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    properties:
                      status:
                        type: string
                        enum:
                          - online
                          - maintenance
                          - cancel_only
                          - post_only
                        description: >
                          Current system status:

                          * `online`  Kraken is operating normally. All order
                          types may be submitted and trades can occur.

                          * `maintenance`  The exchange is offline. No new
                          orders or cancellations may be submitted.

                          * `cancel_only`  Resting (open) orders can be
                          cancelled but no new orders may be submitted. No
                          trades will occur.

                          * `post_only`  Only post-only limit orders can be
                          submitted. Existing orders may still be cancelled. No
                          trades will occur.
                      timestamp:
                        type: string
                        description: Current timestamp (RFC3339)
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    status: online
                    timestamp: '2023-07-06T18:52:00Z'
  /public/Assets:
    get:
      tags:
        - Market Data
      summary: Get Asset Info
      description: >
        Get information about the assets that are available for deposit,
        withdrawal, trading and earn.
      operationId: getAssetInfo
      security: []
      parameters:
        - $ref: '#/components/parameters/asset'
        - $ref: '#/components/parameters/aclass'
        - $ref: '#/components/parameters/assetVersion'
      responses:
        '200':
          description: Asset info retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/info-2'
                example:
                  error: []
                  result:
                    XXBT:
                      aclass: currency
                      altname: XBT
                      decimals: 10
                      display_decimals: 5
                      collateral_value: 1
                      status: enabled
                    ZEUR:
                      aclass: currency
                      altname: EUR
                      decimals: 4
                      display_decimals: 2
                      collateral_value: 1
                      status: enabled
                    ZUSD:
                      aclass: currency
                      altname: USD
                      decimals: 4
                      display_decimals: 2
                      collateral_value: 1
                      status: enabled
  /public/AssetPairs:
    get:
      tags:
        - Market Data
      summary: Get Tradable Asset Pairs
      description: |
        Get tradable asset pairs
      operationId: getTradableAssetPairs
      security: []
      parameters:
        - $ref: '#/components/parameters/assetVersion'
        - in: query
          name: pair
          description: Asset pairs to get data for
          schema:
            type: string
          example: BTC/USD,ETH/BTC
        - in: query
          name: aclass_base
          schema:
            type: string
            enum:
              - currency
              - tokenized_asset
            default: currency
          description: |
            Filters the asset class to retrieve (optional)

              * `currency` = spot currency pairs.
              * `tokenized_asset` = tokenized asset pairs, i.e. xstocks.
        - in: query
          name: info
          schema:
            type: string
            enum:
              - info
              - leverage
              - fees
              - margin
            default: info
          description: |
            Info to retrieve (optional)

              * `info` = all info
              * `leverage` = leverage info
              * `fees` = fees schedule
              * `margin` = margin info
        - in: query
          name: country_code
          description: >-
            Filter for response to only include pairs available in the provided
            country/region (ISO 3166-1 alpha-2 code).
          schema:
            type: string
          example: GB
        - in: query
          name: execution_venue
          schema:
            type: string
            enum:
              - international
              - bitnomial_exchange
            default: international
          description: |
            Comma-separated list of execution venues to filter by (optional)

              * `international` = International exchange
              * `bitnomial_exchange` = Bitnomial exchange
      responses:
        '200':
          description: Tradable asset pairs retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    description: Pair names and their info
                    type: object
                    additionalProperties:
                      $ref: '#/components/schemas/pairs'
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    XETHXXBT:
                      altname: ETHXBT
                      wsname: ETH/XBT
                      aclass_base: currency
                      base: XETH
                      aclass_quote: currency
                      quote: XXBT
                      lot: unit
                      cost_decimals: 6
                      pair_decimals: 5
                      lot_decimals: 8
                      lot_multiplier: 1
                      leverage_buy:
                        - 2
                        - 3
                        - 4
                        - 5
                      leverage_sell:
                        - 2
                        - 3
                        - 4
                        - 5
                      fees:
                        - - 0
                          - 0.26
                        - - 50000
                          - 0.24
                        - - 100000
                          - 0.22
                        - - 250000
                          - 0.2
                        - - 500000
                          - 0.18
                        - - 1000000
                          - 0.16
                        - - 2500000
                          - 0.14
                        - - 5000000
                          - 0.12
                        - - 10000000
                          - 0.1
                      fees_maker:
                        - - 0
                          - 0.16
                        - - 50000
                          - 0.14
                        - - 100000
                          - 0.12
                        - - 250000
                          - 0.1
                        - - 500000
                          - 0.08
                        - - 1000000
                          - 0.06
                        - - 2500000
                          - 0.04
                        - - 5000000
                          - 0.02
                        - - 10000000
                          - 0
                      fee_volume_currency: ZUSD
                      margin_call: 80
                      margin_stop: 40
                      ordermin: '0.01'
                      costmin: '0.00002'
                      tick_size: '0.00001'
                      status: online
                      long_position_limit: 1100
                      short_position_limit: 400
                    XXBTZUSD:
                      altname: XBTUSD
                      wsname: XBT/USD
                      aclass_base: currency
                      base: XXBT
                      aclass_quote: currency
                      quote: ZUSD
                      lot: unit
                      cost_decimals: 5
                      pair_decimals: 1
                      lot_decimals: 8
                      lot_multiplier: 1
                      leverage_buy:
                        - 2
                        - 3
                        - 4
                        - 5
                      leverage_sell:
                        - 2
                        - 3
                        - 4
                        - 5
                      fees:
                        - - 0
                          - 0.26
                        - - 50000
                          - 0.24
                        - - 100000
                          - 0.22
                        - - 250000
                          - 0.2
                        - - 500000
                          - 0.18
                        - - 1000000
                          - 0.16
                        - - 2500000
                          - 0.14
                        - - 5000000
                          - 0.12
                        - - 10000000
                          - 0.1
                      fees_maker:
                        - - 0
                          - 0.16
                        - - 50000
                          - 0.14
                        - - 100000
                          - 0.12
                        - - 250000
                          - 0.1
                        - - 500000
                          - 0.08
                        - - 1000000
                          - 0.06
                        - - 2500000
                          - 0.04
                        - - 5000000
                          - 0.02
                        - - 10000000
                          - 0
                      fee_volume_currency: ZUSD
                      margin_call: 80
                      margin_stop: 40
                      ordermin: '0.0001'
                      costmin: '0.5'
                      tick_size: '0.1'
                      status: online
                      long_position_limit: 250
                      short_position_limit: 200
  /public/Ticker:
    get:
      summary: Get Ticker Information
      description: >
        Get ticker information for all or requested markets. To clarify usage,
        note that 

        * Today's prices start at midnight UTC

        * Leaving the pair parameter blank will return tickers for all tradeable
        assets on Kraken
      tags:
        - Market Data
      operationId: getTickerInformation
      security: []
      parameters:
        - $ref: '#/components/parameters/wildcard_pair'
        - $ref: '#/components/parameters/assetVersion'
        - name: asset_class
          in: query
          description: >-
            This parameter is required on requests for tokenized pairs, i.e.
            xstocks. If `asset_class` is provided without the `pair` parameter,
            all pairs for that asset class will be returned.
          required: false
          schema:
            type: string
            enum:
              - tokenized_asset
              - forex
            default: forex
      responses:
        '200':
          description: Ticker info retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ticker-2'
  /public/OHLC:
    get:
      summary: Get OHLC Data
      description: >
        Retrieve OHLC market data.

        The last entry in the OHLC array is for the current, not-yet-committed
        timeframe, and will always be present, regardless of the value of
        `since`.

        Returns up to 720 of the most recent entries (older data cannot be
        retrieved, regardless of the value of `since`).
      tags:
        - Market Data
      operationId: getOHLCData
      security: []
      parameters:
        - $ref: '#/components/parameters/pair'
        - $ref: '#/components/parameters/assetVersion'
        - name: interval
          description: Time frame interval in minutes
          in: query
          schema:
            type: integer
            default: 1
            enum:
              - 1
              - 5
              - 15
              - 30
              - 60
              - 240
              - 1440
              - 10080
              - 21600
          example: 60
        - name: since
          in: query
          description: >-
            Return OHLC entries since the given timestamp (intended for
            incremental updates)
          schema:
            type: integer
          example: 1688671200
        - $ref: '#/components/parameters/asset_class'
      responses:
        '200':
          description: OHLC data retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ohlc'
                example:
                  error: []
                  result:
                    XXBTZUSD:
                      - - 1688671200
                        - '30306.1'
                        - '30306.2'
                        - '30305.7'
                        - '30305.7'
                        - '30306.1'
                        - '3.39243896'
                        - 23
                      - - 1688671260
                        - '30304.5'
                        - '30304.5'
                        - '30300.0'
                        - '30300.0'
                        - '30300.0'
                        - '4.42996871'
                        - 18
                      - - 1688671320
                        - '30300.3'
                        - '30300.4'
                        - '30291.4'
                        - '30291.4'
                        - '30294.7'
                        - '2.13024789'
                        - 25
                      - - 1688671380
                        - '30291.8'
                        - '30295.1'
                        - '30291.8'
                        - '30295.0'
                        - '30293.8'
                        - '1.01836275'
                        - 9
                    last: 1688672160
  /public/Depth:
    get:
      summary: Get Order Book
      description: >
        Returns level 2 (L2) order book, which describes the individual price
        levels in the book with aggregated order quantities at each level.
      tags:
        - Market Data
      operationId: getOrderBook
      security: []
      parameters:
        - $ref: '#/components/parameters/pair'
        - $ref: '#/components/parameters/assetVersion'
        - name: count
          description: Maximum number of asks/bids
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
          example: 2
        - $ref: '#/components/parameters/asset_class'
      responses:
        '200':
          description: Order book entries retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/depth'
                example:
                  error: []
                  result:
                    XXBTZUSD:
                      asks:
                        - - '30384.10000'
                          - '2.059'
                          - 1688671659
                        - - '30387.90000'
                          - '1.500'
                          - 1688671380
                        - - '30393.70000'
                          - '9.871'
                          - 1688671261
                      bids:
                        - - '30297.00000'
                          - '1.115'
                          - 1688671636
                        - - '30296.70000'
                          - '2.002'
                          - 1688671674
                        - - '30289.80000'
                          - '5.001'
                          - 1688671673
  /private/Level3:
    post:
      summary: Query L3 Order Book
      description: >
        Retrieve Level3 order book data, which provides individual order
        information at each price level.

        This includes order IDs and timestamps for each order in the book. 


        The Level3 endpoint requires authentication.


        **API Key Permissions Required:** `Orders and trades - Query open orders
        & trades`
      tags:
        - Market Data
      operationId: getLevel3OrderBook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                pair:
                  type: string
                  description: Asset pair to get order book for
                  example: YFI/EUR
                depth:
                  type: integer
                  description: >-
                    Number of price levels to return per side (bids/asks). Use 0
                    to return the full book.
                  enum:
                    - 0
                    - 10
                    - 25
                    - 100
                    - 250
                    - 1000
                  default: 100
                  example: 10
              required:
                - nonce
                - pair
      responses:
        '200':
          description: Level 3 order book data retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      pair:
                        type: string
                        description: Asset pair
                      bids:
                        type: array
                        description: Bid orders
                        items:
                          type: object
                          properties:
                            price:
                              type: string
                              description: Bid price
                            qty:
                              type: string
                              description: Bid quantity
                            order_id:
                              type: string
                              description: Order ID
                            timestamp:
                              type: integer
                              description: Order timestamp (nanoseconds)
                      asks:
                        type: array
                        description: Ask orders
                        items:
                          type: object
                          properties:
                            price:
                              type: string
                              description: Ask price
                            qty:
                              type: string
                              description: Ask quantity
                            order_id:
                              type: string
                              description: Order ID
                            timestamp:
                              type: integer
                              description: Order timestamp (nanoseconds)
                  error:
                    type: array
                    items:
                      $ref: '#/components/schemas/error'
              example:
                error: []
                result:
                  pair: YFI/EUR
                  bids:
                    - price: '3062.00000'
                      qty: '0.29665800'
                      order_id: O5KJU4-IEQTM-NDMS6W
                      timestamp: 1765622008594292000
                    - price: '3062.00000'
                      qty: '0.13917400'
                      order_id: OERRY6-MXYER-6EQKNY
                      timestamp: 1765622011396903000
                  asks:
                    - price: '3066.00000'
                      qty: '0.00278335'
                      order_id: ORAWGV-N5L4J-LBA3WH
                      timestamp: 1765622008499456000
                    - price: '3067.00000'
                      qty: '0.13902210'
                      order_id: OZWNZS-QE3G6-ZPKZUT
                      timestamp: 1765622021013826600
  /public/GroupedBook:
    get:
      summary: Get Grouped Order Book
      description: >
        The GroupedBook endpoint aggregates the volume in the order book over a
        specified tick range. 

        It provides a summary of liquidity deep into the book, useful for user
        interface display.


        Bids and asks between grouped price levels are accumulated to the
        nearest passive level (asks rounded up, bids down).
      tags:
        - Market Data
      operationId: getGroupedOrderBook
      security: []
      parameters:
        - in: query
          name: pair
          required: true
          schema:
            type: string
          description: Asset pair to get order book for
          example: BTC/USD
        - in: query
          name: depth
          schema:
            type: integer
            enum:
              - 10
              - 25
              - 100
              - 250
              - 1000
            default: 10
          description: The number of price levels to return per side (bids/asks).
          example: 10
        - in: query
          name: grouping
          schema:
            type: integer
            format: int32
            nullable: true
            enum:
              - 1
              - 5
              - 10
              - 25
              - 50
              - 100
              - 250
              - 500
              - 1000
            default: 1
          description: >-
            Specifies how many tick levels should be within each price level.
            Bids and asks between grouped price levels are accumulated to the
            nearest passive level (asks rounded up, bids down).
          example: 1000
      responses:
        '200':
          description: Grouped order book data retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      pair:
                        type: string
                        description: Asset pair
                      grouping:
                        type: integer
                        description: The grouping value used
                      bids:
                        type: array
                        description: Aggregated bid levels
                        items:
                          type: object
                          properties:
                            price:
                              type: string
                              description: Grouped price level
                            qty:
                              type: string
                              description: Aggregated quantity at this price level
                      asks:
                        type: array
                        description: Aggregated ask levels
                        items:
                          type: object
                          properties:
                            price:
                              type: string
                              description: Grouped price level
                            qty:
                              type: string
                              description: Aggregated quantity at this price level
                  error:
                    type: array
                    items:
                      $ref: '#/components/schemas/error'
              example:
                error: []
                result:
                  pair: BTC/USD
                  grouping: 1000
                  bids:
                    - price: '90400.00000'
                      qty: '19.83057746'
                    - price: '90300.00000'
                      qty: '45.35073006'
                    - price: '90200.00000'
                      qty: '35.33199856'
                    - price: '90100.00000'
                      qty: '32.40807838'
                    - price: '90000.00000'
                      qty: '46.00445468'
                    - price: '89900.00000'
                      qty: '22.71486458'
                    - price: '89800.00000'
                      qty: '11.55482018'
                    - price: '89700.00000'
                      qty: '13.77715743'
                    - price: '89600.00000'
                      qty: '27.72185770'
                    - price: '89500.00000'
                      qty: '14.09383330'
                  asks:
                    - price: '90500.00000'
                      qty: '38.96185061'
                    - price: '90600.00000'
                      qty: '55.96402032'
                    - price: '90700.00000'
                      qty: '34.64783055'
                    - price: '90800.00000'
                      qty: '25.26797469'
                    - price: '90900.00000'
                      qty: '20.48922196'
                    - price: '91000.00000'
                      qty: '14.87773628'
                    - price: '91100.00000'
                      qty: '18.99740224'
                    - price: '91200.00000'
                      qty: '19.00592802'
                    - price: '91300.00000'
                      qty: '4.05573682'
                    - price: '91400.00000'
                      qty: '1.60667017'
  /public/Trades:
    get:
      summary: Get Recent Trades
      description: |
        Returns the last 1000 trades by default
      tags:
        - Market Data
      operationId: getRecentTrades
      security: []
      parameters:
        - $ref: '#/components/parameters/pair'
        - $ref: '#/components/parameters/assetVersion'
        - name: since
          in: query
          description: Return trade data since given timestamp
          schema:
            type: string
          example: '1616663618'
        - name: count
          in: query
          description: Return specific number of trades, up to 1000
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 1000
          example: 2
        - $ref: '#/components/parameters/asset_class'
      responses:
        '200':
          description: Trade data retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/trades'
                example:
                  error: []
                  result:
                    XXBTZUSD:
                      - - '30243.40000'
                        - '0.34507674'
                        - 1688669597.8277369
                        - b
                        - m
                        - ''
                        - 61044952
                      - - '30243.30000'
                        - '0.00376960'
                        - 1688669598.2804112
                        - s
                        - l
                        - ''
                        - 61044953
                      - - '30243.30000'
                        - '0.01235716'
                        - 1688669602.698379
                        - s
                        - m
                        - ''
                        - 61044956
                    last: '1688671969993150842'
  /public/Spread:
    get:
      summary: Get Recent Spreads
      description: |
        Returns the last ~200 top-of-book spreads for a given pair
      tags:
        - Market Data
      operationId: getRecentSpreads
      security: []
      parameters:
        - $ref: '#/components/parameters/pair'
        - $ref: '#/components/parameters/assetVersion'
        - name: since
          in: query
          description: >-
            Returns spread data since given timestamp. Optional, intended for
            incremental updates within available dataset (does not contain all
            historical spreads).
          schema:
            type: integer
          example: 1678219570
        - $ref: '#/components/parameters/asset_class'
      responses:
        '200':
          description: Spread data retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/spread-2'
                example:
                  error: []
                  result:
                    XXBTZUSD:
                      - - 1688671834
                        - '30292.10000'
                        - '30297.50000'
                      - - 1688671834
                        - '30292.10000'
                        - '30296.70000'
                      - - 1688671834
                        - '30292.70000'
                        - '30296.70000'
                    last: 1688672106
  /private/Balance:
    post:
      summary: Get Account Balance
      description: >
        Retrieve all cash balances, net of pending withdrawals.


        **Note on Staking/Earn assets:** We have begun to migrate assets from
        our legacy Staking system over to a new Earn system. As such, the
        following assets may appear in your balances and ledger. Please see our
        [Support
        article](https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-)
        for more details. Note that these assets are "read-only", to interact
        with your balances in them please use the base asset (e.g. `USDT` to
        transact with your `USDT` and `USDT.F` balances).


        **Symbol Extensions**:

        * `.B`: balances in new yield-bearing products, similar to `.S` (staked)
        and `.M` (opt-in rewards) balances

        * `.F`: balances earning automatically in Kraken Rewards

        * `.T`: tokenized assets.


        **API Key Permissions Required:** `Funds permissions - Query`
      tags:
        - Account Data
      operationId: getAccountBalance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                rebase_multiplier:
                  $ref: '#/components/schemas/rebase_multiplier'
              required:
                - nonce
      responses:
        '200':
          description: Account balances retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/balance-2'
                example:
                  error: []
                  result:
                    ZUSD: '171288.6158'
                    ZEUR: '504861.8946'
                    XXBT: '1011.1908877900'
                    XETH: '818.5500000000'
                    USDT: '500000.00000000'
                    DAI: '9999.9999999999'
                    DOT: '2.5000000000'
                    ETH2.S: '198.3970800000'
                    ETH2: '2.5885574330'
                    USD.M: '1213029.2780'
  /private/BalanceEx:
    post:
      summary: Get Extended Balance
      description: >
        Retrieve all extended account balances, including credits and held
        amounts. Balance available for trading is calculated as: `available
        balance = balance + credit - credit_used - hold_trade`


        Note that held amounts only include spot non margin orders.


        **Note on Staking/Earn assets:** We have begun to migrate assets from
        our legacy Staking system over to a new Earn system. As such, the
        following assets may appear in your balances and ledger. Please see our
        [Support
        article](https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-)
        for more details. Note that these assets are "read-only", to interact
        with your balances in them please use the base asset (e.g. `USDT` to
        transact with your `USDT` and `USDT.F` balances).


        **Symbol Extensions**:

        * `.B`: balances in new yield-bearing products, similar to `.S` (staked)
        and `.M` (opt-in rewards) balances

        * `.F`: balances earning automatically in Kraken Rewards

        * `.T`: tokenized assets.


        **API Key Permissions Required:** `Funds permissions - Query`
      tags:
        - Account Data
      operationId: getExtendedBalance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                rebase_multiplier:
                  $ref: '#/components/schemas/rebase_multiplier'
              required:
                - nonce
      responses:
        '200':
          description: Extended account balances retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/balanceex-2'
                example:
                  error: []
                  result:
                    ZUSD:
                      balance: 25435.21
                      hold_trade: 8249.76
                    XXBT:
                      balance: 1.2435
                      hold_trade: 0.8423
  /private/CreditLines:
    post:
      summary: Get Credit Lines
      description: |
        Retrieve all credit line details for VIPs with this functionality.

        **API Key Permissions Required:** `Funds permissions - Query`
      tags:
        - Account Data
      operationId: getCreditLines
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                rebase_multiplier:
                  $ref: '#/components/schemas/rebase_multiplier'
              required:
                - nonce
      responses:
        '200':
          description: Credit line details retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/creditlines-2'
                example:
                  error: []
                  result:
                    asset_details:
                      USD:
                        balance: '1000.5000'
                        credit_limit: '50000.0000'
                        credit_used: '12500.0000'
                        available_credit: '37500.0000'
                      EUR:
                        balance: '500.2500'
                        credit_limit: '25000.0000'
                        credit_used: '5000.0000'
                        available_credit: '20000.0000'
                    limits_monitor:
                      total_credit_usd: '100000.0000'
                      total_credit_used_usd: '25000.0000'
                      total_collateral_value_usd: '150000.0000'
                      equity_usd: '125000.0000'
                      ongoing_balance: '1.5000'
                      debt_to_equity: '0.2000'
  /private/TradeBalance:
    post:
      summary: Get Trade Balance
      description: >
        Retrieve a summary of collateral balances, margin position valuations,
        equity and margin level.


        **API Key Permissions Required:** `Orders and trades - Query open orders
        & trades`
      tags:
        - Account Data
      operationId: getTradeBalance
      requestBody:
        $ref: '#/components/requestBodies/balance'
      responses:
        '200':
          description: Trade balances retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/balance-4'
                example:
                  error: []
                  result:
                    eb: '1101.3425'
                    tb: '392.2264'
                    m: '7.0354'
                    'n': '-10.0232'
                    c: '21.1063'
                    v: '31.1297'
                    e: '382.2032'
                    mf: '375.1678'
                    ml: '5432.57'
  /private/OpenOrders:
    post:
      summary: Get Open Orders
      description: >
        Retrieve information about currently open orders.


        **API Key Permissions Required:** `Orders and trades - Query open orders
        & trades`
      tags:
        - Account Data
      operationId: getOpenOrders
      requestBody:
        $ref: '#/components/requestBodies/openOrders'
      responses:
        '200':
          description: Open orders info retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/open-2'
                example:
                  error: []
                  result:
                    open:
                      OQCLML-BW3P3-BUCMWZ:
                        refid: None
                        userref: 0
                        status: open
                        opentm: 1688666559.8974
                        starttm: 0
                        expiretm: 0
                        descr:
                          pair: XBTUSD
                          type: buy
                          ordertype: limit
                          price: '30010.0'
                          price2: '0'
                          leverage: none
                          order: buy 1.25000000 XBTUSD @ limit 30010.0
                          close: ''
                        vol: '1.25000000'
                        vol_exec: '0.37500000'
                        cost: '11253.7'
                        fee: '0.00000'
                        price: '30010.0'
                        stopprice: '0.00000'
                        limitprice: '0.00000'
                        misc: ''
                        oflags: fciq
                        trades:
                          - TCCCTY-WE2O6-P3NB37
                      OB5VMB-B4U2U-DK2WRW:
                        refid: None
                        userref: 45326
                        status: open
                        opentm: 1688665899.5699
                        starttm: 0
                        expiretm: 0
                        descr:
                          pair: XBTUSD
                          type: buy
                          ordertype: limit
                          price: '14500.0'
                          price2: '0'
                          leverage: '5:1'
                          order: >-
                            buy 0.27500000 XBTUSD @ limit 14500.0 with 5:1
                            leverage
                          close: ''
                        vol: '0.27500000'
                        vol_exec: '0.00000000'
                        cost: '0.00000'
                        fee: '0.00000'
                        price: '0.00000'
                        stopprice: '0.00000'
                        limitprice: '0.00000'
                        misc: ''
                        oflags: fciq
  /private/ClosedOrders:
    post:
      summary: Get Closed Orders
      description: >
        Retrieve information about orders that have been closed (filled or
        cancelled). 50 results are returned at a time, the most recent by
        default.


        **Note:** If an order's tx ID is given for `start` or `end` time, the
        order's opening time (`opentm`) is used


        **API Key Permissions Required:** `Orders and trades - Query closed
        orders & trades`
      tags:
        - Account Data
      operationId: getClosedOrders
      requestBody:
        $ref: '#/components/requestBodies/closedOrders'
      responses:
        '200':
          description: Closed orders info retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/closed-2'
                example:
                  error: []
                  result:
                    closed:
                      O37652-RJWRT-IMO74O:
                        refid: None
                        userref: 1
                        status: canceled
                        reason: User requested
                        opentm: 1688148493.7708
                        closetm: 1688148610.0482
                        starttm: 0
                        expiretm: 0
                        descr:
                          pair: XBTGBP
                          type: buy
                          ordertype: stop-loss-limit
                          price: '23667.0'
                          price2: '0'
                          leverage: none
                          order: buy 0.00100000 XBTGBP @ limit 23667.0
                          close: ''
                        vol: '0.00100000'
                        vol_exec: '0.00000000'
                        cost: '0.00000'
                        fee: '0.00000'
                        price: '0.00000'
                        stopprice: '0.00000'
                        limitprice: '0.00000'
                        misc: ''
                        oflags: fciq
                        trigger: index
                      O6YDQ5-LOMWU-37YKEE:
                        refid: None
                        userref: 36493663
                        status: canceled
                        reason: User requested
                        opentm: 1688148493.7708
                        closetm: 1688148610.0477
                        starttm: 0
                        expiretm: 0
                        descr:
                          pair: XBTEUR
                          type: buy
                          ordertype: take-profit-limit
                          price: '27743.0'
                          price2: '0'
                          leverage: none
                          order: buy 0.00100000 XBTEUR @ limit 27743.0
                          close: ''
                        vol: '0.00100000'
                        vol_exec: '0.00000000'
                        cost: '0.00000'
                        fee: '0.00000'
                        price: '0.00000'
                        stopprice: '0.00000'
                        limitprice: '0.00000'
                        misc: ''
                        oflags: fciq
                        trigger: index
                    count: 2
  /private/QueryOrders:
    post:
      summary: Query Orders Info
      description: >
        Retrieve information about specific orders.


        **API Key Permissions Required:** `Orders and trades - Query open orders
        & trades` or `Orders and trades - Query closed orders & trades`,
        depending on status of order
      tags:
        - Account Data
      operationId: getOrdersInfo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/query'
            examples:
              Example Query 2 orders:
                value:
                  nonce: 1695828490
                  trades: false
                  userref: 1693455284
                  txid: STMH53C-C54CG-4SO42I, ST4USDQ-ZQBMB-FGET2G
      responses:
        '200':
          description: Orders info retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/query-2'
                example:
                  error: []
                  result:
                    OBCMZD-JIEE7-77TH3F:
                      refid: None
                      userref: 0
                      status: closed
                      reason: null
                      opentm: 1688665496.7808
                      closetm: 1688665499.1922
                      starttm: 0
                      expiretm: 0
                      descr:
                        pair: XBTUSD
                        type: buy
                        ordertype: stop-loss-limit
                        price: '27500.0'
                        price2: '0'
                        leverage: none
                        order: buy 1.25000000 XBTUSD @ limit 27500.0
                        close: ''
                      vol: '1.25000000'
                      vol_exec: '1.25000000'
                      cost: '27526.2'
                      fee: '26.2'
                      price: '27500.0'
                      stopprice: '0.00000'
                      limitprice: '0.00000'
                      misc: ''
                      oflags: fciq
                      trigger: index
                      trades:
                        - TZX2WP-XSEOP-FP7WYR
                    OMMDB2-FSB6Z-7W3HPO:
                      refid: None
                      userref: 0
                      status: closed
                      reason: null
                      opentm: 1688592012.2317
                      closetm: 1688592012.2335
                      starttm: 0
                      expiretm: 0
                      descr:
                        pair: XBTUSD
                        type: sell
                        ordertype: market
                        price: '0'
                        price2: '0'
                        leverage: none
                        order: sell 0.25000000 XBTUSD @ market
                        close: ''
                      vol: '0.25000000'
                      vol_exec: '0.25000000'
                      cost: '7500.0'
                      fee: '7.5'
                      price: '30000.0'
                      stopprice: '0.00000'
                      limitprice: '0.00000'
                      misc: ''
                      oflags: fcib
                      trades:
                        - TJUW2K-FLX2N-AR2FLU
  /private/OrderAmends:
    post:
      summary: Get Order Amends
      description: >
        Retrieves an audit trail of amend transactions on the specified order.
        The list is ordered by ascending amend timestamp.


        **API Key Permissions Required:** `Orders and trades - Query open orders
        & trades` or `Orders and trades - Query closed orders & trades`,
        depending on status of order.
      tags:
        - Account Data
      operationId: getOrderAmends
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/amends'
      responses:
        '200':
          description: >-
            The first entry contains the original order parameters and has
            amend_type of `original`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/amends-2'
                example:
                  response:
                    error: []
                    result:
                      amends:
                        - amend_id: TSUN4B-EX2XN-WQ6GKG
                          amend_type: original
                          order_qty: '0.01000000'
                          remaining_qty: '0.01000000'
                          limit_price: '61032.8'
                          timestamp: 1724158070287558000
                        - amend_id: TF6VAW-VUWMX-6SXTCH
                          amend_type: user
                          order_qty: '0.01000000'
                          remaining_qty: '0.01000000'
                          limit_price: '61032.7'
                          timestamp: 1724158076936755700
                        - amend_id: TUMY4K-E4MPE-CSL2N3
                          amend_type: user
                          order_qty: '0.01000000'
                          remaining_qty: '0.01000000'
                          limit_price: '61032.6'
                          timestamp: 1724158214879660000
                      count: 3
  /private/TradesHistory:
    post:
      summary: Get Trades History
      description: >
        Retrieve information about trades/fills. 50 results are returned at a
        time, the most recent by default.

        * Unless otherwise stated, costs, fees, prices, and volumes are
        specified with the precision for the asset pair (`pair_decimals` and
        `lot_decimals`), not the individual assets' precision (`decimals`).


        **API Key Permissions Required:** `Orders and trades - Query closed
        orders & trades`
      tags:
        - Account Data
      operationId: getTradeHistory
      requestBody:
        $ref: '#/components/requestBodies/history'
      responses:
        '200':
          description: Trade history retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/history-2'
                example:
                  error: []
                  result:
                    trades:
                      THVRQM-33VKH-UCI7BS:
                        ordertxid: OQCLML-BW3P3-BUCMWZ
                        postxid: TKH2SE-M7IF5-CFI7LT
                        pair: XXBTZUSD
                        time: 1688667796.8802
                        type: buy
                        ordertype: limit
                        price: '30010.00000'
                        cost: '600.20000'
                        fee: '0.00000'
                        vol: '0.02000000'
                        margin: '0.00000'
                        misc: ''
                        trade_id: 40274859
                        maker: true
                      TCWJEG-FL4SZ-3FKGH6:
                        ordertxid: OQCLML-BW3P3-BUCMWZ
                        postxid: TKH2SE-M7IF5-CFI7LT
                        pair: XXBTZUSD
                        time: 1688667769.6396
                        type: buy
                        ordertype: limit
                        price: '30010.00000'
                        cost: '300.10000'
                        fee: '0.00000'
                        vol: '0.01000000'
                        margin: '0.00000'
                        misc: ''
                        trade_id: 39482674
                        maker: true
  /private/QueryTrades:
    post:
      summary: Query Trades Info
      description: >
        Retrieve information about specific trades/fills.


        **API Key Permissions Required:** `Orders and trades - Query closed
        orders & trades`
      tags:
        - Account Data
      operationId: getTradesInfo
      requestBody:
        $ref: '#/components/requestBodies/query'
      responses:
        '200':
          description: Trades info retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    description: Trade info
                    type: object
                    additionalProperties:
                      $ref: '#/components/schemas/trade-2'
                  error:
                    type: array
                    items:
                      $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    THVRQM-33VKH-UCI7BS:
                      ordertxid: OQCLML-BW3P3-BUCMWZ
                      postxid: TKH2SE-M7IF5-CFI7LT
                      pair: XXBTZUSD
                      time: 1688667796.8802
                      type: buy
                      ordertype: limit
                      price: '30010.00000'
                      cost: '600.20000'
                      fee: '0.00000'
                      vol: '0.02000000'
                      margin: '0.00000'
                      misc: ''
                      trade_id: 93748276
                      maker: true
                    TTEUX3-HDAAA-RC2RUO:
                      ordertxid: OH76VO-UKWAD-PSBDX6
                      postxid: TKH2SE-M7IF5-CFI7LT
                      pair: XXBTZEUR
                      time: 1688082549.3138
                      type: buy
                      ordertype: limit
                      price: '27732.00000'
                      cost: '0.20020'
                      fee: '0.00000'
                      vol: '0.00020000'
                      margin: '0.00000'
                      misc: ''
                      trade_id: 74625834
                      maker: true
  /private/OpenPositions:
    post:
      summary: Get Open Positions
      description: >
        Get information about open margin positions.


        **API Key Permissions Required:** `Orders and trades - Query open orders
        & trades`
      tags:
        - Account Data
      operationId: getOpenPositions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                txid:
                  type: string
                  description: Comma delimited list of txids to limit output to
                docalcs:
                  type: boolean
                  description: Whether to include P&L calculations
                  default: false
                consolidation:
                  type: string
                  description: Consolidate positions by market/pair
                  enum:
                    - market
                rebase_multiplier:
                  $ref: '#/components/schemas/rebase_multiplier'
            examples:
              get Open Position:
                value:
                  nonce: 1695828490
                  docalcs: false
                  consolidation: market
                  txid: STMH53C-C54CG-4SO42I, ST4USDQ-ZQBMB-FGET2G
      responses:
        '200':
          description: Open positions info retrieved.
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: object
                    additionalProperties:
                      x-additionalPropertiesName: txid
                      title: txid
                      type: object
                      properties:
                        ordertxid:
                          type: string
                          description: Order ID responsible for the position
                        class:
                          type: string
                          description: Asset class of the position
                        posstatus:
                          type: string
                          description: Position status
                          enum:
                            - open
                        pair:
                          type: string
                          description: Asset pair
                        time:
                          type: number
                          description: Unix timestamp of trade
                        type:
                          type: string
                          description: Direction (buy/sell) of position
                        ordertype:
                          type: string
                          description: Order type used to open position
                        cost:
                          type: string
                          description: Opening cost of position (in quote currency)
                        fee:
                          type: string
                          description: Opening fee of position (in quote currency)
                        vol:
                          type: string
                          description: Position opening size (in base currency)
                        vol_closed:
                          type: string
                          description: Quantity closed (in base currency)
                        margin:
                          type: string
                          description: Initial margin consumed (in quote currency)
                        value:
                          type: string
                          description: >-
                            Current value of remaining position (if `docalcs`
                            requested)
                        net:
                          type: string
                          description: >-
                            Unrealised P&L of remaining position (if `docalcs`
                            requested)
                        terms:
                          type: string
                          description: Funding cost and term of position
                        rollovertm:
                          type: string
                          description: Timestamp of next margin rollover fee
                        misc:
                          type: string
                          description: Comma delimited list of add'l info
                        oflags:
                          type: string
                          description: Comma delimited list of opening order flags
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    TF5GVO-T7ZZ2-6NBKBI:
                      ordertxid: OLWNFG-LLH4R-D6SFFP
                      posstatus: open
                      pair: XXBTZUSD
                      time: 1605280097.8294
                      type: buy
                      ordertype: limit
                      cost: '104610.52842'
                      fee: '289.06565'
                      vol: '8.82412861'
                      vol_closed: '0.20200000'
                      margin: '20922.10568'
                      value: '258797.5'
                      net: '+154186.9728'
                      terms: 0.0100% per 4 hours
                      rollovertm: '1616672637'
                      misc: ''
                      oflags: ''
                    T24DOR-TAFLM-ID3NYP:
                      ordertxid: OIVYGZ-M5EHU-ZRUQXX
                      posstatus: open
                      pair: XXBTZUSD
                      time: 1607943827.3172
                      type: buy
                      ordertype: limit
                      cost: '145756.76856'
                      fee: '335.24057'
                      vol: '8.00000000'
                      vol_closed: '0.00000000'
                      margin: '29151.35371'
                      value: '240124.0'
                      net: '+94367.2314'
                      terms: 0.0100% per 4 hours
                      rollovertm: '1616672637'
                      misc: ''
                      oflags: ''
                    TYMRFG-URRG5-2ZTQSD:
                      ordertxid: OF5WFH-V57DP-QANDAC
                      posstatus: open
                      pair: XXBTZUSD
                      time: 1610448039.8374
                      type: buy
                      ordertype: limit
                      cost: '0.00240'
                      fee: '0.00000'
                      vol: '0.00000010'
                      vol_closed: '0.00000000'
                      margin: '0.00048'
                      value: '0'
                      net: '+0.0006'
                      terms: 0.0100% per 4 hours
                      rollovertm: '1616672637'
                      misc: ''
                      oflags: ''
                    TAFGBN-TZNFC-7CCYIM:
                      ordertxid: OF5WFH-V57DP-QANDAC
                      posstatus: open
                      pair: XXBTZUSD
                      time: 1610448039.8448
                      type: buy
                      ordertype: limit
                      cost: '2.40000'
                      fee: '0.00264'
                      vol: '0.00010000'
                      vol_closed: '0.00000000'
                      margin: '0.48000'
                      value: '3.0'
                      net: '+0.6015'
                      terms: 0.0100% per 4 hours
                      rollovertm: '1616672637'
                      misc: ''
                      oflags: ''
                    T4O5L3-4VGS4-IRU2UL:
                      ordertxid: OF5WFH-V57DP-QANDAC
                      posstatus: open
                      pair: XXBTZUSD
                      time: 1610448040.7722
                      type: buy
                      ordertype: limit
                      cost: '21.59760'
                      fee: '0.02376'
                      vol: '0.00089990'
                      vol_closed: '0.00000000'
                      margin: '4.31952'
                      value: '27.0'
                      net: '+5.4133'
                      terms: 0.0100% per 4 hours
                      rollovertm: '1616672637'
                      misc: ''
                      oflags: ''
  /private/Ledgers:
    post:
      summary: Get Ledgers Info
      description: >
        Retrieve information about ledger entries. 50 results are returned at a
        time, the most recent by default.


        > **Note on Staking/Earn assets:** We have begun to migrate assets from
        our legacy Staking system over to a new Earn system. As such, the
        following assets may appear in your balances and ledger. Please see our
        [Support
        article](https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-)
        for more details. Note that these assets are "read-only", to interact
        with your balances in them please use the base asset (e.g. `USDT` to
        transact with your `USDT` and `USDT.F` balances).

        > * `.B`, which represents balances in new yield-bearing products,
        similar to `.S` (staked) and `.M` (opt-in rewards) balances

        > * `.F`, which represents balances earning automatically in Kraken
        Rewards


        **API Key Permissions Required:** `Data - Query ledger entries`
      tags:
        - Account Data
      operationId: getLedgers
      requestBody:
        $ref: '#/components/requestBodies/info'
      responses:
        '200':
          description: Ledgers info retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/info-3'
                example:
                  error: []
                  result:
                    ledger:
                      L4UESK-KG3EQ-UFO4T5:
                        refid: TJKLXF-PGMUI-4NTLXU
                        time: 1688464484.1787
                        type: trade
                        subtype: ''
                        aclass: currency
                        asset: ZGBP
                        amount: '-24.5000'
                        fee: '0.0490'
                        balance: '459567.9171'
                      LMKZCZ-Z3GVL-CXKK4H:
                        refid: TBZIP2-F6QOU-TMB6FY
                        time: 1688444262.8888
                        type: trade
                        subtype: ''
                        aclass: currency
                        asset: ZUSD
                        amount: '0.9852'
                        fee: '0.0010'
                        balance: '52732.1132'
                    count: 2
  /private/QueryLedgers:
    post:
      summary: Query Ledgers
      description: >
        Retrieve information about specific ledger entries. 


        > **Note on Staking/Earn assets:** We have begun to migrate assets from
        our legacy Staking system over to a new Earn system. As such, the
        following assets may appear in your balances and ledger. Please see our
        [Support
        article](https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-)
        for more details. Note that these assets are "read-only", to interact
        with your balances in them please use the base asset (e.g. `USDT` to
        transact with your `USDT` and `USDT.F` balances).

        > * `.B`, which represents balances in new yield-bearing products,
        similar to `.S` (staked) and `.M` (opt-in rewards) balances

        > * `.F`, which represents balances earning automatically in Kraken
        Rewards


        **API Key Permissions Required:** `Data - Query ledger entries`
      tags:
        - Account Data
      operationId: getLedgersInfo
      requestBody:
        $ref: '#/components/requestBodies/query-2'
      responses:
        '200':
          description: Ledgers info retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/query-3'
                example:
                  error: []
                  result:
                    L4UESK-KG3EQ-UFO4T5:
                      refid: TJKLXF-PGMUI-4NTLXU
                      time: 1688464484.1787
                      type: trade
                      subtype: ''
                      aclass: currency
                      asset: ZGBP
                      amount: '-24.5000'
                      fee: '0.0490'
                      balance: '459567.9171'
  /private/TradeVolume:
    post:
      summary: Get Trade Volume
      description: >
        Returns 30 day USD trading volume and resulting fee schedule for any
        asset pair(s) provided. Fees will not be included if `pair` is not
        specified as Kraken fees differ by asset pair.

        Note: If an asset pair is on a maker/taker fee schedule, the taker side
        is given in `fees` and maker side in `fees_maker`. For pairs not on
        maker/taker, they will only be given in `fees`.


        `pair` accepts either a comma-delimited list of pair names or a list of
        `{ asset, aclass }` objects (the latter is required for non-forex
        classes such as `derivatives` or `equity_pair`). Set `fee_schedule` to
        `true` to additionally receive the full fee schedule per trading pair in
        the `schedules` field.


        **API Key Permissions Required:** `Funds permissions - Query`
      tags:
        - Account Data
      operationId: getTradeVolume
      requestBody:
        $ref: '#/components/requestBodies/volume'
      responses:
        '200':
          description: Trade Volume retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/volume'
                example:
                  error: []
                  result:
                    currency: ZUSD
                    asset_class: currency
                    volume: '200709587.4223'
                    inputs:
                      domain_spot_volume_30d: '200709587.4223'
                      domain_futures_volume_30d: '0.0000'
                      domain_assets_on_platform: '0.0000'
                    fees:
                      XXBTZUSD:
                        fee: '0.1000'
                        minfee: '0.1000'
                        maxfee: '0.2600'
                        nextfee: null
                        tiervolume: '10000000.0000'
                        nextvolume: null
                    fees_maker:
                      XXBTZUSD:
                        fee: '0.0000'
                        minfee: '0.0000'
                        maxfee: '0.1600'
                        nextfee: null
                        tiervolume: '10000000.0000'
                        nextvolume: null
  /private/AddExport:
    post:
      summary: Request Export Report
      description: |
        Request export of trades or ledgers.

        **API Key Permissions Required:** `Data - Export data`
      tags:
        - Account Data
      operationId: addExport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - report
                - description
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                report:
                  type: string
                  description: Type of data to export
                  enum:
                    - trades
                    - ledgers
                format:
                  type: string
                  description: File format to export
                  enum:
                    - CSV
                    - TSV
                  default: CSV
                description:
                  type: string
                  description: Description for the export
                fields:
                  type: string
                  default: all
                  description: >
                    Comma-delimited list of fields to include


                    * `trades`: `ordertxid`, `time`, `ordertype`, `price`,
                    `cost`, `fee`, `vol`, `margin`, `misc`, `ledgers`

                    * `ledgers`: `refid`, `time`, `type`, `subtype`, `aclass`,
                    `asset`, `amount`, `fee`, `balance`, `wallet`
                starttm:
                  type: integer
                  description: >-
                    UNIX timestamp for report start time (default 1st of the
                    current month)
                endtm:
                  type: integer
                  description: UNIX timestamp for report end time (default now)
              example:
                nonce: 1695828490
                report: trades
                description: yearly report
                format: CSV
                starttm: 1695728276
                endtm: 1695828276
      responses:
        '200':
          description: Export request made
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Report ID
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    id: TCJA
  /private/ExportStatus:
    post:
      summary: Get Export Report Status
      description: |
        Get status of requested data exports.

        **API Key Permissions Required:** `Data - Export data`
      tags:
        - Account Data
      operationId: exportStatus
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - report
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                report:
                  type: string
                  description: Type of reports to inquire about
                  enum:
                    - trades
                    - ledgers
              example:
                nonce: 1695828490
                report: trades
      responses:
        '200':
          description: Export status retrieved
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Report ID
                        descr:
                          type: string
                        format:
                          type: string
                        report:
                          type: string
                        subtype:
                          type: string
                        status:
                          type: string
                          description: Status of the report
                          enum:
                            - Queued
                            - Processing
                            - Processed
                        error:
                          type: string
                          description: Error of the report
                          enum:
                            - EExport:Internal error
                            - EExport:Unexpected error
                            - EExport:Canceled
                            - EExport:Deleted
                            - EExport:Exported size too big
                        flags:
                          type: string
                          deprecated: true
                        fields:
                          type: string
                        createdtm:
                          type: string
                          description: UNIX timestamp of report request
                        expiretm:
                          type: string
                          deprecated: true
                        starttm:
                          type: string
                          description: UNIX timestamp report processing began
                        completedtm:
                          type: string
                          description: UNIX timestamp report processing finished
                        datastarttm:
                          type: string
                          description: UNIX timestamp of the report data start time
                        dataendtm:
                          type: string
                          description: UNIX timestamp of the report data end time
                        aclass:
                          type: string
                          deprecated: true
                        asset:
                          type: string
                        asset_classes:
                          type: array
                          description: Asset classes included in the report
                          items:
                            type: string
                        endtm:
                          type: string
                          description: UNIX timestamp of the report end time
                        delete:
                          type: boolean
                          description: Whether the report is pending deletion
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    - id: VSKC
                      descr: my_trades_1
                      format: CSV
                      report: trades
                      subtype: all
                      status: Processed
                      flags: '0'
                      fields: all
                      createdtm: '1688669085'
                      expiretm: '1688878685'
                      starttm: '1688669093'
                      completedtm: '1688669093'
                      datastarttm: '1683556800'
                      dataendtm: '1688669085'
                      aclass: forex
                      asset: all
                    - id: TCJA
                      descr: my_trades_1
                      format: CSV
                      report: trades
                      subtype: all
                      status: Processed
                      flags: '0'
                      fields: all
                      createdtm: '1688363637'
                      expiretm: '1688573237'
                      starttm: '1688363664'
                      completedtm: '1688363664'
                      datastarttm: '1683235200'
                      dataendtm: '1688363637'
                      aclass: forex
                      asset: all
  /private/RetrieveExport:
    post:
      summary: Retrieve Data Export
      description: |
        Retrieve a processed data export 

        **API Key Permissions Required:** `Data - Export data`
      tags:
        - Account Data
      operationId: retrieveExport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - id
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                id:
                  type: string
                  description: Report ID to retrieve
              example:
                nonce: 1695828490
                id: '1234556'
      responses:
        '200':
          description: Data export report retrieved
          content:
            application/octet-stream:
              schema:
                properties:
                  report:
                    type: string
                    format: binary
                    description: Binary zip archive containing the report
  /private/RemoveExport:
    post:
      summary: Delete Export Report
      description: |
        Delete exported trades/ledgers report

        **API Key Permissions Required:** `Data - Export data`
      tags:
        - Account Data
      operationId: removeExport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - id
                - type
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                id:
                  type: string
                  description: ID of report to delete or cancel
                type:
                  type: string
                  description: >
                    `delete` can only be used for reports that have already been
                    processed. Use `cancel` for queued or processing reports.
                  enum:
                    - cancel
                    - delete
              example:
                nonce: 1695828490
                id: '1234556'
                type: cancel
      responses:
        '200':
          description: Export report deleted or cancelled
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: object
                    properties:
                      delete:
                        type: boolean
                        description: Whether deletion was successful
                      cancel:
                        type: boolean
                        description: Whether cancellation was successful
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    delete: true
  /private/GetApiKeyInfo:
    post:
      summary: Get API Key Info
      description: >
        Retrieve information about the API key that is used to make the request,
        including its name, permissions, restrictions, and usage timestamps.


        **API Key Permissions Required:** `None`
      tags:
        - Account Data
      operationId: getApiKeyInfo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                otp:
                  type: string
                  description: >-
                    Two-factor authentication password (required only if 2FA is
                    configured for the API key)
              required:
                - nonce
      responses:
        '200':
          description: API key information retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    title: ApiKeyInfo
                    description: API Key Information
                    type: object
                    properties:
                      apiKeyName:
                        type: string
                        description: Name/label assigned to the API key
                      apiKey:
                        type: string
                        description: The API key string
                      nonce:
                        type: string
                        description: Current nonce value for the API key
                      nonceWindow:
                        type: integer
                        format: int64
                        description: Custom nonce window value (0 if not configured)
                      permissions:
                        type: array
                        items:
                          type: string
                        description: >
                          List of permissions assigned to the API key. Values
                          correspond to the API Key permission settings:


                          | Value | API Key Permission |

                          |---|---|

                          | `query-funds` | Funds permissions - Query |

                          | `add-funds` | Funds permissions - Deposit |

                          | `withdraw-funds` | Funds permissions - Withdraw |

                          | `earn-funds` | Funds permissions - Earn |

                          | `query-open-trades` | Orders and trades - Query open
                          orders & trades |

                          | `query-closed-trades` | Orders and trades - Query
                          closed orders & trades |

                          | `modify-trades` | Orders and trades - Create &
                          modify orders |

                          | `close-trades` | Orders and trades - Cancel & close
                          orders |

                          | `query-ledger` | Data - Query ledger entries |

                          | `export-data` | Data - Export data |

                          | `create-ws-token` | WebSocket interface - On |

                          | `add-withdraw-address` | Add withdrawal addresses |

                          | `update-withdraw-address` | Update withdrawal
                          addresses |
                      iban:
                        type: string
                        description: >-
                          IIBAN (Internal IBAN) of the account associated with
                          the API key
                      validUntil:
                        type: string
                        description: Unix timestamp for key expiration (0 if not set)
                      queryFrom:
                        type: string
                        description: >-
                          Unix timestamp for earliest allowed query date (0 if
                          not set)
                      queryTo:
                        type: string
                        description: >-
                          Unix timestamp for latest allowed query date (0 if not
                          set)
                      createdTime:
                        type: string
                        description: Unix timestamp of when the API key was created
                      modifiedTime:
                        type: string
                        description: Unix timestamp of when the API key was last modified
                      ipAllowlist:
                        type: array
                        items:
                          type: string
                        description: >-
                          List of IP addresses or ranges allowed to use this API
                          key (empty if not restricted)
                      lastUsed:
                        type: string
                        nullable: true
                        description: >-
                          Unix timestamp of when the API key was last used (null
                          if never used)
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    apiKeyName: my-api-key
                    apiKey: 4/SDrDBcOOPnm3nPlNfEMMJDeRcIVqPz+QhRxIodyZbI9po/aVRiHsgX
                    nonce: '1772627060997'
                    nonceWindow: 0
                    permissions:
                      - query-funds
                      - withdraw-funds
                      - query-open-trades
                      - modify-trades
                    iban: AA88 N84G WOAK NMOI
                    validUntil: '0'
                    queryFrom: '0'
                    queryTo: '0'
                    createdTime: '1772542900'
                    modifiedTime: '1772543095'
                    ipAllowlist: []
                    lastUsed: '1772627061'
  /private/AddOrder:
    post:
      summary: Add Order
      description: >
        Place a new order.


        **Note**: See the [AssetPairs](/docs/rest-api/get-tradable-asset-pairs)
        endpoint for details on the available trading pairs, their price and
        quantity precisions, order minimums, available leverage, etc.


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders`
      tags:
        - Trading
      operationId: addOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add'
      responses:
        '200':
          description: Order added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add-2'
              examples:
                Limit with conditional stop-loss:
                  value:
                    error: []
                    result:
                      descr:
                        order: >-
                          buy 2.12340000 XBTUSD @ limit 25000.1 with 2:1
                          leverage
                        close: close position @ stop loss 22000.0 -> limit 21000.0
                      txid:
                        - OUF4EM-FRGI2-MQMWZD
  /private/AmendOrder:
    post:
      summary: Amend Order
      description: >
        The amend request enables clients to modify the order parameters
        in-place without the need to cancel the existing order and create a new
        one.


        * The order identifiers assigned by Kraken and/or client will stay the
        same.

        * Queue priority in the order book will be maintained where possible. 

        * If an amend request will reduce the order quantity below the existing
        filled quantity, the remaining quantity will be cancelled.


        For more detail, see [amend transaction
        guide](/docs/guides/spot-amends).


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders` or `Orders and trades - Cancel & close orders`
      tags:
        - Trading
      operationId: amendOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/amend'
      responses:
        '200':
          description: >
            A successful amend request will return the unique Kraken amend
            identifier.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/amend-2'
  /private/CancelOrder:
    post:
      summary: Cancel Order
      description: >
        Cancel a particular open order (or set of open orders) by `txid`,
        `userref` or `cl_ord_id`


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders` or `Orders and trades - Cancel & close orders`
      tags:
        - Trading
      operationId: cancelOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/cancel'
      responses:
        '200':
          description: Open order cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cancel-2'
  /private/CancelAll:
    post:
      summary: Cancel All Orders
      description: >
        Cancel all open orders


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders` or `Orders and trades - Cancel & close orders`
      tags:
        - Trading
      operationId: cancelAllOrders
      requestBody:
        $ref: '#/components/requestBodies/nonceOnly'
      responses:
        '200':
          description: Open orders cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cancel-2'
  /private/CancelAllOrdersAfter:
    post:
      summary: Cancel All Orders After X
      tags:
        - Trading
      operationId: cancelAllOrdersAfter
      description: >
        CancelAllOrdersAfter provides a "Dead Man's Switch" mechanism to protect
        the client from network malfunction, extreme latency or unexpected
        matching engine downtime. The client can send a request with a timeout
        (in seconds), that will start a countdown timer which will cancel *all*
        client orders when the timer expires. The client has to keep sending new
        requests to push back the trigger time, or deactivate the mechanism by
        specifying a timeout of 0. If the timer expires, all orders are
        cancelled and then the timer remains disabled until the client provides
        a new (non-zero) timeout.


        The recommended use is to make a call every 15 to 30 seconds, providing
        a timeout of 60 seconds. This allows the client to keep the orders in
        place in case of a brief disconnection or transient delay, while keeping
        them safe in case of a network breakdown. It is also recommended to
        disable the timer ahead of regularly scheduled trading engine
        maintenance (if the timer is enabled, all orders will be cancelled when
        the trading engine comes back from downtime - planned or otherwise).


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders` or `Orders and trades - Cancel & close orders`
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - timeout
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                timeout:
                  type: integer
                  description: >-
                    Duration (in seconds) to set/extend the timer, it should be
                    less than 86400 seconds.
              example:
                nonce: 1695828490
                timeout: 120
      responses:
        '200':
          description: Dead man's switch timer reset or disabled.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      currentTime:
                        description: >-
                          Timestamp (RFC3339 format) at which the request was
                          received
                        type: string
                      triggerTime:
                        description: >-
                          Timestamp (RFC3339 format) after which all orders will
                          be cancelled, unless the timer is extended or disabled
                        type: string
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    currentTime: '2023-03-24T17:41:56Z'
                    triggerTime: '2023-03-24T17:42:56Z'
  /private/GetWebSocketsToken:
    post:
      summary: Get Websockets Token
      description: >
        An authentication token must be requested via this REST API endpoint in
        order to connect to and authenticate with our [Websockets
        API](../guides/spot-ws-auth). The token should be used within 15 minutes
        of creation, but it does not expire once a successful Websockets
        connection and private subscription has been made and is maintained.


        **API Key Permissions Required:** `WebSocket interface - On`
      tags:
        - Trading
      operationId: getWebsocketsToken
      requestBody:
        $ref: '#/components/requestBodies/nonceOnly'
      responses:
        '200':
          description: Websockets token retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      token:
                        description: Websockets token
                        type: string
                      expires:
                        description: Time (in seconds) after which the token expires
                        type: integer
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    token: 1Dwc4lzSwNWOAwkMdqhssNNFhs1ed606d1WcF3XfEMw
                    expires: 900
  /private/AddOrderBatch:
    post:
      summary: Add Order Batch
      description: >
        Sends a collection of orders (minimum of 2 and maximum 15): 

        * Validation is performed on the whole batch prior to submission to the
        engine. If an order fails validation, the whole batch will be rejected.

        * On submission to the engine, if an order fails pre-match checks (i.e.
        funding), then the individual order will be rejected and remainder of
        the batch will be processed. 

        * All orders in batch are limited to a single pair.


        **Note**: See the [AssetPairs](/docs/rest-api/get-tradable-asset-pairs)
        endpoint for details on the available trading pairs, their price and
        quantity precisions, order minimums, available leverage, etc.


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders` and `Orders and trades - Cancel & close orders`
      tags:
        - Trading
      operationId: addOrderBatch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/batchadd'
      responses:
        '200':
          description: >-
            The order of returned `orders` in the response array is the same as
            the order of the order list sent in request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/batchadd-2'
              examples:
                Limits, one with conditional stop-loss:
                  value:
                    error: []
                    result:
                      orders:
                        - txid: O5OR23-ADFAD-Y2G61C
                          descr:
                            order: buy 0.80300000 XBTUSD @ limit 28300.0
                            close: >-
                              close position @ stop loss 27000.0 -> limit
                              26000.0
                        - txid: 9K6KFS-5H3PL-XBRC7A
                          descr:
                            order: sell 0.10500000 XBTUSD @ limit 36000.0
  /private/CancelOrderBatch:
    post:
      summary: Cancel Order Batch
      description: >
        Cancel multiple open orders  by `txid`, `userref` or `cl_ord_id`(maximum
        50 total unique IDs/references)


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders` or `Orders and trades - Cancel & close orders`
      tags:
        - Trading
      operationId: cancelOrderBatch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/batchcancel'
      responses:
        '200':
          description: Open order cancelled.
          content:
            application/json:
              example:
                error: []
                result:
                  count: 2
  /private/EditOrder:
    post:
      summary: Edit Order
      description: >
        Sends a request to edit the order parameters of a live order. When an
        order has been successfully modified, the original order will be
        cancelled and a new order will be 

        created with the adjusted parameters a new `txid` will be returned in
        the response.


        **Note:** The new [AmendOrder](/exchange/guides/general/amends) endpoint
        resolves the caveats listed below and has additional performance gains.


        Caveats for `EditOrder`:

        * Triggered stop loss or take profit orders are not supported.

        * Orders with conditional close terms attached are not supported.

        * Orders where the executed volume is greater than the newly supplied
        volume will be rejected.

        * `cl_ord_id` is not supported.

        * Existing executions are associated with the original order and not
        copied to the amended order.

        * Queue position will not be maintained.


        **API Key Permissions Required:** `Orders and trades - Create & modify
        orders` and `Orders and trades - Cancel & close orders`
      tags:
        - Trading
      operationId: editOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/edit'
      responses:
        '200':
          description: Order edited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edit-2'
              examples:
                Limit with conditional stop-loss:
                  value:
                    error: []
                    result:
                      status: ok
                      txid: OFVXHJ-KPQ3B-VS7ELA
                      originaltxid: OHYO67-6LP66-HMQ437
                      volume: '0.00030000'
                      price: '19500.0'
                      price2: '32500.0'
                      orders_cancelled: 1
                      descr:
                        order: buy 0.00030000 XXBTZGBP @ limit 19500.0
  /private/DepositMethods:
    post:
      summary: Get Deposit Methods
      description: >
        Retrieve methods available for depositing a particular asset.


        **API Key Permissions Required:** `Funds permissions - Query` and `Funds
        permissions - Deposit`
      tags:
        - Funding
      operationId: getDepositMethods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/methods'
      responses:
        '200':
          description: Deposit methods retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/methods-2'
  /private/DepositAddresses:
    post:
      summary: Get Deposit Addresses
      description: >
        Retrieve (or generate a new) deposit addresses for a particular asset
        and method.


        **API Key Permissions Required:** `Funds permissions - Query`
      tags:
        - Funding
      operationId: getDepositAddresses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/addresses'
      responses:
        '200':
          description: Deposit addresses retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/addresses-2'
  /private/DepositStatus:
    post:
      summary: Get Status of Recent Deposits
      description: >
        Retrieve information about recent deposits. Results are sorted by
        recency, use the `cursor` parameter to iterate through list of deposits
        (page size equal to value of `limit`) from newest to oldest.

        **API Key Permissions Required:** `Funds permissions - Query`
      tags:
        - Funding
      operationId: getStatusRecentDeposits
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/recent'
      responses:
        '200':
          description: Recent deposits retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/recent-2'
  /private/WithdrawMethods:
    post:
      summary: Get Withdrawal Methods
      description: >
        Retrieve a list of withdrawal methods available for the user.


        **API Key Permissions Required:** `Funds permissions - Query` and `Funds
        permissions - Withdraw`
      tags:
        - Funding
      operationId: getWithdrawalMethods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/methods-3'
      responses:
        '200':
          description: Withdrawal methods retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/methods-4'
  /private/WithdrawAddresses:
    post:
      summary: Get Withdrawal Addresses
      description: >
        Retrieve a list of withdrawal addresses available for the user.


        **API Key Permissions Required:** `Funds permissions - Query` and `Funds
        permissions - Withdraw`
      tags:
        - Funding
      operationId: getWithdrawalAddresses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/addresses-3'
      responses:
        '200':
          description: Withdrawal addresses retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/addresses-4'
  /private/WithdrawInfo:
    post:
      summary: Get Withdrawal Information
      description: >
        Retrieve fee information about potential withdrawals for a particular
        asset, key and amount.


        **API Key Permissions Required:** `Funds permissions - Query` and `Funds
        permissions - Withdraw`
      tags:
        - Funding
      operationId: getWithdrawalInformation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/info-4'
      responses:
        '200':
          description: Withdrawal information retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/info-5'
  /private/Withdraw:
    post:
      summary: Withdraw Funds
      description: |
        Make a withdrawal request.    

        **API Key Permissions Required:** `Funds permissions - Withdraw`
      tags:
        - Funding
      operationId: withdrawFunds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/withdrawal'
      responses:
        '200':
          description: Withdrawal created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/withdrawal-2'
  /private/WithdrawStatus:
    post:
      summary: Get Status of Recent Withdrawals
      description: >
        Retrieve information about recent withdrawals. Results are sorted by
        recency, use the `cursor` parameter to iterate through list of
        withdrawals (page size equal to value of `limit`) from newest to oldest.


        **API Key Permissions Required:** `Funds permissions - Withdraw` or
        `Data - Query ledger entries`
      tags:
        - Funding
      operationId: getStatusRecentWithdrawals
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/recent-3'
      responses:
        '200':
          description: Recent withdrawals retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/recent-4'
  /private/WithdrawCancel:
    post:
      summary: Request Withdrawal Cancellation
      description: >
        Cancel a recently requested withdrawal, if it has not already been
        successfully processed.


        **API Key Permissions Required:** `Funds permissions - Withdraw`, unless
        withdrawal is a `WalletTransfer`, then no permissions are required.
      tags:
        - Funding
      operationId: cancelWithdrawal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/cancel-3'
      responses:
        '200':
          description: Withdrawal cancellation requested.
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: boolean
                    description: Whether cancellation was successful or not.
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result: true
  /private/WalletTransfer:
    post:
      summary: Request Wallet Transfer
      description: >
        Transfer from a Kraken spot wallet to a Kraken Futures wallet. Note that
        a transfer in the other direction must be requested via the Kraken
        Futures API endpoint for [withdrawals to Spot
        wallets](../futures-api/trading/withdrawal).


        **API Key Permissions Required:** `Funds permissions - Query`
      tags:
        - Funding
      operationId: walletTransfer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - asset
                - from
                - to
                - amount
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                asset:
                  type: string
                  description: Asset to transfer (asset ID or `altname`)
                  example: XBT
                from:
                  type: string
                  description: Source wallet
                  enum:
                    - Spot Wallet
                to:
                  type: string
                  description: Destination wallet
                  enum:
                    - Futures Wallet
                amount:
                  type: string
                  description: Amount to transfer
              example:
                nonce: 1695828271
                asset: XBT
                from: Spot Wallet
                to: Futures Wallet
                amount: '2.54'
      responses:
        '200':
          description: Transfer created.
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: object
                    properties:
                      refid:
                        type: string
                        description: Reference ID
                        example: FTQcuak-V6Za8qrWnhzTx67yYHz8Tg
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    refid: FTQcuak-V6Za8qrWnhzTx67yYHz8Tg
  /private/CreateSubaccount:
    post:
      summary: Create Subaccount
      description: >
        Create a trading subaccount. **Note:** `CreateSubaccount` must be called
        using an API key from the master account.


        **API Key Permissions Required:** `Funds permissions - Withdraw`
      tags:
        - Subaccounts
      operationId: createSubaccount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - email
                - username
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                username:
                  type: string
                  description: Username for the subaccount
                email:
                  type: string
                  description: Email address for the subaccount
              example:
                nonce: 1695828271
                username: abc123
                email: abc123@gmail.com
      responses:
        '200':
          description: Subaccount created.
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: boolean
                    description: Whether subaccount creation was successful or not.
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result: true
  /private/AccountTransfer:
    post:
      summary: Account Transfer
      description: >
        Transfer funds to and from master and subaccounts. **Note:**
        `AccountTransfer` must be called using an API key from the master
        account.


        **API Key Permissions Required:** `Funds permissions - Withdraw`
      tags:
        - Subaccounts
      operationId: accountTransfer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - nonce
                - asset
                - amount
                - from
                - to
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                asset:
                  type: string
                  description: Asset being transferred
                asset_class:
                  description: Specify the asset class of the asset being transferred
                  type: string
                  enum:
                    - currency
                    - tokenized_asset
                  default: currency
                amount:
                  type: string
                  description: Amount of asset to transfer
                from:
                  type: string
                  description: >-
                    Public account ID of the source account (Example ABCD 1234
                    EFGH 5678)
                to:
                  type: string
                  description: >-
                    Public account ID of the destination account (Example ABCD
                    1234 EFGH 5678)
              example:
                nonce: 1695828271
                asset: XBT
                from: ABCD 1234 EFGH 5678
                to: IJKL 0987 MNOP 6543
                amount: '2.54'
      responses:
        '200':
          description: Funds transferred between accounts.
          content:
            application/json:
              schema:
                properties:
                  result:
                    type: object
                    properties:
                      transfer_id:
                        type: string
                        description: Transfer ID
                      status:
                        type: string
                        description: Transfer status, either `"pending"` or `"complete"`
                  error:
                    $ref: '#/components/schemas/error'
                example:
                  error: []
                  result:
                    transfer_id: TOH3AS2-LPCWR8-JDQGEU
                    status: complete
  /private/Earn/Allocate:
    post:
      tags:
        - Earn
      summary: Allocate Earn Funds
      description: >-
        Allocate funds to the Strategy.


        Requires the `Earn Funds` API key permission.

        The amount must always be defined.


        This method is asynchronous. A couple of preflight checks are

        performed synchronously on behalf of the method before it is dispatched

        further. The client is required to poll

        the result using the `/0/private/Earn/AllocateStatus` endpoint.


        There can be only one (de)allocation request in progress for given user
        and

        strategy at any time. While the operation is in progress:


        1. `pending` attribute in `/Earn/Allocations` response for the strategy
          indicates that funds are being allocated,
        2. `pending` attribute in `/Earn/AllocateStatus` response will be true.


        Following specific errors within `Earnings` class can be returned by
        this

        method:

        - Minimum allocation: `EEarnings:Below min:(De)allocation operation
        amount less than minimum`

        - Allocation in progress: `EEarnings:Busy:Another (de)allocation for the
        same strategy is in progress`

        - Service temporarily unavailable: `EEarnings:Busy`. Try again in a few
        minutes.

        - User tier verification: `EEarnings:Permission denied:The user's tier
        is not high enough`

        - Strategy not found: `EGeneral:Invalid arguments:Invalid strategy ID`
      operationId: allocateStrategy
      requestBody:
        content:
          application/json:
            schema:
              description: Allocation amount in asset specified in the strategy
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                amount:
                  description: The amount to allocate.
                  type: string
                strategy_id:
                  description: >-
                    A unique identifier of the chosen earn strategy, as returned
                    from `/0/private/Earn/Strategies`.
                  type: string
              required:
                - amount
                - nonce
                - strategy_id
              example:
                amount: '4.3'
                nonce: 30295839
                strategy_id: ESRFUO3-Q62XD-WIOIL7
        required: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/error'
                  result:
                    description: >-
                      Will return `true` when the operation is successful, null
                      when an error occurred.
                    nullable: true
                    type: boolean
                example:
                  error: []
                  result: true
  /private/Earn/Deallocate:
    post:
      tags:
        - Earn
      summary: Deallocate Earn Funds
      description: >-
        Deallocate funds from a strategy.


        Requires the `Earn Funds` API key permission.

        The amount must always be defined.


        This method is asynchronous. A couple of preflight checks are

        performed synchronously on behalf of the method before it is dispatched

        further. If the method returns HTTP 202 code, the client is required to
        poll

        the result using the `/Earn/DeallocateStatus` endpoint.


        There can be only one (de)allocation request in progress for given user
        and

        strategy.  While the operation is in progress:


        1. `pending` attribute in `Allocations` response for the strategy will
        hold
           the amount that is being deallocated (negative amount)
        2. `pending` attribute in `DeallocateStatus` response will be true.


        Following specific errors within `Earnings` class can be returned by
        this

        method:

        - Minimum allocation: `EEarnings:Below min:(De)allocation operation
        amount less than minimum`
          allowed
        - Allocation in progress: `EEarnings:Busy:Another (de)allocation for the
        same strategy is in progress`

        - Strategy not found: `EGeneral:Invalid arguments:Invalid strategy ID`
      operationId: deallocateStrategy
      requestBody:
        content:
          application/json:
            schema:
              description: Allocation amount in asset specified in the strategy
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                amount:
                  description: The amount to deallocate. This field is required.
                  type: string
                strategy_id:
                  description: A unique identifier per earn strategy.
                  type: string
              required:
                - amount
                - nonce
                - strategy_id
              example:
                amount: '4.3'
                nonce: 30295839
                strategy_id: ESRFUO3-Q62XD-WIOIL7
        required: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/error'
                  result:
                    description: >-
                      Will return `true` when the operation is successful, null
                      when an error occurred.
                    nullable: true
                    type: boolean
                example:
                  error: []
                  result: true
  /private/Earn/AllocateStatus:
    post:
      tags:
        - Earn
      summary: Get Allocation Status
      description: >-
        Get the status of the last allocation request.


        Requires either the `Earn Funds` or `Query Funds` API key permission.


        (De)allocation operations are asynchronous and this endpoint allows
        client

        to retrieve the status of the last dispatched operation. There can be
        only

        one (de)allocation request in progress for given user and strategy.


        The `pending` attribute in the response indicates if the previously

        dispatched operation is still in progress (true) or has successfully

        completed (false).  If the dispatched request failed with an error, then

        HTTP error is returned to the client as if it belonged to the original

        request.


        Following specific errors within `Earnings` class can be returned by
        this

        method:

        - Insufficient funds: `EEarnings:Insufficient funds:Insufficient funds
        to complete the (de)allocation request`

        - User cap exceeded: `EEarnings:Above max:The allocation exceeds user
        limit for the strategy`

        - Total cap exceeded: `EEarnings:Above max:The allocation exceeds the
        total strategy limit`

        - Minimum allocation: `EEarnings:Below min:(De)allocation operation
        amount less than minimum`
      operationId: getAllocateStrategyStatus
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                strategy_id:
                  description: >-
                    ID of the earn strategy, call `Earn/Strategies` to list
                    available strategies
                  type: string
              required:
                - nonce
                - strategy_id
              example:
                nonce: 30295839
                strategy_id: ESRFUO3-Q62XD-WIOIL7
        required: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/error'
                  result:
                    nullable: true
                    description: Status of async earn operation
                    type: object
                    properties:
                      pending:
                        description: >-
                          `true` if an operation is still in progress on the
                          same strategy.
                        type: boolean
                example:
                  error: []
                  result:
                    pending: false
  /private/Earn/DeallocateStatus:
    post:
      tags:
        - Earn
      summary: Get Deallocation Status
      description: >-
        Get the status of the last deallocation request.


        Requires either the `Earn Funds` or `Query Funds` API key permission.


        (De)allocation operations are asynchronous and this endpoint allows
        client

        to retrieve the status of the last dispatched operation. There can be
        only

        one (de)allocation request in progress for given user and strategy.


        The `pending` attribute in the response indicates if the previously

        dispatched operation is still in progress (true) or has successfully

        completed (false).  If the dispatched request failed with an error, then

        HTTP error is returned to the client as if it belonged to the original

        request.


        Following specific errors within `Earnings` class can be returned by
        this

        method:

        - Insufficient funds: `EEarnings:Insufficient funds:Insufficient funds
        to complete the (de)allocation request`

        - Minimum allocation: `EEarnings:Below min:(De)allocation operation
        amount less than minimum`
      operationId: getDeallocateStrategyStatus
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                strategy_id:
                  description: >-
                    ID of the earn strategy, call `Earn/Strategies` to list
                    available strategies
                  type: string
              required:
                - nonce
                - strategy_id
              example:
                nonce: 30295839
                strategy_id: ESRFUO3-Q62XD-WIOIL7
        required: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/error'
                  result:
                    nullable: true
                    description: Status of async earn operation
                    type: object
                    properties:
                      pending:
                        description: >-
                          `true` if an operation is still in progress on the
                          same strategy.
                        type: boolean
                example:
                  error: []
                  result:
                    pending: false
  /private/Earn/Strategies:
    post:
      tags:
        - Earn
      summary: List Earn Strategies
      description: >-
        List earn strategies along with their parameters.


        Requires a valid API key but not specific permission is required.


        Returns only strategies that are available to the user

        based on geographic region.


        When the user does not meet the tier restriction, `can_allocate` will be

        false and `allocation_restriction_info` indicates `Tier` as the
        restriction

        reason. Earn products generally require Intermediate tier. Get your
        account verified

        to access earn.


        A note about `lock_type`:

        - `instant`: can be deallocated without an unbonding period. This is
        called flexible in the UI.

        - `bonded`: has an unbonding period. Deallocation will not happen until
        this period has passed.

        - `flex`: "Kraken rewards". This is earning on your spot balances where
        eligible. It's turned on account wide
          from the UI and you cannot manually allocate to these strategies.

        Paging isn't yet implemented, so the endpoint always returns all

        data in the first page.
      operationId: listStrategies
      requestBody:
        content:
          application/json:
            schema:
              description: List strategies parameters
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                ascending:
                  nullable: true
                  description: >-
                    `true` to sort ascending, `false` (the default) for
                    descending.
                  type: boolean
                asset:
                  nullable: true
                  description: Filter strategies by asset name
                  type: string
                cursor:
                  nullable: true
                  description: None to start at beginning/end, otherwise next page ID
                  type: string
                limit:
                  nullable: true
                  description: >-
                    How many items to return per page. Note that the limit may
                    be cap'd to lower value in the application code.
                  type: integer
                  format: uint16
                lock_type:
                  nullable: true
                  description: Filter strategies by lock type
                  type: array
                  items:
                    description: Type of a strategy
                    type: string
                    enum:
                      - flex
                      - bonded
                      - timed
                      - instant
              required:
                - nonce
              example:
                nonce: 30295839
                asset: DOT
        required: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/error'
                  result:
                    nullable: true
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          description: Parameters for a single strategy
                          type: object
                          properties:
                            allocation_fee:
                              description: Fee applied when allocating to this strategy
                              oneOf:
                                - type: string
                                  title: string
                                - type: integer
                                  title: integer
                                - type: number
                                  title: number
                            allocation_restriction_info:
                              description: >-
                                Reason list why user is not eligible for
                                allocating to the strategy
                              type: array
                              items:
                                description: >-
                                  Recoverable strategy restriction reasons,
                                  which are no preventing strategy from being
                                  returned by [`ListStrategiesResponse`].
                                type: string
                                enum:
                                  - tier
                            apr_estimate:
                              nullable: true
                              description: >-
                                The estimate is based on previous revenues from
                                the strategy. Optional hint, not always present.
                              type: object
                              properties:
                                high:
                                  description: Maximal yield percentage for one year
                                  type: string
                                low:
                                  description: Minimal yield percentage for one year
                                  type: string
                            asset:
                              description: The asset to invest for this earn strategy
                              type: string
                            auto_compound:
                              description: Auto compound choices for the earn strategy
                              oneOf:
                                - title: disabled
                                  description: >-
                                    Auto compound is not possible for any
                                    allocation
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - disabled
                                - title: enabled
                                  description: Auto compound is forced for all allocations
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - enabled
                                - title: optional
                                  description: >-
                                    Auto compound depends on user's preference
                                    and it comes with default value
                                  type: object
                                  properties:
                                    default:
                                      type: boolean
                                    type:
                                      type: string
                                      enum:
                                        - optional
                            can_allocate:
                              description: Is allocation available for this strategy
                              type: boolean
                            can_deallocate:
                              description: Is deallocation available for this strategy
                              type: boolean
                            deallocation_fee:
                              description: Fee applied when deallocating from this strategy
                              oneOf:
                                - type: string
                                  title: string
                                - type: integer
                                  title: integer
                                - type: number
                                  title: number
                            id:
                              description: The unique identifier for this strategy
                              type: string
                            lock_type:
                              description: Type of the strategy
                              oneOf:
                                - title: flex
                                  description: >-
                                    Either the whole asset balance or part of it
                                    is allocated to earn strategy and users are
                                    free to deallocate it anytime and most
                                    importantly the deallocation can be implicit
                                    (triggered by a trade, withdrawal from
                                    exchange, etc.).
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - flex
                                - title: bonded
                                  description: >-
                                    Explicit allocate and deallocate action by
                                    user is required and bonding/unbonding
                                    parameters apply.
                                  type: object
                                  properties:
                                    bonding_period:
                                      description: >-
                                        Duration of the bonding period, in
                                        seconds
                                      type: integer
                                    bonding_period_variable:
                                      description: >-
                                        Is the bonding period length variable
                                        (`true`) or static (`false`)
                                      type: boolean
                                    bonding_rewards:
                                      description: >-
                                        Whether rewards are earned during the
                                        bonding period (payouts occur after
                                        bonding is complete)
                                      type: boolean
                                    exit_queue_period:
                                      description: >-
                                        In order to remove funds, if this value
                                        is greater than 0, funds will first have
                                        to enter an exit queue and will have to
                                        wait for the exit queue period to end.
                                        Once ended, her funds will then follow
                                        and respect the `unbonding_period`.


                                        If the value of the exit queue period is
                                        0, then no waiting will have to occur
                                        and the exit queue will be skipped


                                        Rewards are always paid out for the exit
                                        queue
                                      type: integer
                                    payout_frequency:
                                      description: >-
                                        At what intervals are rewards
                                        distributed and credited to the user's
                                        ledger, in seconds
                                      type: integer
                                    type:
                                      type: string
                                      enum:
                                        - bonded
                                    unbonding_period:
                                      description: >-
                                        Duration of the unbonding period in
                                        seconds. In order to remove funds, you
                                        must wait for the unbonding period to
                                        pass after requesting removal before
                                        funds become available in her spot
                                        wallet
                                      type: integer
                                    unbonding_period_variable:
                                      description: >-
                                        Is the unbonding period length variable
                                        (`true`) or static (`false`)
                                      type: boolean
                                    unbonding_rewards:
                                      description: >-
                                        Whether rewards are earned and payouts
                                        are done during the unbonding period
                                      type: boolean
                                - title: instant
                                  description: >-
                                    Instant strategy lock type is a special case
                                    of bonded strategy with no bonding/unbonding
                                    period. It is equivalent of what used to be
                                    called "flex" in legacy staking system (not
                                    to be confused with Flex defined above).
                                    Explicit allocate/deallocate action is
                                    required.
                                  type: object
                                  properties:
                                    payout_frequency:
                                      description: >-
                                        At what intervals are rewards
                                        distributed and credited to the user's
                                        ledger, in seconds
                                      type: integer
                                    type:
                                      type: string
                                      enum:
                                        - instant
                            user_cap:
                              nullable: true
                              type: string
                              description: >-
                                The maximum amount of funds that any given user
                                may allocate to an account. Absence of value
                                means there is no limit. Zero means that all new
                                allocations will return an error (though
                                auto-compound is unaffected).
                            user_min_allocation:
                              nullable: true
                              type: string
                              description: >-
                                Minimum amount (in USD) for an allocation or
                                deallocation. Absence means no minimum.
                            yield_source:
                              description: Yield generation mechanism of this strategy
                              oneOf:
                                - description: >-
                                    Funds are staked on-chain, PoS is the source
                                    of yield.
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - staking
                                - description: >-
                                    Funds are put at work in another
                                    yield-generation financial mechanism.
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - off_chain
                      next_cursor:
                        nullable: true
                        description: >-
                          index to send into PageRequest for next page, None
                          means you've reached the end.
                        type: string
                example:
                  error: []
                  result:
                    next_cursor: '2'
                    items:
                      - id: ESRFUO3-Q62XD-WIOIL7
                        asset: DOT
                        lock_type:
                          type: instant
                          payout_frequency: 604800
                        apr_estimate:
                          low: '8.0000'
                          high: '12.0000'
                        user_min_allocation: '0.01'
                        allocation_fee: '0.0000'
                        deallocation_fee: '0.0000'
                        auto_compound:
                          type: enabled
                        yield_source:
                          type: staking
                        can_allocate: true
                        can_deallocate: true
                        allocation_restriction_info: []
  /private/Earn/Allocations:
    post:
      tags:
        - Earn
      summary: List Earn Allocations
      description: >-
        List all allocations for the user.


        Requires the `Query Funds` API key permission.


        By default all allocations are returned, even for strategies that have
        been

        used in the past and have zero balance now. That is so that the user can
        see

        how much was earned with given strategy in the past.

        `hide_zero_allocations` parameter can be used to remove zero balance
        entries

        from the output.  Paging hasn't been implemented for this method as we
        don't

        expect the result for a particular user to be overwhelmingly large.


        All amounts in the output can be denominated in a currency of user's
        choice

        (the `converted_asset` parameter).


        Information about when the next reward will be paid to the client is
        also

        provided in the output.


        Allocated funds can be in up to 4 states:

        - bonding

        - allocated

        - exit_queue (ETH only)

        - unbonding


        Any funds in `total` not in `bonding`/`unbonding` are simply allocated
        and

        earning rewards. Depending on the strategy funds in the other 3 states
        can

        also be earning rewards. Consult the output of `/Earn/Strategies` to
        know

        whether `bonding`/`unbonding` earn rewards. `ETH` in `exit_queue` still

        earns rewards.


        Note that for `ETH`, when the funds are in the `exit_queue` state, the

        `expires` time given is the time when the funds will have finished

        unbonding, not when they go from exit queue to unbonding.


        (Un)bonding time estimate can be inaccurate right after having
        (de)allocated the

        funds. Wait 1-2 minutes after (de)allocating to get an accurate result.
      operationId: listAllocations
      requestBody:
        content:
          application/json:
            schema:
              description: Page request
              type: object
              properties:
                nonce:
                  $ref: '#/components/schemas/nonce'
                ascending:
                  nullable: true
                  description: >-
                    `true` to sort ascending, `false` (the default) for
                    descending.
                  type: boolean
                converted_asset:
                  nullable: true
                  description: >-
                    A secondary currency to express the value of your
                    allocations (the default is USD).
                  type: string
                hide_zero_allocations:
                  nullable: true
                  description: >-
                    Omit entries for strategies that were used in the past but
                    now they don't hold any allocation (the default is `false`)
                  type: boolean
              required:
                - nonce
              example:
                nonce: 30295839
                converted_asset: EUR
                hide_zero_allocations: true
        required: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/error'
                  result:
                    nullable: true
                    description: Page response
                    type: object
                    properties:
                      converted_asset:
                        description: >-
                          A secondary asset to show the value of allocations.
                          (Eg. you also want to

                          see the value of your allocations in USD). Choose this
                          in the request

                          parameters.
                        type: string
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            amount_allocated:
                              description: Amounts allocated to this Earn strategy
                              type: object
                              properties:
                                bonding:
                                  nullable: true
                                  description: >-
                                    Amount allocated in bonding status. Only
                                    present when there are bonding allocations.
                                  type: object
                                  properties:
                                    allocation_count:
                                      description: >-
                                        The total number of allocations in this
                                        state for this asset
                                      type: integer
                                      format: uint
                                    allocations:
                                      description: >-
                                        Details about when each allocation will
                                        expire and move to the next state
                                      type: array
                                      items:
                                        description: >-
                                          Additional information about the
                                          allocation describing the amount
                                          contained within the allocation and when
                                          it will transition to the next state
                                        type: object
                                        properties:
                                          converted:
                                            description: >-
                                              Amount converted into the requested
                                              asset
                                            type: string
                                          created_at:
                                            description: >-
                                              The date and time which a request to
                                              either allocate was received and

                                              the funds started bonding.
                                            type: string
                                            format: date-time
                                          expires:
                                            description: >-
                                              The date at which the `Bonded`
                                              allocation will move to the `Earning`
                                              state.
                                            type: string
                                            format: date-time
                                          native:
                                            description: Amount in the native asset
                                            type: string
                                    converted:
                                      description: >-
                                        Amount converted into the requested
                                        asset
                                      type: string
                                    native:
                                      description: Amount in the native asset
                                      type: string
                                exit_queue:
                                  nullable: true
                                  description: >-
                                    Amount allocated in the exit-queue status.
                                    Only present when there are exit_queue
                                    allocations.
                                  type: object
                                  properties:
                                    allocation_count:
                                      description: >-
                                        The total number of allocations in this
                                        state for this asset
                                      type: integer
                                      format: uint
                                    allocations:
                                      description: >-
                                        Details about when each allocation will
                                        expire and move to the next state
                                      type: array
                                      items:
                                        description: >-
                                          Additional information about the
                                          allocation describing the amount
                                          contained within the allocation and when
                                          it will transition to the next state
                                        type: object
                                        properties:
                                          converted:
                                            description: >-
                                              Amount converted into the requested
                                              asset
                                            type: string
                                          created_at:
                                            description: >-
                                              The date and time which a request to
                                              deallocate was received and processed.

                                              For a deallocation request to a strategy
                                              with an `exit-queue`, this will be the
                                              time the funds joined the exit queue.
                                            type: string
                                            format: date-time
                                          expires:
                                            description: >-
                                              The date/time when the funds will be
                                              unbonded.
                                            type: string
                                            format: date-time
                                          native:
                                            description: Amount in the native asset
                                            type: string
                                    converted:
                                      description: >-
                                        Amount converted into the requested
                                        asset
                                      type: string
                                    native:
                                      description: Amount in the native asset
                                      type: string
                                pending:
                                  nullable: true
                                  description: >-
                                    Pending allocation amount - can be negative
                                    if the pending operation is deallocation.
                                    Only present when there are pending
                                    allocations.
                                  type: object
                                  properties:
                                    converted:
                                      description: >-
                                        Amount converted into the requested
                                        asset
                                      type: string
                                    native:
                                      description: Amount in the native asset
                                      type: string
                                total:
                                  description: Total amount allocated to this Earn strategy
                                  type: object
                                  properties:
                                    converted:
                                      description: >-
                                        Amount converted into the requested
                                        asset
                                      type: string
                                    native:
                                      description: Amount in the native asset
                                      type: string
                                unbonding:
                                  nullable: true
                                  description: >-
                                    Amount allocated in unbonding status. Only
                                    present when there are unbonding
                                    allocations.
                                  type: object
                                  properties:
                                    allocation_count:
                                      description: >-
                                        The total number of allocations in this
                                        state for this asset
                                      type: integer
                                      format: uint
                                    allocations:
                                      description: >-
                                        Details about when each allocation will
                                        expire and move to the next state
                                      type: array
                                      items:
                                        description: >-
                                          Additional information about the
                                          allocation describing the amount
                                          contained within the allocation and when
                                          it will transition to the next state
                                        type: object
                                        properties:
                                          converted:
                                            description: >-
                                              Amount converted into the requested
                                              asset
                                            type: string
                                          created_at:
                                            description: >-
                                              The date and time which a request to
                                              either allocate or deallocate was
                                              received and processed.


                                              For a deallocation request to a strategy
                                              with an `exit-queue`, this will be the
                                              time the funds joined the exit queue.
                                              For a deallocation request to a strategy
                                              without exit queue, this will be the
                                              time the funds started unbonding
                                            type: string
                                            format: date-time
                                          expires:
                                            description: >-
                                              The date/time the funds will be
                                              unbonded.
                                            type: string
                                            format: date-time
                                          native:
                                            description: Amount in the native asset
                                            type: string
                                    converted:
                                      description: >-
                                        Amount converted into the requested
                                        asset
                                      type: string
                                    native:
                                      description: Amount in the native asset
                                      type: string
                            native_asset:
                              description: >-
                                The asset of the native currency of this
                                allocation
                              type: string
                            payout:
                              nullable: true
                              description: >-
                                Information about the current payout period,
                                absent if when there is no current payout
                                period.
                              type: object
                              properties:
                                accumulated_reward:
                                  description: >-
                                    Reward accumulated in the payout period
                                    until now
                                  type: object
                                  properties:
                                    converted:
                                      description: >-
                                        Amount converted into the requested
                                        asset
                                      type: string
                                    native:
                                      description: Amount in the native asset
                                      type: string
                                estimated_reward:
                                  description: Estimated reward from now until the payout
                                  type: object
                                  properties:
                                    converted:
                                      description: >-
                                        Amount converted into the requested
                                        asset
                                      type: string
                                    native:
                                      description: Amount in the native asset
                                      type: string
                                period_end:
                                  description: Tentative date of the next reward payout.
                                  type: string
                                  format: date-time
                                period_start:
                                  description: >-
                                    When the current payout period started.
                                    Either the date of the last payout or when
                                    it was enabled.
                                  type: string
                                  format: date-time
                            strategy_id:
                              description: Unique ID for Earn Strategy
                              type: string
                            total_rewarded:
                              description: >-
                                Amount earned using the strategy during the
                                whole lifetime of user account
                              type: object
                              properties:
                                converted:
                                  description: Amount converted into the requested asset
                                  type: string
                                native:
                                  description: Amount in the native asset
                                  type: string
                      total_allocated:
                        description: >-
                          The total amount allocated across all strategies,
                          denominated in the `converted_asset` currency
                        type: string
                      total_rewarded:
                        description: >-
                          Amount earned across all strategies during the whole
                          lifetime of user account, denominated in
                          `converted_asset` currency
                        type: string
                example:
                  error: []
                  result:
                    converted_asset: USD
                    total_allocated: '49.2398'
                    total_rewarded: '0.0675'
                    next_cursor: '2'
                    items:
                      - strategy_id: ESDQCOL-WTZEU-NU55QF
                        native_asset: ETH
                        amount_allocated:
                          bonding:
                            native: '0.0210000000'
                            converted: '39.0645'
                            allocation_count: 2
                            allocations:
                              - created_at: '2023-07-06T10:52:05Z'
                                expires: '2023-08-19T02:34:05.807Z'
                                native: '0.0010000000'
                                converted: '1.8602'
                              - created_at: '2023-08-01T11:25:52Z'
                                expires: '2023-09-06T07:55:52.648Z'
                                native: '0.0200000000'
                                converted: '37.2043'
                          total:
                            native: '0.0210000000'
                            converted: '39.0645'
                        total_rewarded:
                          native: '0'
                          converted: '0.0000'
  /public/PreTrade:
    get:
      summary: Pre-Trade Data
      description: >
        Returns the price levels in the order book with aggregated order
        quantities at each price level. 

        The top 10 levels are returned for each trading pair.
      tags:
        - Transparency
      operationId: getPreTrade
      security: []
      parameters:
        - name: symbol
          in: query
          required: true
          description: A list of symbols for the currency pairs.
          example: BTC/USD
          schema:
            type: string
            minLength: 3
            maxLength: 32
      responses:
        '200':
          description: The top price levels of the aggregated order book.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pre-trade'
  /public/PostTrade:
    get:
      summary: Post-Trade Data
      description: >
        Returns a list of trades on the spot exchange. 

        If no filter parameters are specified, the last 1000 trades for all
        pairs are received.
      tags:
        - Transparency
      operationId: getPostTrade
      security: []
      parameters:
        - name: symbol
          in: query
          required: false
          description: Filter the results to the currency pair.
          example: BTC/USD
          schema:
            type: string
        - name: from_ts
          in: query
          description: Filter the results to include the trades *after* this timestamp.
          required: false
          example: '2024-05-30T12:34:56.123456789Z'
          schema:
            type: string
            format: ISO 8601
        - name: to_ts
          in: query
          description: >-
            Filter the results to include the trades *before or at* this
            timestamp.
          required: false
          example: '2024-05-30T12:34:56.123456789Z'
          schema:
            type: string
            format: ISO 8601
        - name: count
          in: query
          required: false
          description: The maximum number of trades to return.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 1000
      responses:
        '200':
          description: Post-trade data retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/post-trade'
components:
  securitySchemes:
    API-Key:
      type: apiKey
      description: The "API-Key" header should contain your API key.
      name: API-Key
      in: header
    API-Sign:
      type: apiKey
      description: >-
        Authenticated requests should be signed with the "API-Sign" header,
        using a signature generated with your private key, nonce, encoded
        payload, and URI path.
      name: API-Sign
      in: header
  schemas:
    error:
      type: array
      items:
        description: Kraken API error
        type: string
        example: EGeneral:Invalid arguments
    time:
      description: Success response
      type: object
      properties:
        result:
          title: ServerTime
          type: object
          properties:
            unixtime:
              description: Unix timestamp
              type: integer
            rfc1123:
              description: RFC 1123 time format
              type: string
        error:
          $ref: '#/components/schemas/error'
    info:
      title: AssetInfo
      description: Asset Info
      type: object
      properties:
        aclass:
          description: Asset Class
          type: string
        altname:
          description: Alternate name
          type: string
        decimals:
          description: Number of decimal places for record keeping amounts of this asset
          type: integer
        display_decimals:
          description: Number of decimal places shown for display purposes in frontends
          type: integer
        collateral_value:
          description: Valuation as margin collateral (if applicable)
          type: number
        status:
          description: >-
            Status of asset. Possible values: `enabled`, `deposit_only`,
            `withdrawal_only`, `funding_temporarily_disabled`.
          type: string
        margin_rate:
          description: Interest rate charged when borrowing this asset for margin trading.
          type: number
    info-2:
      type: object
      properties:
        result:
          type: object
          additionalProperties:
            x-additionalPropertiesName: asset
            $ref: '#/components/schemas/info'
        error:
          $ref: '#/components/schemas/error'
    pairs:
      title: AssetPair
      description: Trading Asset Pair
      type: object
      x-additionalPropertiesName: pair
      properties:
        altname:
          description: Alternate pair name
          type: string
        wsname:
          description: WebSocket pair name (if available)
          type: string
        aclass_base:
          description: Asset class of base component
          type: string
        base:
          description: Asset ID of base component
          type: string
        aclass_quote:
          description: Asset class of quote component
          type: string
        quote:
          description: Asset ID of quote component
          type: string
        execution_venue:
          description: Execution venue where the order book for this pair is listed
          type: string
          enum:
            - international
            - bitnomial_exchange
        lot:
          description: Volume lot size
          type: string
          deprecated: true
        pair_decimals:
          description: Number of decimal places for prices in this pair
          type: integer
        cost_decimals:
          description: >-
            Number of decimal places for cost of trades in pair (quote asset
            terms)
          type: integer
        lot_decimals:
          description: Number of decimal places for volume (base asset terms)
          type: integer
        lot_multiplier:
          description: Amount to multiply lot volume by to get currency volume
          type: integer
        leverage_buy:
          description: Array of leverage amounts available when buying
          type: array
          items:
            type: integer
        leverage_sell:
          description: Array of leverage amounts available when selling
          type: array
          items:
            type: integer
        fees:
          description: Fee schedule array in `[<volume>, <percent fee>]` tuples
          type: array
          items:
            type: array
            items:
              type: number
        fees_maker:
          description: >-
            Maker fee schedule array in `[<volume>, <percent fee>]`  tuples (if
            on maker/taker)
          type: array
          items:
            type: array
            items:
              type: number
        fee_volume_currency:
          description: Volume discount currency
          type: string
        margin_call:
          description: Margin call level
          type: integer
        margin_stop:
          description: Stop-out/liquidation margin level
          type: integer
        ordermin:
          description: Minimum order size (in terms of base currency)
          type: string
        costmin:
          description: Minimum order cost (in terms of quote currency)
          type: string
        tick_size:
          description: Minimum increment between valid price levels
          type: string
        status:
          description: >-
            Status of asset. Possible values: `online`, `cancel_only`,
            `post_only`, `limit_only`, `reduce_only`.
          type: string
        long_position_limit:
          description: Maximum long margin position size (in terms of base currency)
          type: integer
        short_position_limit:
          description: Maximum short margin position size (in terms of base currency)
          type: integer
    ticker:
      title: AssetTickerInfo
      description: Asset Ticker Info
      type: object
      properties:
        a:
          description: Ask `[<price>, <whole lot volume>, <lot volume>]`
          type: array
          items:
            type: string
        b:
          description: Bid `[<price>, <whole lot volume>, <lot volume>]`
          type: array
          items:
            type: string
        c:
          description: Last trade closed `[<price>, <lot volume>]`
          type: array
          items:
            type: string
        v:
          description: Volume `[<today>, <last 24 hours>]`
          type: array
          items:
            type: string
        p:
          description: Volume weighted average price `[<today>, <last 24 hours>]`
          type: array
          items:
            type: string
        t:
          description: Number of trades `[<today>, <last 24 hours>]`
          type: array
          items:
            type: integer
        l:
          description: Low `[<today>, <last 24 hours>]`
          type: array
          items:
            type: string
        h:
          description: High `[<today>, <last 24 hours>]`
          type: array
          items:
            type: string
        o:
          description: Today's opening price
          type: string
    ticker-2:
      type: object
      properties:
        result:
          type: object
          additionalProperties:
            x-additionalPropertiesName: pair
            $ref: '#/components/schemas/ticker'
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          XXBTZUSD:
            a:
              - '30300.10000'
              - '1'
              - '1.000'
            b:
              - '30300.00000'
              - '1'
              - '1.000'
            c:
              - '30303.20000'
              - '0.00067643'
            v:
              - '4083.67001100'
              - '4412.73601799'
            p:
              - '30706.77771'
              - '30689.13205'
            t:
              - 34619
              - 38907
            l:
              - '29868.30000'
              - '29868.30000'
            h:
              - '31631.00000'
              - '31631.00000'
            o: '30502.80000'
    tickData:
      title: TickData
      description: >
        Array of tick data arrays

        `[int <time>, string <open>, string <high>, string <low>, string
        <close>, string <vwap>, string <volume>, int <count>]`
      type: array
      items:
        type: array
        minItems: 8
        maxItems: 8
        items:
          oneOf:
            - type: string
              title: string
            - type: integer
              title: integer
        example:
          - 1548115200
          - '3533.4'
          - '3543.7'
          - '3530.7'
          - '3539.4'
          - '3539.8'
          - '83.09287787'
          - 232
    ohlc:
      type: object
      properties:
        result:
          type: object
          additionalProperties:
            x-additionalPropertiesName: pair
            $ref: '#/components/schemas/tickData'
          properties:
            last:
              type: integer
              description: ID to be used as since when polling for new, committed OHLC data
        error:
          $ref: '#/components/schemas/error'
    orderBookEntry:
      title: OrderBook
      description: Asset Pair Order Book Entries
      type: object
      properties:
        asks:
          description: Ask side array of entries `[<price>, <volume>, <timestamp>]`
          type: array
          items:
            type: array
            minItems: 3
            maxItems: 3
            items:
              oneOf:
                - type: string
                  title: string
                - type: integer
                  title: integer
            example:
              - '3539.90000'
              - '0.801'
              - 1548119951
        bids:
          description: Bid side array of entries `[<price>, <volume>, <timestamp>]`
          type: array
          items:
            type: array
            minItems: 3
            maxItems: 3
            items:
              oneOf:
                - type: string
                  title: string
                - type: integer
                  title: integer
            example:
              - '3538.70000'
              - '0.798'
              - 1548119924
    depth:
      type: object
      properties:
        result:
          type: object
          additionalProperties:
            x-additionalPropertiesName: pair
            $ref: '#/components/schemas/orderBookEntry'
        error:
          $ref: '#/components/schemas/error'
    nonce:
      description: Nonce used in construction of `API-Sign` header
      type: integer
      format: int64
    trade:
      title: TickData
      description: >
        Array of trade entries

        `[<price>, <volume>, <time>, <buy/sell>, <market/limit>,
        <miscellaneous>, <trade_id>]`
      type: array
      items:
        type: array
        items:
          oneOf:
            - type: string
              title: string
            - type: number
              title: number
          example:
            - '1205.00000'
            - '2.28253070'
            - 1668714225.5189962
            - b
            - l
            - ''
            - 41557503
    trades:
      type: object
      properties:
        result:
          type: object
          additionalProperties:
            x-additionalPropertiesName: pair
            $ref: '#/components/schemas/trade'
          properties:
            last:
              type: string
              description: ID to be used as since when polling for new trade data
        error:
          $ref: '#/components/schemas/error'
    spread:
      title: SpreadData
      description: |
        Array of spread entries
        `[int <time>, string <bid>, string <ask>]`
      type: array
      items:
        type: array
        items:
          oneOf:
            - type: string
              title: string
            - type: integer
              title: integer
          example:
            - 1548120550
            - '3538.70000'
            - '3541.50000'
    spread-2:
      type: object
      properties:
        result:
          type: object
          additionalProperties:
            x-additionalPropertiesName: pair
            $ref: '#/components/schemas/spread'
          properties:
            last:
              type: integer
              description: ID to be used as since when polling for new spread data
        error:
          $ref: '#/components/schemas/error'
    rebase_multiplier:
      type: string
      enum:
        - rebased
        - base
      default: rebased
      nullable: true
      description: |
        Optional parameter for viewing xstocks data. 
        - `rebased`: Display in terms of underlying equity.
        - `base`: Display in terms of SPV tokens.
    balance:
      title: AccountBalance
      description: Account Balance
      type: object
      additionalProperties:
        x-additionalPropertiesName: asset
        type: string
        description: balance
      example:
        ZUSD: '2970172.7962'
    balance-2:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/balance'
        error:
          $ref: '#/components/schemas/error'
    balanceex:
      title: ExtendedBalance
      description: Extended Balance
      type: object
      properties:
        balance:
          description: Total balance amount for an asset
          type: string
          example: '3.46840030'
        credit:
          description: Total credit amount. Only present if the account has a credit line.
          type: string
          example: '1.26844502'
        credit_used:
          description: Used credit amount. Only present if the account has a credit line.
          type: string
          example: '0.10002300'
        hold_trade:
          description: Total held amount for an asset
          type: string
          example: '2.14560458'
    balanceex-2:
      type: object
      properties:
        result:
          title: ExtendedBalance
          description: Extended Balance
          type: object
          properties:
            asset:
              type: object
              $ref: '#/components/schemas/balanceex'
        error:
          $ref: '#/components/schemas/error'
    creditlines-asset:
      title: CreditLinesAsset
      description: Credit line details for a specific asset
      type: object
      properties:
        balance:
          description: Current balance for the asset
          type: string
          example: '1000.5000'
        hold_trade:
          description: Amount on hold for open orders
          type: string
          example: '0.0000'
        collateral_value:
          description: >-
            Collateral value factor for this asset (present for eligible
            collateral assets)
          type: number
          example: 0.99
        credit_limit:
          description: >-
            Credit limit for the asset (present only for accounts with a credit
            line)
          type: string
          example: '50000.0000'
        credit_used:
          description: >-
            Currently used credit for the asset (present only for accounts with
            a credit line)
          type: string
          example: '12500.0000'
        available_credit:
          description: >-
            Available credit for the asset (present only for accounts with a
            credit line)
          type: string
          example: '37500.0000'
    creditlines-monitor:
      title: CreditLinesMonitor
      description: Credit monitor with summary information across all assets
      type: object
      properties:
        total_credit_usd:
          description: Total credit across all assets represented in USD
          type: string
          nullable: true
          example: '100000.0000'
        total_credit_used_usd:
          description: Total credit used across all assets represented in USD
          type: string
          nullable: true
          example: '25000.0000'
        total_collateral_value_usd:
          description: Sum of asset balance in USD * collateral
          type: string
          nullable: true
          example: '150000.0000'
        equity_usd:
          description: Total collateral - total credit (in USD)
          type: string
          nullable: true
          example: '125000.0000'
        ongoing_balance:
          description: Total collateral / total credit (in USD)
          type: string
          nullable: true
          example: '1.5000'
        debt_to_equity:
          description: Total credit used / equity (in USD)
          type: string
          nullable: true
          example: '0.2000'
    creditlines:
      title: CreditLines
      description: Credit Line Details
      type: object
      properties:
        asset_details:
          description: Balances by asset
          type: object
          additionalProperties:
            $ref: '#/components/schemas/creditlines-asset'
        limits_monitor:
          description: Credit monitor
          type: object
          $ref: '#/components/schemas/creditlines-monitor'
    creditlines-2:
      type: object
      properties:
        result:
          nullable: true
          $ref: '#/components/schemas/creditlines'
        error:
          $ref: '#/components/schemas/error'
    balance-3:
      title: AccountBalance
      description: Account Balance
      type: object
      properties:
        eb:
          description: Equivalent balance (combined balance of all currencies)
          type: string
          example: '3224744.0162'
        tb:
          description: Trade balance (combined balance of all equity currencies)
          type: string
          example: '3224744.0162'
        m:
          description: Margin amount of open positions
          type: string
          example: '0.0000'
        'n':
          description: Unrealized net profit/loss of open positions
          type: string
          example: '0.0000'
        c:
          description: Cost basis of open positions
          type: string
          example: '0.0000'
        v:
          description: Current floating valuation of open positions
          type: string
          example: '0.0000'
        e:
          description: 'Equity: `trade balance + unrealized net profit/loss`'
          type: string
          example: '3224744.0162'
        mf:
          description: >-
            Free margin: `Equity - initial margin (maximum margin available to
            open new positions)`
          type: string
          example: '3224744.0162'
        mfo:
          description: >-
            Margin free for orders: available margin that can be used for new
            orders
          type: string
          example: '3224744.0162'
        ml:
          description: >-
            Margin level: `(equity / initial margin) * 100`. Only present when
            margin positions are open.
          type: string
          nullable: true
          example: '0.0000'
        uv:
          description: 'Unexecuted value: Value of unfilled and partially filled orders'
          type: string
          example: '0.0000'
    balance-4:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/balance-3'
        error:
          $ref: '#/components/schemas/error'
    ordertype:
      description: |
        The execution model of the order.
      type: string
      enum:
        - market
        - limit
        - iceberg
        - stop-loss
        - take-profit
        - stop-loss-limit
        - take-profit-limit
        - trailing-stop
        - trailing-stop-limit
        - settle-position
      example: limit
    oflags:
      description: |
        Comma delimited list of order flags

          * &bull; `post` post-only order (available when ordertype = limit)
          * &bull; `fcib` prefer fee in base currency (default if selling)
          * &bull; `fciq` prefer fee in quote currency (default if buying, mutually exclusive with `fcib`)
          * &bull; `nompp` (DEPRECATED) — disabling Market Price Protection for market orders is no longer supported. If supplied, the flag is accepted but ignored.
          * &bull; `viqc`  order volume expressed in quote currency. This option is supported only for buy market orders. Also not available on margin orders.
      type: string
      example: post
    open:
      title: OpenOrder
      description: Open Order
      type: object
      properties:
        refid:
          description: Referral order transaction ID that created this order
          type: string
          nullable: true
        userref:
          description: >-
            Optional numeric, client identifier associated with one or more
            orders.
          type: integer
          nullable: true
        cl_ord_id:
          description: Optional alphanumeric, client identifier associated with the order.
          type: string
          nullable: true
        status:
          description: |
            Status of order
              * pending = order pending book entry
              * open = open order
              * closed = closed order
              * canceled = order canceled
              * expired = order expired
          type: string
          enum:
            - pending
            - open
            - closed
            - canceled
            - expired
        opentm:
          description: Unix timestamp of when order was placed
          type: number
        starttm:
          description: Unix timestamp of order start time (or 0 if not set)
          type: number
        expiretm:
          description: Unix timestamp of order end time (or 0 if not set)
          type: number
        descr:
          title: OrderDescription
          description: Order description info
          type: object
          properties:
            pair:
              description: Asset pair
              type: string
            type:
              description: Type of order (buy/sell)
              type: string
              enum:
                - buy
                - sell
            ordertype:
              $ref: '#/components/schemas/ordertype'
            price:
              description: primary price
              type: string
            price2:
              description: Secondary price
              type: string
            leverage:
              description: Amount of leverage
              type: string
            order:
              description: Order description
              type: string
            close:
              description: Conditional close order description (if conditional close set)
              type: string
            aclass:
              description: Asset class of the pair
              type: string
        time_in_force:
          description: |
            Time-in-force of the order:
              * `gtc` = good till cancelled
              * `ioc` = immediate or cancel
              * `gtd` = good till date
              * `fok` = fill or kill
          type: string
          enum:
            - gtc
            - ioc
            - gtd
            - fok
        vol:
          description: Volume of order (base currency)
          type: string
        vol_exec:
          description: Volume executed (base currency)
          type: string
        cost:
          description: Total cost (quote currency unless)
          type: string
        fee:
          description: Total fee (quote currency)
          type: string
        price:
          description: Average price (quote currency)
          type: string
        stopprice:
          description: Stop price (quote currency)
          type: string
        limitprice:
          description: >-
            Triggered limit price (quote currency, when limit based order type
            triggered)
          type: string
        trigger:
          description: >
            Price signal used to trigger "stop-loss" "take-profit"
            "stop-loss-limit" "take-profit-limit" orders.
              * `last` is the implied trigger if this field is not set.
          type: string
          enum:
            - last
            - index
          default: last
        margin:
          description: Indicates if the order is funded on margin.
          type: boolean
        misc:
          description: |
            Comma delimited list of miscellaneous info

              * `stopped` triggered by stop price
              * `touched` triggered by touch price
              * `liquidated` liquidation
              * `partial` partial fill
              * `amended` order parameters modified
          type: string
        sender_sub_id:
          description: >-
            For institutional accounts, identifies underlying sub-account/trader
            for Self Trade Prevention (STP).
          type: string
          nullable: true
        oflags:
          $ref: '#/components/schemas/oflags'
        trades:
          description: >-
            List of trade IDs related to order (if trades info requested and
            data available)
          type: array
          items:
            type: string
    open-2:
      type: object
      properties:
        result:
          title: OpenOrders
          description: Open Orders
          type: object
          properties:
            open:
              type: object
              additionalProperties:
                x-additionalPropertiesName: txid
                $ref: '#/components/schemas/open'
        error:
          $ref: '#/components/schemas/error'
    closed:
      title: txid
      description: Closed Order
      type: object
      properties:
        refid:
          description: Referral order transaction ID that created this order
          type: string
          nullable: true
        userref:
          description: >-
            Optional numeric, client identifier associated with one or more
            orders.
          type: integer
          nullable: true
        cl_ord_id:
          description: Optional alphanumeric, client identifier associated with the order.
          type: string
          nullable: true
        status:
          description: |
            Status of order
              * pending = order pending book entry
              * open = open order
              * closed = closed order
              * canceled = order canceled
              * expired = order expired
          type: string
          enum:
            - pending
            - open
            - closed
            - canceled
            - expired
        opentm:
          description: Unix timestamp of when order was placed
          type: number
        starttm:
          description: Unix timestamp of order start time (or 0 if not set)
          type: number
        expiretm:
          description: Unix timestamp of order end time (or 0 if not set)
          type: number
        descr:
          title: OrderDescription
          description: Order description info
          type: object
          properties:
            pair:
              description: Asset pair
              type: string
            type:
              description: Type of order (buy/sell)
              type: string
              enum:
                - buy
                - sell
            ordertype:
              description: |
                Order type
              type: string
              enum:
                - market
                - limit
                - iceberg
                - stop-loss
                - take-profit
                - trailing-stop
                - stop-loss-limit
                - take-profit-limit
                - trailing-stop-limit
                - settle-position
            price:
              description: primary price
              type: string
            price2:
              description: Secondary price
              type: string
            leverage:
              description: Amount of leverage
              type: string
            order:
              description: Order description
              type: string
            close:
              description: Conditional close order description (if conditional close set)
              type: string
            aclass:
              description: Asset class of the pair
              type: string
        time_in_force:
          description: |
            Time-in-force of the order:
              * `gtc` = good till cancelled
              * `ioc` = immediate or cancel
              * `gtd` = good till date
              * `fok` = fill or kill
          type: string
          enum:
            - gtc
            - ioc
            - gtd
            - fok
        vol:
          description: Volume of order (base currency)
          type: string
        vol_exec:
          description: Volume executed (base currency)
          type: string
        cost:
          description: Total cost (quote currency unless)
          type: string
        fee:
          description: Total fee (quote currency)
          type: string
        price:
          description: Average price (quote currency)
          type: string
        stopprice:
          description: Stop price (quote currency)
          type: string
        limitprice:
          description: >-
            Triggered limit price (quote currency, when limit based order type
            triggered)
          type: string
        trigger:
          description: >
            Price signal used to trigger "stop-loss" "take-profit"
            "stop-loss-limit" "take-profit-limit" orders.
              * `last` is the implied trigger if this field is not set.
          type: string
          enum:
            - last
            - index
          default: last
        margin:
          description: Indicates if the order is funded on margin.
          type: boolean
        misc:
          description: |
            Comma delimited list of miscellaneous info:
              * `stopped` triggered by stop price
              * `touched` triggered by touch price
              * `liquidated` liquidation
              * `partial` partial fill
              * `amended` order parameters modified
          type: string
        oflags:
          description: |
            Comma delimited list of order flags:
              * `post` post-only order (available when ordertype = limit)
              * `fcib` prefer fee in base currency (default if selling)
              * `fciq` prefer fee in quote currency (default if buying, mutually exclusive with `fcib`)
              * `nompp` disable [market price protection](https://support.kraken.com/hc/en-us/articles/201648183-Market-Price-Protection) for market orders
              * `viqc`  order volumes expressed in quote currency.
          type: string
        trades:
          description: >-
            List of trade IDs related to order (if trades info requested and
            data available)
          type: array
          items:
            type: string
        sender_sub_id:
          description: >-
            For institutional accounts, identifies underlying sub-account/trader
            for Self Trade Prevention (STP).
          type: string
          nullable: true
        closetm:
          description: Unix timestamp of when order was closed
          type: number
        reason:
          description: Additional info on status (if any)
          type: string
    closed-2:
      type: object
      properties:
        result:
          title: ClosedOrders
          description: Closed Orders
          type: object
          properties:
            closed:
              type: object
              additionalProperties:
                x-additionalPropertiesName: txid
                $ref: '#/components/schemas/closed'
            count:
              description: Amount of available order info matching criteria
              type: integer
        error:
          $ref: '#/components/schemas/error'
    query:
      title: Query Orders Info Request Body
      required:
        - nonce
        - txid
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        trades:
          description: Whether or not to include trades related to position in output
          type: boolean
          default: false
        userref:
          description: Restrict results to given user reference id
          type: integer
          format: int32
        txid:
          description: >-
            The Kraken order identifier. To query multiple orders, use comma
            delimited list of up to 50 ids.
          type: string
        consolidate_taker:
          description: Whether or not to consolidate trades by individual taker trades
          type: boolean
          default: true
        rebase_multiplier:
          $ref: '#/components/schemas/rebase_multiplier'
    query-2:
      type: object
      properties:
        result:
          type: object
          description: txid of the order.
          oneOf:
            - $ref: '#/components/schemas/open'
            - $ref: '#/components/schemas/closed'
        error:
          $ref: '#/components/schemas/error'
    amends:
      title: Get Order Amends Request Body
      required:
        - nonce
        - txid
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        order_id:
          description: The Kraken order identifier for the amended order.
          type: string
        rebase_multiplier:
          $ref: '#/components/schemas/rebase_multiplier'
      example:
        nonce: 1695828490
        order_id: OVITN3-BFK3H-63K37C
    amends-2:
      type: object
      properties:
        result:
          type: object
          description: The amend transaction history.
          title: Amend transactions.
          properties:
            count:
              type: integer
              description: >-
                The total count of new and amend transactions (i.e. includes the
                original order).
            amends:
              type: array
              items:
                type: object
                properties:
                  amend_id:
                    description: Kraken amend identifier
                    type: string
                  amend_type:
                    description: |
                      The type of amend transaction:
                        * &bull; `original`: original order values on order entry.
                        * &bull; `user`: user requested amendment.
                        * &bull; `restated`: engine order maintenance amendment.
                    type: string
                    enum:
                      - original
                      - user
                      - restated
                  order_qty:
                    description: Order quantity in terms of the base asset.
                    type: string
                  display_qty:
                    description: The quantity show in the book for iceberg orders.
                    type: string
                  remaining_qty:
                    description: Remaining un-traded quantity on the order.
                    type: string
                  limit_price:
                    description: The limit price restriction on the order.
                    type: string
                  trigger_price:
                    description: The trigger price on trigger order types.
                    type: string
                  reason:
                    description: Description of the reason for this amend.
                    type: string
                  post_only:
                    description: >-
                      Indicates if the transaction was restricted from taking
                      liquidity.
                    type: boolean
                  timestamp:
                    description: The UNIX timestamp for the amend transaction.
                    type: integer
    trade-2:
      title: Trade
      description: Trade Info
      type: object
      properties:
        ordertxid:
          description: Order responsible for execution of trade
          type: string
        postxid:
          description: Position responsible for execution of trade
          type: string
        pair:
          description: Asset pair
          type: string
        time:
          description: Unix timestamp of trade
          type: number
        type:
          description: Type of order (buy/sell)
          type: string
        ordertype:
          description: Order type
          type: string
        price:
          description: Average price order was executed at (quote currency)
          type: string
        cost:
          description: Total cost of order (quote currency)
          type: string
        fee:
          description: Total fee (quote currency)
          type: string
        vol:
          description: Volume (base currency)
          type: string
        margin:
          description: Initial margin (quote currency)
          type: string
        leverage:
          description: Amount of leverage used in trade
          type: string
        misc:
          description: |
            Comma delimited list of miscellaneous info:
            * `closing` &mdash; Trade closes all or part of a position
          type: string
        ledgers:
          description: |
            List of ledger ids for entries associated with trade
          type: array
          items:
            type: string
        trade_id:
          description: Unique identifier of trade executed
          type: integer
        maker:
          description: >
            `true` if trade was executed with user as the maker, `false` if
            taker
          type: boolean
        aclass:
          description: Asset class of the traded pair
          type: string
        tradeordertype:
          description: >-
            Order type of the trade (e.g. `market`, `limit`). May differ from
            `ordertype` when the order type was converted on execution.
          type: string
        posstatus:
          description: |
            Position status (open/closed)
            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: string
        cprice:
          description: |
            Average price of closed portion of position (quote currency)
            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: number
        ccost:
          description: |
            Total cost of closed portion of position (quote currency)
            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: number
        cfee:
          description: |
            Total fee of closed portion of position (quote currency)
            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: number
        cvol:
          description: |
            Total fee of closed portion of position (quote currency)
            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: number
        cmargin:
          description: |
            Total margin freed in closed portion of position (quote currency)
            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: number
        net:
          description: >
            Net profit/loss of closed portion of position (quote currency, quote
            currency scale)

            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: number
        trades:
          description: |
            List of closing trades for position (if available)
            <br><sub><sup>Only present if trade opened a position</sub></sup>
          type: array
          items:
            type: string
    history:
      title: TradeHistory
      description: Trade History
      type: object
      properties:
        count:
          description: Amount of available trades matching criteria
          type: integer
        trades:
          description: Trade info
          type: object
          additionalProperties:
            x-additionalPropertiesName: txid
            $ref: '#/components/schemas/trade-2'
    history-2:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/history'
        error:
          $ref: '#/components/schemas/error'
    ledger:
      title: LedgerEntry
      description: Ledger Entry
      type: object
      properties:
        refid:
          description: >-
            Reference Id of the parent transaction (trade, deposit, withdrawal,
            etc.) that caused the ledger entry.
          type: string
        time:
          description: Unix timestamp of ledger
          type: number
        type:
          description: Type of ledger entry
          type: string
          enum:
            - none
            - trade
            - deposit
            - withdrawal
            - transfer
            - margin
            - adjustment
            - rollover
            - spend
            - receive
            - settled
            - credit
            - staking
            - reward
            - dividend
            - sale
            - conversion
            - nfttrade
            - nftcreatorfee
            - nftrebate
            - custodytransfer
        subtype:
          description: Additional info relating to the ledger entry type, where applicable
          type: string
        aclass:
          description: Asset class
          type: string
        asset:
          description: Asset
          type: string
        amount:
          description: Transaction amount
          type: string
        fee:
          description: Transaction fee
          type: string
        balance:
          description: Resulting balance
          type: string
    info-3:
      type: object
      properties:
        result:
          title: LedgersInfo
          description: Ledgers Info
          type: object
          properties:
            ledger:
              type: object
              additionalProperties:
                x-additionalPropertiesName: ledger_id
                $ref: '#/components/schemas/ledger'
            count:
              description: Amount of available ledger info matching criteria
              type: integer
        error:
          $ref: '#/components/schemas/error'
    query-3:
      type: object
      properties:
        result:
          type: object
          additionalProperties:
            x-additionalPropertiesName: ledger_id
            $ref: '#/components/schemas/ledger'
        error:
          $ref: '#/components/schemas/error'
    fees:
      title: FeeTierInfo
      description: >
        Fee and volume tier information. Fees are expressed as percentages, and
        volumes as absolute values.
      type: object
      required:
        - fee
        - minfee
        - maxfee
        - tiervolume
      properties:
        fee:
          description: Current trading fee.
          type: string
        minfee:
          description: Minimum trading fee (corresponding to the highest volume tier).
          type: string
        maxfee:
          description: Maximum trading fee (corresponding to the lowest volume tier).
          type: string
        nextfee:
          description: >-
            Next fee (applicable once the next volume tier is reached). `null`
            at the lowest fee tier.
          type: string
          nullable: true
        tiervolume:
          description: Current spot-volume tier threshold.
          type: string
        tierfuturesvolume:
          description: Current futures-volume tier threshold, when visible in the schedule.
          type: string
          nullable: true
        nextvolume:
          description: Next spot-volume tier threshold. `null` at the highest volume tier.
          type: string
          nullable: true
        nextfuturesvolume:
          description: Next futures-volume tier threshold, when visible in the schedule.
          type: string
          nullable: true
        volumeoffset:
          description: Volume adjustment (added to the trade volume when computing fees).
          type: string
          nullable: true
    volume:
      type: object
      properties:
        result:
          title: TradeVolume
          description: Trade Volume
          type: object
          required:
            - currency
            - volume
            - inputs
          properties:
            currency:
              description: >
                The asset used to express the trade volume value. The value in
                `volume` is expressed in units of this asset.
              type: string
            asset_class:
              description: The class of the asset used to express the trade volume value.
              type: string
              nullable: true
              enum:
                - currency
                - forex
                - equity
                - equity_pair
                - nft
                - derivatives
                - tokenized_asset
                - futures_contract
            volume:
              description: The total trading volume value.
              type: string
            inputs:
              description: >-
                Domain-aggregated input values evaluated against fee-schedule
                tier conditions.
              type: object
              required:
                - domain_assets_on_platform
                - domain_futures_volume_30d
                - domain_spot_volume_30d
              properties:
                domain_spot_volume_30d:
                  description: 30-day rolling spot trading volume.
                  type: string
                domain_futures_volume_30d:
                  description: 30-day rolling futures trading volume.
                  type: string
                domain_assets_on_platform:
                  description: Assets on platform.
                  type: string
            fees:
              description: >-
                A map describing the taker fees applicable to each trading pair
                (one entry per pair). `null` if `pair` is not requested.
              type: object
              nullable: true
              additionalProperties:
                x-additionalPropertiesName: pair
                $ref: '#/components/schemas/fees'
            fees_maker:
              description: >-
                A map describing the maker fees applicable to each trading pair
                (one entry per pair). `null` if `pair` is not requested.
              type: object
              nullable: true
              additionalProperties:
                x-additionalPropertiesName: pair
                $ref: '#/components/schemas/fees'
            volume_subaccounts:
              description: >
                Trade volume breakdown by subaccount. Only present when the
                requester is the domain's master account.
              type: array
              items:
                title: SubaccountVolume
                description: Trade volume for one subaccount in a domain.
                type: object
                required:
                  - iiban
                  - volume
                properties:
                  iiban:
                    description: The subaccount IIBAN.
                    type: string
                  volume:
                    description: The subaccount trade volume.
                    type: string
            schedules:
              description: >-
                Full fee schedule per trading pair. Present only when
                `fee_schedule` is requested.
              type: array
              nullable: true
              items:
                title: FeeSchedule
                description: Full fee schedule for a trading pair.
                type: object
                required:
                  - pair
                  - class
                  - tiers
                properties:
                  pair:
                    description: The trading pair to which the fee schedule applies.
                    type: string
                  class:
                    description: Trading pair class.
                    type: string
                    enum:
                      - currency
                      - forex
                      - equity
                      - equity_pair
                      - nft
                      - derivatives
                      - tokenized_asset
                      - futures_contract
                      - volume
                  tiers:
                    description: The tiers of the fee schedule.
                    type: array
                    items:
                      title: FeeScheduleTier
                      description: A single tier in a fee schedule.
                      type: object
                      required:
                        - maker_fee
                        - taker_fee
                      properties:
                        maker_fee:
                          description: Maker fee percentage for this tier.
                          type: string
                        taker_fee:
                          description: Taker fee percentage for this tier.
                          type: string
                        min_spot_volume:
                          description: >-
                            Minimum spot volume threshold for this tier, if
                            applicable.
                          type: string
                          nullable: true
                        min_futures_volume:
                          description: >-
                            Minimum 30-day futures volume threshold for this
                            tier, if applicable.
                          type: string
                          nullable: true
                        min_assets_on_platform:
                          description: >-
                            Minimum assets on platform threshold for this tier,
                            if applicable.
                          type: string
                          nullable: true
                        active:
                          description: >-
                            Whether this is the currently active tier for the
                            user.
                          type: boolean
                          nullable: true
        error:
          $ref: '#/components/schemas/error'
    add:
      example:
        nonce: 163245617
        ordertype: limit
        type: buy
        volume: '1.25'
        pair: XBTUSD
        price: '27500'
        cl_ord_id: 6d1b345e-2821-40e2-ad83-4ecb18a06876
      title: Add Standard Order Request Body
      required:
        - nonce
        - pair
        - type
        - ordertype
        - volume
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        userref:
          description: >
            This is an optional non-unique, numeric identifier which can
            associated with a number of orders by the client. This field is
            mutually exclusive with <code>cl_ord_id</code> parameter.


            `userref` is an optional user-specified integer id that can be
            associated with any number of orders. Many clients choose a
            `userref` corresponding to a unique integer id generated by their
            systems (e.g. a timestamp). However, because we don't enforce
            uniqueness on our side, it can also be used to easily group orders
            by pair, side, strategy, etc. This allows clients to more readily
            cancel or query information about orders in a particular group, with
            fewer API calls by using `userref` instead of our `txid`, where
            supported.
          type: integer
          format: int32
        cl_ord_id:
          description: >
            Adds an alphanumeric client order identifier which uniquely
            identifies an open order for each client. This field is mutually
            exclusive with <code>userref</code> parameter.


            The <code>cl_ord_id</code> parameter can be one of the following
            formats:
              * &bull; Long UUID: <code>6d1b345e-2821-40e2-ad83-4ecb18a06876</code> 32 hex characters separated with 4 dashes.
              * &bull; Short UUID: <code>da8e4ad59b78481c93e589746b0cf91f</code> 32 hex characters with no dashes.
              * &bull; Free text: <code>arb-20240509-00010</code> Free format ascii text up to 18 characters.
          type: string
        ordertype:
          $ref: '#/components/schemas/ordertype'
        type:
          description: Order direction (buy/sell)
          type: string
          enum:
            - buy
            - sell
        volume:
          description: >
            Order quantity in terms of the base asset

            > Note: Volume can be specified as `0` for closing margin orders to
            automatically fill the requisite quantity.
          type: string
          example: '1.25'
        displayvol:
          description: >
            For `iceberg` orders only, it defines the quantity to show in the
            book while the rest of order quantity remains hidden. Minimum value
            is 1 / 15 of `volume`.
          type: string
        pair:
          description: Asset pair `id` or `altname`
          type: string
          example: XBTUSD
        asset_class:
          description: >-
            This parameter is required on requests for non-crypto pairs, i.e.
            use `tokenized_asset` for xstocks.
          type: string
          enum:
            - tokenized_asset
        price:
          description: >
            Price:

            * &bull; Limit price for `limit` and `iceberg` orders

            * &bull; Trigger price for `stop-loss`, `stop-loss-limit`,
            `take-profit`, `take-profit-limit`, `trailing-stop` and
            `trailing-stop-limit` orders


            Notes:

            * &bull; Relative Prices: Either `price` or `price2` can be preceded
            by `+`, `-`, or `#` to specify the order price as an offset relative
            to the last traded price. `+` adds the amount to, and `-` subtracts
            the amount from the last traded price. `#` will either add or
            subtract the amount to the last traded price, depending on the
            direction and order type used. Prices can also be suffixed with a
            `%` to signify the relative amount as a percentage, rather than an
            absolute price difference.

            * &bull; Trailing Stops: Must use a relative price for this field,
            namely the `+` prefix, from which the direction will be automatic
            based on if the original order is a buy or sell (no need to use `-`
            or `#`). The `%` suffix also works for these order types to use a
            relative percentage price.
          type: string
          example: '40000.0'
        price2:
          description: >
            Secondary Price:

            * &bull; Limit price for `stop-loss-limit`, `take-profit-limit` and
            `trailing-stop-limit` orders


            Note:

            * &bull; Trailing Stops: Must use a relative price for this field,
            namely one of the `+` or `-` prefixes. This will provide the offset
            from the trigger price to the limit price, i.e. +0 would set the
            limit price equal to the trigger price. The `%` suffix also works
            for this field to use a relative percentage limit price.
          type: string
        trigger:
          description: >
            Price signal used to trigger `stop-loss`, `stop-loss-limit`,
            `take-profit`, `take-profit-limit`, `trailing-stop` and
            `trailing-stop-limit` orders


            Notes:

            * &bull; This `trigger` type will also be used for any associated
            conditional close orders.

            * &bull; To keep triggers serviceable, the last price will be used
            as fallback reference price during connectivity issues with external
            index feeds.
          type: string
          enum:
            - index
            - last
          default: last
        leverage:
          description: 'Amount of leverage desired (default: none)'
          type: string
          example: 5
        reduce_only:
          description: >-
            If `true`, order will only reduce a currently open position, not
            increase it or open a new position.
          type: boolean
          default: false
          example: true
        stptype:
          description: >
            Self Trade Prevention (STP) is a protection feature to prevent users
            from inadvertently or deliberately trading against themselves. To
            prevent a self-match, one of the following STP modes can be used to
            define which order(s) will be expired:

            * &bull; `cancel-newest`: arriving order will be canceled

            * &bull; `cancel-oldest`: resting order will be canceled

            * &bull; `cancel-both`: both arriving and resting orders will be
            canceled
          type: string
          enum:
            - cancel-newest
            - cancel-oldest
            - cancel-both
          default: cancel-newest
        oflags:
          $ref: '#/components/schemas/oflags'
        timeinforce:
          description: >
            Time-in-force of the order to specify how long it should remain in
            the order book before being cancelled. GTC (Good-'til-cancelled) is
            default if the parameter is omitted. IOC (immediate-or-cancel) will
            immediately execute the amount possible and cancel any remaining
            balance rather than resting in the book. GTD (good-'til-date), if
            specified, must coincide with a desired `expiretm`. FOK
            (fill-or-kill) will execute the full order immediately or cancel it
            entirely.
          type: string
          enum:
            - GTC
            - IOC
            - GTD
            - FOK
          default: GTC
        starttm:
          description: >
            Scheduled start time, can be specified as an absolute timestamp or
            as a number of seconds in the future:
              * &bull; `0` now (default)
              * &bull; `<n>` = unix timestamp of start time
              * &bull; `+<n>` = schedule start time `<n>` seconds from now
                * Note that URL encoding of the `+` character changes it to a space, so please use `%2b` followed by the number of seconds instead of `+`
          type: string
        expiretm:
          description: >
            Expiry time on GTD orders can be set up to one month in future, it
            is specified as an absolute timestamp or as a number of seconds from
            now:
              * &bull; `0` no expiration (default)
              * &bull; `<n>` = unix timestamp of expiration time
              * &bull; `+<n>` = expire `<n>` seconds from now, minimum 5 seconds
                * Note that URL encoding of the `+` character changes it to a space, so please use `%2b` followed by the number of seconds instead of `+`
          type: string
        close[ordertype]:
          description: >
            Conditional close order type 

            > Note: [Conditional close
            orders](https://support.kraken.com/hc/en-us/articles/360038640052-Conditional-Close)
            are triggered by execution of the primary order in the same quantity
            and opposite direction, but once triggered are __independent
            orders__ that may reduce or increase net position
          type: string
          enum:
            - limit
            - iceberg
            - stop-loss
            - take-profit
            - stop-loss-limit
            - take-profit-limit
            - trailing-stop
            - trailing-stop-limit
        close[price]:
          description: |
            Conditional close order `price`
          type: string
          example: '50000.0'
        close[price2]:
          description: |
            Conditional close order `price2`
          type: string
        deadline:
          type: string
          description: >
            RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the
            matching engine should reject the new order request, in presence of
            latency or order queueing: min now() + 2 seconds, max now() + 60
            seconds.
        validate:
          type: boolean
          description: >-
            If set to `true` the order will be validated only, it will not trade
            in the matching engine.
          default: false
        broker:
          description: Broker IIBAN (Partner's Kraken IIBAN)
          type: string
          nullable: true
    add-2:
      type: object
      properties:
        result:
          title: OrderAdded
          type: object
          properties:
            descr:
              description: Order description info
              type: object
              properties:
                order:
                  description: Order description
                  type: string
                close:
                  description: Conditional close order description, if applicable
                  type: string
            txid:
              description: |
                Transaction IDs for order
                <br><sup><sub>(if order was added successfully)</sup></sub>
              type: array
              items:
                type: string
        error:
          type: array
          items:
            $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          descr:
            order: buy 1.45 XBTUSD @ limit 27500.0
          txid:
            - OU22CG-KLAF2-FWUDD7
    amend:
      title: Amend Order Request Body
      required:
        - nonce
      type: object
      properties:
        txid:
          description: >-
            The Kraken identifier for the order to be amended. Either `txid` or
            `cl_ord_id` is required.
          type: string
        cl_ord_id:
          description: >-
            The client identifier for the order to be amended. Either `txid` or
            `cl_ord_id` is required.
          type: string
        order_qty:
          description: The new order quantity in terms of the base asset.
          type: string
        display_qty:
          description: >-
            For `iceberg` orders only, it defines the new quantity to show in
            the book while the rest of order quantity remains hidden. Minimum
            value is 1 / 15 of remaining order quantity.
          type: string
        limit_price:
          description: >
            The new limit price restriction on the order (for order types that
            support limit price only).


            The relative pricing can be set by using the `+`, `-` prefixes
            and/or `%` suffix. 

            * &bull; `+` adds the amount from the reference price, i.e. market
            rises 50 USD `"+50"`.

            * &bull; `-` subtracts the amount from the reference price, i.e.
            market drops 100 USD `"-100"`.
          type: string
        trigger_price:
          description: >
            The new trigger price to activate the order (for triggered order
            types only). 


            The relative pricing can be set by using the `+`, `-` prefixes
            and/or `%` suffix. 

            * &bull; `+` adds the amount from the reference price, i.e. market
            rises 50 USD `"+50"`.

            * &bull; `-` subtracts the amount from the reference price, i.e.
            market drops 100 USD `"-100"`.
          type: string
        pair:
          description: >-
            The `pair` is required on amends for non-crypto pairs, i.e. provide
            the pair symbol for xstocks.
          type: string
        post_only:
          description: >
            An optional flag for `limit_price` amends. If `true`, the limit
            price change will be rejected if the order cannot be posted
            passively in the book.
          type: boolean
          default: false
        deadline:
          type: string
          description: >-
            RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the
            matching engine should reject the new order request, in presence of
            latency or order queueing. min now() + 2 seconds, max now() + 60
            seconds.
        nonce:
          $ref: '#/components/schemas/nonce'
      example:
        nonce: 1695828490
        cl_ord_id: 6d1b345e-2821-40e2-ad83-4ecb18a06876
        order_qty: '1.25'
    amend-2:
      type: object
      properties:
        result:
          title: OrderAmended
          type: object
          properties:
            amend_id:
              description: >
                The unique Kraken identifier generated for this amend
                transaction.
              type: string
        error:
          type: array
          items:
            $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          amend_id: TEZA4R-DSDGT-IJBOJK
    cancel:
      title: Cancel Open Order Request Body
      required:
        - nonce
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        txid:
          description: Kraken order identifier (txid) or user reference (userref)
          oneOf:
            - type: string
              title: string
            - type: integer
              title: integer
        cl_ord_id:
          description: >-
            An alphanumeric client order identifier which uniquely identifies an
            open order for each client.
          type: string
      example:
        nonce: 1695828490
        pair: XBTUSD
        txid: OHYO67-6LP66-HMQ437
    cancel-2:
      type: object
      properties:
        result:
          title: OrderCancelled
          type: object
          properties:
            count:
              description: Number of orders cancelled
              type: integer
              format: int32
            pending:
              description: If true, orders are pending cancellation
              type: boolean
        error:
          type: array
          items:
            $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          count: 1
    batchadd:
      title: Add Standard Order Request Body
      required:
        - nonce
        - orders
        - pair
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        orders:
          type: array
          items:
            required:
              - ordertype
              - type
              - volume
            type: object
            properties:
              userref:
                description: >
                  User reference id

                  `userref` is an optional user-specified integer id that can be
                  associated with any number of orders. Many clients choose a
                  `userref` corresponding to a unique integer id generated by
                  their systems (e.g. a timestamp). However, because we don't
                  enforce uniqueness on our side, it can also be used to easily
                  group orders by pair, side, strategy, etc. This allows clients
                  to more readily cancel or query information about orders in a
                  particular group, with fewer API calls by using `userref`
                  instead of our `txid`, where supported.
                type: integer
                format: int32
              cl_ord_id:
                description: >
                  Adds an alphanumeric client order identifier which uniquely
                  identifies an open order for each client. This field is
                  mutually exclusive with <code>userref</code> parameter.


                  The <code>cl_ord_id</code> parameter can be one of the
                  following formats:
                    * Long UUID: <code>6d1b345e-2821-40e2-ad83-4ecb18a06876</code> 32 hex characters separated with 4 dashes.
                    * Short UUID: <code>da8e4ad59b78481c93e589746b0cf91f</code> 32 hex characters with no dashes.
                    * Free text: <code>arb-20240509-00010</code> Free format ascii text up to 18 characters.
                type: string
              ordertype:
                description: |
                  Order type
                type: string
                enum:
                  - market
                  - limit
                  - iceberg
                  - stop-loss
                  - take-profit
                  - stop-loss-limit
                  - take-profit-limit
                  - trailing-stop
                  - trailing-stop-limit
                  - settle-position
              type:
                description: Order direction (buy/sell)
                type: string
                enum:
                  - buy
                  - sell
              volume:
                description: >
                  Order quantity in terms of the base asset

                  > Note: Volume can be specified as `0` for closing margin
                  orders to automatically fill the requisite quantity.
                type: string
              displayvol:
                description: >
                  For `iceberg` orders only, it defines the quantity to show in
                  the book while the rest of order quantity remains hidden.
                  Minimum value is 1 / 15 of `volume`.
                type: string
              price:
                description: >
                  Price:

                  * Limit price for `limit` and `iceberg` orders

                  * Trigger price for `stop-loss`, `stop-loss-limit`,
                  `take-profit`, and `take-profit-limit` orders


                  Notes:

                  * Relative Prices: Either `price` or `price2` can be preceded
                  by `+`, `-`, or `#` to specify the order price as an offset
                  relative to the last traded price. `+` adds the amount to, and
                  `-` subtracts the amount from the last traded price. `#` will
                  either add or subtract the amount to the last traded price,
                  depending on the direction and order type used. Prices can
                  also be suffixed with a `%` to signify the relative amount as
                  a percentage, rather than an absolute price difference.
                type: string
              price2:
                description: |
                  Secondary Price:
                  * Limit price for `stop-loss-limit` and `take-profit-limit`
                type: string
              trigger:
                description: >
                  Price signal used to trigger `stop-loss`, `stop-loss-limit`,
                  `take-profit`, and `take-profit-limit` orders

                  Notes:

                  * To keep triggers serviceable, the last price will be used as
                  fallback reference price during connectivity issues with
                  external index feeds.
                type: string
                enum:
                  - index
                  - last
                default: last
              leverage:
                description: |
                  Amount of leverage desired (default: none)
                type: string
              reduce_only:
                description: >-
                  If `true`, order will only reduce a currently open position,
                  not increase it or open a new position.
                type: boolean
                default: false
              stptype:
                description: >
                  Self trade prevention behaviour definition:

                  * `cancel-newest` - if self trade is triggered, arriving order
                  will be canceled

                  * `cancel-oldest` - if self trade is triggered, resting order
                  will be canceled

                  * `cancel-both` - if self trade is triggered, both arriving
                  and resting orders will be canceled
                type: string
                enum:
                  - cancel-newest
                  - cancel-oldest
                  - cancel-both
                default: cancel-newest
              oflags:
                $ref: '#/components/schemas/oflags'
              timeinforce:
                description: >
                  Time-in-force of the order to specify how long it should
                  remain in the order book before being cancelled. GTC
                  (Good-'til-cancelled) is default if the parameter is omitted.
                  IOC (immediate-or-cancel) will immediately execute the amount
                  possible and cancel any remaining balance rather than resting
                  in the book. GTD (good-'til-date), if specified, must coincide
                  with a desired `expiretm`.
                type: string
                enum:
                  - GTC
                  - IOC
                  - GTD
                default: GTC
              starttm:
                description: >
                  Scheduled start time, can be specified as an absolute
                  timestamp or as a number of seconds in the future:
                   * `0` now (default)
                   * `+<n>` schedule start time <n> seconds from now
                   * `<n>` = unix timestamp of start time
                type: string
              expiretm:
                description: >
                  Expiry time on GTD orders can be set up to one month in
                  future, it is specified as an absolute timestamp or as a
                  number of seconds from now:
                   * `0` no expiration (default)
                   * `+<n>` = expire <n> seconds from now, minimum 5 seconds
                   * `<n>` = unix timestamp of expiration time
                type: string
        pair:
          description: Asset pair `id` or `altname`
          type: string
        asset_class:
          description: >-
            This parameter is required on requests for non-crypto pairs, i.e.
            use `tokenized_asset` for xstocks.
          type: string
          enum:
            - tokenized_asset
        deadline:
          type: string
          description: >
            RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the
            matching engine should reject the new order request, in presence of
            latency or order queueing. min now() + 2 seconds, max now() + 60
            seconds. 
        validate:
          type: boolean
          description: Validate inputs only. Do not submit order.
          default: false
        broker:
          description: Broker IIBAN (Partner's Kraken IIBAN)
          type: string
          nullable: true
      example:
        nonce: 1695828490
        orders:
          - close:
              ordertype: stop-loss-limit
              price: '37000'
              price2: '36000'
            ordertype: limit
            price: '40000'
            price2: string
            timeinforce: GTC
            type: buy
            cl_ord_id: 6d1b345e-2821-40e2-ad83-4ecb18a06876
            volume: '1.2'
          - ordertype: limit
            price: '42000'
            starttm: string
            timeinforce: GTC
            type: sell
            cl_ord_id: da8e4ad59b78481c93e589746b0cf91
            volume: '1.2'
        pair: BTC/USD
        validate: false
        deadline: '2023-09-24T14:15:22Z'
    batchadd-2:
      type: object
      properties:
        result:
          title: Result
          type: object
          properties:
            orders:
              title: Orders
              type: array
              items:
                type: object
                properties:
                  descr:
                    description: Order description info
                    type: object
                    properties:
                      order:
                        type: string
                  error:
                    description: Error description from individual order processing
                    type: string
                  txid:
                    description: >
                      Transaction ID for order

                      <br><sup><sub>(if order was added
                      successfully)</sup></sub>
                    type: string
        error:
          type: array
          items:
            $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          orders:
            - txid: 65LRD3-AHGRA-YAH8E5
              descr:
                order: buy 1.02010000 XBTUSD @ limit 29000.0
            - txid: OK8HFF-5J2PL-XLR17S
              descr:
                order: sell 0.14000000 XBTUSD @ limit 40000.0
    batchcancel:
      title: Batch Cancel Open Orders Request Body
      required:
        - nonce
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        orders:
          type: array
          items:
            type: object
            properties:
              txid:
                description: >-
                  Open order transaction IDs (txid) or user references
                  (userref), up to a maximum of 50 total unique IDs/references.
                oneOf:
                  - type: string
                    title: string
                  - type: integer
                    title: integer
        cl_ord_ids:
          type: array
          items:
            type: object
            properties:
              cl_ord_id:
                description: >-
                  An alphanumeric client order identifier which uniquely
                  identifies an open order for each client. Up to a maximum of
                  50 total unique IDs/references.
                type: string
      example:
        nonce: 1695828490
        orders:
          - OP5V2Y-RYKVL-ET3V3B
          - OP5V2Y-7YKVL-ET3V3B
    edit:
      title: Edit Standard Order Request Body
      required:
        - nonce
        - pair
        - txid
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        userref:
          description: >
            User reference id


            `userref` is an optional user-specified integer id associated with
            edit request. 
             >  Note: userref from parent order will not be retained on the new order after edit.
          type: integer
          format: int32
        txid:
          description: >-
            Original Order ID or User Reference Id (userref) which is
            user-specified integer id used with the original order. If userref
            is not unique and was used with multiple order, edit request is
            denied with an error.
          oneOf:
            - type: string
              title: string
            - type: integer
              title: integer
        volume:
          description: |
            Order quantity in terms of the base asset.
          type: string
        displayvol:
          description: >
            For `iceberg` orders only, it defines the quantity to show in the
            book while the rest of order quantity remains hidden. Minimum value
            is 1 / 15 of `volume`.
          type: string
        pair:
          description: Asset pair `id` or `altname`
          type: string
        asset_class:
          description: >-
            This parameter is required on requests for non-crypto pairs, i.e.
            use `tokenized_asset` for xstocks.
          type: string
          enum:
            - tokenized_asset
        price:
          description: >
            Price:

            * Limit price for `limit` and `iceberg` orders

            * Trigger price for `stop-loss`, `stop-loss-limit`, `take-profit`,
            `take-profit-limit`, `trailing-stop` and `trailing-stop-limit`
            orders


            Notes:

            * Relative Prices: Either `price` or `price2` can be preceded by
            `+`, `-`, or `#` to specify the order price as an offset relative to
            the last traded price. `+` adds the amount to, and `-` subtracts the
            amount from the last traded price. `#` will either add or subtract
            the amount to the last traded price, depending on the direction and
            order type used. Prices can also be suffixed with a `%` to signify
            the relative amount as a percentage, rather than an absolute price
            difference.

            * Trailing Stops: Must use a relative price for this field, namely
            the `+` prefix, from which the direction will be automatic based on
            if the original order is a buy or sell (no need to use `-` or `#`).
            The `%` suffix also works for these order types to use a relative
            percentage price.
          type: string
        price2:
          description: >
            Secondary Price:

            * Limit price for `stop-loss-limit`, `take-profit-limit` and
            `trailing-stop-limit` orders

            Note:

            * Trailing Stops: Must use a relative price for this field, namely
            one of the `+` or `-` prefixes. This will provide the offset from
            the trigger price to the limit price, i.e. +0 would set the limit
            price equal to the trigger price. The `%` suffix also works for this
            field to use a relative percentage limit price.
          type: string
        oflags:
          description: >
            Comma delimited list of order flags. Only these flags can be
            changed: - post post-only order (available when ordertype = limit).
            All the flags from the parent order are retained except post-only.
            post-only needs to be explicitly mentioned on edit request.
        deadline:
          type: string
          description: >
            RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the
            matching engine should reject the new order request, in presence of
            latency or order queueing. min now() + 2 seconds, max now() + 60
            seconds.  
        cancel_response:
          description: >
            Used to interpret if client wants to receive pending replace, before
            the order is completely replaced
          type: boolean
        validate:
          type: boolean
          description: Validate inputs only. Do not submit order.
          default: false
      example:
        nonce: 1695828490
        pair: XBTUSD
        txid: OHYO67-6LP66-HMQ437
        volume: '1.25'
        price: '27500'
        price2: '26500'
    edit-2:
      type: object
      properties:
        result:
          title: OrderEdited
          type: object
          properties:
            descr:
              description: Order description info
              type: object
              properties:
                order:
                  description: Order description
                  type: string
            txid:
              description: |
                New Transaction ID
                <br><sup><sub>(if order was added successfully)</sup></sub>
              type: string
            newuserref:
              description: |
                Original userref if passed with the request
              type: string
            olduserref:
              description: |
                Original userref if passed with the request
              type: string
            orders_cancelled:
              description: |
                Number of orders cancelled (either 0 or 1)
              type: integer
            originaltxid:
              description: |
                Original transaction ID
              type: string
            status:
              description: |
                Status of the order: Ok or Err
              type: string
            volume:
              description: |
                Updated volume
              type: string
            price:
              description: |
                Updated price
              type: string
            price2:
              description: |
                Updated price2
              type: string
            error_message:
              description: |
                Error message if unsuccessful
              type: string
        error:
          type: array
          items:
            $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          descr:
            order: buy 1.25000000 XBTUSD @ limit 27500.0
          txid: OU22CG-KLAF2-FWUDD7
    methods:
      title: Get Desposit Methods Request Body
      required:
        - nonce
        - asset
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Asset being deposited
          type: string
        aclass:
          description: Asset class being deposited (optional)
          type: string
          enum:
            - currency
            - tokenized_asset
          default: currency
        rebase_multiplier:
          type: string
          enum:
            - rebased
            - base
          default: rebased
          nullable: true
          description: |
            Optional parameter for viewing xstocks data. 
            - `rebased`: Display in terms of underlying equity.
            - `base`: Display in terms of SPV tokens.
      example:
        nonce: 1695828271
        asset: XBT
    method:
      title: depositMethod
      description: Deposit Method
      type: object
      properties:
        method:
          description: Name of deposit method
          type: string
        limit:
          description: >-
            Maximum net amount that can be deposited right now, or false if no
            limit
        fee:
          description: Amount of fees that will be paid (flat fee)
          type: string
        fee-percentage:
          description: >-
            Percentage fee that will be paid (used instead of `fee` for some
            methods, e.g. Lightning)
          type: string
        address-setup-fee:
          description: Whether or not method has an address setup fee
          type: string
        gen-address:
          type: boolean
          description: Whether new addresses can be generated for this method.
        minimum:
          type: string
          description: Minimum net amount that can be deposited right now
    methods-2:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/method'
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          - method: Bitcoin
            limit: false
            fee: '0.0000000000'
            gen-address: true
            minimum: '0.00010000'
          - method: Bitcoin Lightning
            limit: false
            fee: '0.00000000'
            minimum: '0.00010000'
    addresses:
      required:
        - nonce
        - asset
        - method
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Asset being deposited
          type: string
        aclass:
          description: Asset class being deposited
          type: string
          enum:
            - currency
            - tokenized_asset
          default: currency
        method:
          description: Name of the deposit method
          type: string
        new:
          description: Whether or not to generate a new address
          type: boolean
          default: false
        amount:
          description: >-
            Amount you wish to deposit (only required for `method=Bitcoin
            Lightning`)
          oneOf:
            - type: string
              title: string
            - type: integer
              title: integer
            - type: number
              title: number
      example:
        nonce: 1695828271
        asset: XBT
        method: Bitcoin
        new: true
    address:
      title: depositAddress
      description: Deposit Address
      type: object
      properties:
        address:
          description: Deposit Address
          type: string
        expiretm:
          description: Expiration time in unix timestamp, or 0 if not expiring
          type: string
        new:
          description: Whether or not address has ever been used
          type: boolean
        tag:
          description: >-
            Contains tags for
            [XRP](https://support.kraken.com/hc/en-us/articles/360000184443-Destination-Tag-for-Ripple-XRP-deposits)
            deposit addresses and memos for
            [STX](https://support.kraken.com/hc/en-us/articles/10902306995860-Memo-for-Stacks-STX-deposits),
            [XLM](https://support.kraken.com/hc/en-us/articles/360000184543-Memo-for-Stellar-Lumens-XLM-deposits),
            and
            [EOS](https://support.kraken.com/hc/en-us/articles/360001099203-Memo-for-EOS-deposits)
            deposit addresses
          type: string
    addresses-2:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/address'
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          - address: 2N9fRkx5JTWXWHmXzZtvhQsufvoYRMq9ExV
            expiretm: '0'
            new: true
          - address: 2NCpXUCEYr8ur9WXM1tAjZSem2w3aQeTcAo
            expiretm: '0'
            new: true
          - address: 2Myd4eaAW96ojk38A2uDK4FbioCayvkEgVq
            expiretm: '0'
          - address: rLHzPsX3oXdzU2qP17kHCH2G4csZv1rAJh
            expiretm: '0'
            new: true
            tag: '1361101127'
          - address: krakenkraken
            expiretm: '0'
            memo: '4150096490'
    recent:
      title: Get Status of Recent Deposits Request Body
      required:
        - nonce
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Filter for specific asset being deposited
          type: string
        aclass:
          description: Filter for specific asset class being deposited
          type: string
          enum:
            - currency
            - tokenized_asset
          default: currency
        method:
          description: Filter for specific name of deposit method
          type: string
        start:
          description: >-
            Start timestamp, deposits created strictly before will not be
            included in the response
          type: string
        end:
          description: >-
            End timestamp, deposits created strictly after will be not be
            included in the response
          type: string
        cursor:
          description: >-
            true/false to enable/disable paginated response (boolean) or cursor
            for next page of results (string)
          default: false
          anyOf:
            - type: boolean
              description: Enable/disable paginated response
            - type: string
              description: Cursor for next page of results
        limit:
          description: Number of results to include per page
          type: integer
          default: 25
        rebase_multiplier:
          type: string
          enum:
            - rebased
            - base
          default: rebased
          nullable: true
          description: |
            Optional parameter for viewing xstocks data. 
            - `rebased`: Display in terms of underlying equity.
            - `base`: Display in terms of SPV tokens.
      example:
        nonce: 1695828271
        asset: XBT
        method: Bitcoin
    deposit:
      title: deposit
      description: deposit
      type: object
      properties:
        method:
          description: Name of deposit method
          type: string
        aclass:
          description: Asset class
          type: string
        asset:
          description: Asset
          type: string
        refid:
          description: Reference ID
          type: string
        txid:
          description: Method transaction ID
          type: string
        info:
          description: Method transaction information
          type: string
        amount:
          description: Amount deposited
          type: string
        fee:
          description: Fees paid
        time:
          description: Unix timestamp when request was made
          type: integer
          format: int32
        status:
          description: >
            Status of deposit<br>

            <sup><sub>For additional information about the status, please refer
            to the [IFEX financial transaction
            states](https://github.com/globalcitizen/ifex-protocol/blob/master/draft-ifex-00.txt#L837).</sup></sub>
          type: string
          enum:
            - Initial
            - Pending
            - EarlyConfirmed
            - Settled
            - Success
            - Failure
        status-prop:
          description: |
            Addition status properties <sup><sub>(if available)</sup></sub><br>
              * `return` A return transaction initiated by Kraken
              * `onhold` Deposit is on hold pending review
          type: string
          enum:
            - return
            - onhold
        originators:
          description: >
            Client sending transaction id(s) for deposits that credit with a
            sweeping transaction
          type: array
          items:
            type: string
    recent-2:
      type: object
      properties:
        result:
          anyOf:
            - $ref: '#/components/schemas/deposit'
            - properties:
                deposit:
                  $ref: '#/components/schemas/deposit'
                next_cursor:
                  description: >-
                    If pagination is set via `cursor` parameter, provides next
                    input to use for `cursor` in pagination
                  type: string
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          - method: Bitcoin
            aclass: currency
            asset: XXBT
            refid: FTQcuak-V6Za8qrWnhzTx67yYHz8Tg
            txid: 6544b41b607d8b2512baf801755a3a87b6890eacdb451be8a94059fb11f0a8d9
            info: 2Myd4eaAW96ojk38A2uDK4FbioCayvkEgVq
            amount: '0.78125000'
            fee: '0.0000000000'
            time: 1688992722
            status: Success
            status-prop: return
          - method: Ether (Hex)
            aclass: currency
            asset: XETH
            refid: FTQcuak-V6Za8qrPnhsTx47yYLz8Tg
            txid: '0x339c505eba389bf2c6bebb982cc30c6d82d0bd6a37521fa292890b6b180affc0'
            info: '0xca210f4121dc891c9154026c3ae3d1832a005048'
            amount: '0.1383862742'
            time: 1688992722
            status: Settled
            status-prop: onhold
            originators:
              - >-
                0x70b6343b104785574db2c1474b3acb3937ab5de7346a5b857a78ee26954e0e2d
              - >-
                0x5b32f6f792904a446226b17f607850d0f2f7533cdc35845bfe432b5b99f55b66
    methods-3:
      required:
        - nonce
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Filter methods for specific asset
          type: string
        aclass:
          description: Filter methods for specific asset class
          type: string
          enum:
            - currency
            - tokenized_asset
          default: currency
        network:
          description: Filter methods for specific network
          type: string
        rebase_multiplier:
          type: string
          enum:
            - rebased
            - base
          default: rebased
          nullable: true
          description: |
            Optional parameter for viewing xstocks data. 
            - `rebased`: Display in terms of underlying equity.
            - `base`: Display in terms of SPV tokens.
    methods-4:
      type: object
      properties:
        result:
          title: withdrawalMethods
          description: Withdrawal Methods
          type: array
          items:
            type: object
            properties:
              asset:
                description: Name of asset being withdrawn
                type: string
              method:
                description: Name of the withdrawal method
                type: string
              method_id:
                description: Unique identifier for the withdrawal method
                type: string
              network:
                description: Name of the blockchain or network being withdrawn on
                type: string
              network_id:
                description: Unique identifier for the network
                type: string
              minimum:
                description: Minimum net amount that can be withdrawn right now
                type: string
              fee:
                description: Fee details for this withdrawal method
                type: object
                properties:
                  aclass:
                    description: Asset class of the fee
                    type: string
                  asset:
                    description: Asset used for the fee
                    type: string
                  fee:
                    description: Flat fee amount
                    type: string
                  fee_percentage:
                    description: >-
                      Percentage fee (present instead of flat fee for some
                      methods)
                    type: string
              limits:
                description: Rate limit details for this withdrawal method
                type: array
                items:
                  type: object
                  properties:
                    description:
                      type: string
                    limit_type:
                      type: string
                    limits:
                      type: object
                      description: Limits keyed by time window in seconds
                      additionalProperties:
                        type: object
                        properties:
                          maximum:
                            type: string
                          remaining:
                            type: string
                          used:
                            type: string
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          - asset: XXBT
            method: Bitcoin
            method_id: 12fca2ad-edae-4d8c-acbb-4a424c1fbdeb
            network: Bitcoin
            network_id: ee9d686d-aeb6-4e61-9d83-448e3a7511f3
            minimum: '0.0004'
            fee:
              aclass: currency
              asset: XXBT
              fee: '0.00001500'
          - asset: XXBT
            method: Bitcoin Lightning
            method_id: 1ac8da36-8eec-4ed0-977a-82e4b50f2e49
            network: Lightning
            network_id: 03ed9b12-29f1-4dc3-8d05-bd58e3798518
            minimum: '0.00001'
            fee:
              aclass: currency
              asset: XXBT
              fee: '0'
              fee_percentage: '0.1'
    addresses-3:
      required:
        - nonce
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Filter addresses for specific asset
          type: string
        aclass:
          description: Filter addresses for specific asset class
          type: string
          enum:
            - currency
            - tokenized_asset
          default: currency
        method:
          description: Filter addresses for specific method
          type: string
        key:
          description: Find address for by withdrawal key name, as set up on your account
          type: string
        verified:
          description: >-
            Filter by verification status of the withdrawal address. Withdrawal
            addresses successfully completing email confirmation will have a
            verification status of true.
          type: boolean
    addresses-4:
      type: object
      properties:
        result:
          title: withdrawalAddresses
          description: Withdrawal Addresses
          type: array
          items:
            type: object
            properties:
              address:
                description: Withdrawal address
                type: string
              asset:
                description: Name of asset being withdrawn
                type: string
              method:
                description: Name of the withdrawal method
                type: string
              key:
                description: Withdrawal key name, as set up on your account
                type: string
              tag:
                description: >-
                  Contains tags for
                  [XRP](https://support.kraken.com/hc/en-us/articles/360000184443-Destination-Tag-for-Ripple-XRP-deposits)
                  deposit addresses and memos for
                  [STX](https://support.kraken.com/hc/en-us/articles/10902306995860-Memo-for-Stacks-STX-deposits),
                  [XLM](https://support.kraken.com/hc/en-us/articles/360000184543-Memo-for-Stellar-Lumens-XLM-deposits),
                  and
                  [EOS](https://support.kraken.com/hc/en-us/articles/360001099203-Memo-for-EOS-deposits)
                  deposit addresses
                type: string
              verified:
                description: Verification status of withdrawal address
                type: boolean
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          - address: bc1qxdsh4sdd29h6ldehz0se5c61asq8cgwyjf2y3z
            asset: XBT
            method: Bitcoin
            key: btc-wallet-1
            verified: true
    info-4:
      required:
        - nonce
        - asset
        - key
        - amount
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Asset being withdrawn
          type: string
        key:
          description: Withdrawal key name, as set up on your account
          type: string
        amount:
          description: Amount to be withdrawn
          type: string
      example:
        nonce: 1695828271
        asset: XBT
        key: btc_testnet
        amount: '0.725'
    info-5:
      type: object
      properties:
        result:
          title: withdrawalInfo
          description: Withdrawal Info
          type: object
          properties:
            method:
              description: Name of the withdrawal method that will be used
              type: string
            limit:
              description: Maximum net amount that can be withdrawn right now
              type: string
            amount:
              description: Net amount that will be sent, after fees
              type: string
            fee:
              description: Amount of fees that will be paid
              type: string
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          method: Bitcoin
          limit: '332.00956139'
          amount: '0.72485000'
          fee: '0.00020000'
    withdrawal:
      required:
        - nonce
        - asset
        - key
        - amount
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Asset being withdrawn
          type: string
        aclass:
          description: Specify the asset class of the asset being withdrawn
          type: string
          enum:
            - currency
            - tokenized_asset
          default: currency
        key:
          description: Withdrawal key name, as set up on your account
          type: string
        address:
          description: >-
            Optional, crypto address that can be used to confirm address matches
            key (will return `Invalid withdrawal address` error if different)
          type: string
        amount:
          description: Amount to be withdrawn
          type: string
        max_fee:
          description: >-
            Optional, if the processed withdrawal fee is higher than `max_fee`,
            withdrawal will fail with `EFunding:Max fee exceeded`
          type: string
        rebase_multiplier:
          type: string
          enum:
            - rebased
            - base
          default: rebased
          nullable: true
          description: |
            Optional parameter for viewing xstocks data. 
            - `rebased`: Display in terms of underlying equity.
            - `base`: Display in terms of SPV tokens.
      example:
        nonce: 1695828271
        asset: XBT
        key: btc_2709
        amount: '0.725'
        address: bc1kar0ssrr7xf3vy5l6d3lydnwkre5og2zz3f5ldq
    withdrawal-2:
      type: object
      properties:
        result:
          type: object
          properties:
            refid:
              type: string
              description: Reference ID
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          refid: FTQcuak-V6Za8qrWnhzTx67yYHz8Tg
    recent-3:
      title: Get Status of Recent Withdrawals Request Body
      required:
        - nonce
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Filter for specific asset being withdrawn
          type: string
        aclass:
          description: Filter for specific asset class being withdrawn
          type: string
          enum:
            - currency
            - tokenized_asset
          default: currency
        method:
          description: Filter for specific name of withdrawal method
          type: string
        start:
          description: >-
            Start timestamp, withdrawals created strictly before will not be
            included in the response
          type: string
        end:
          description: >-
            End timestamp, withdrawals created strictly after will be not be
            included in the response
          type: string
        cursor:
          description: >-
            true/false to enable/disable paginated response (boolean) or cursor
            for next page of results (string), default false
          anyOf:
            - type: boolean
              description: Enable/disable paginated response
            - type: string
              description: Cursor for next page of results
        limit:
          description: Number of results to include per page
          type: integer
          default: 500
        rebase_multiplier:
          type: string
          enum:
            - rebased
            - base
          default: rebased
          nullable: true
          description: |
            Optional parameter for viewing xstocks data. 
            - `rebased`: Display in terms of underlying equity.
            - `base`: Display in terms of SPV tokens.
      example:
        nonce: 1695828271
        asset: XBT
        method: bitcoin
    withdrawal-3:
      title: Withdrawal
      description: Withdrawal
      type: object
      properties:
        method:
          description: Name of withdrawal method
          type: string
        network:
          description: Network name based on the funding method used
          type: string
        aclass:
          description: Asset class
          type: string
        asset:
          description: Asset
          type: string
        refid:
          description: Reference ID
          type: string
        txid:
          description: Method transaction ID
          type: string
        info:
          description: Method transaction information
          type: string
        amount:
          description: Amount withdrawn
          type: string
        fee:
          description: Fees paid
        time:
          description: Unix timestamp when request was made
          type: integer
          format: int32
        status:
          description: >
            Status of withdraw<br>

            <sup><sub>For information about the status, please refer to the
            [IFEX financial transaction
            states](https://github.com/globalcitizen/ifex-protocol/blob/master/draft-ifex-00.txt#L837).</sup></sub>
          type: string
          enum:
            - Initial
            - Pending
            - Settled
            - Success
            - Failure
        status-prop:
          description: |
            Addition status properties <sup><sub>(if available)</sup></sub><br>
              * `cancel-pending` cancelation requested
              * `canceled` canceled
              * `cancel-denied` cancelation requested but was denied
              * `return` a return transaction initiated by Kraken; it cannot be canceled
              * `onhold` withdrawal is on hold pending review
          type: string
          enum:
            - cancel-pending
            - canceled
            - cancel-denied
            - return
            - onhold
        key:
          description: Withdrawal key name, as set up on your account
          type: string
    recent-4:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/withdrawal-3'
        error:
          $ref: '#/components/schemas/error'
      example:
        error: []
        result:
          - method: Bitcoin
            aclass: currency
            asset: XXBT
            refid: FTQcuak-V6Za8qrWnhzTx67yYHz8Tg
            txid: 29323ce235cee8dae22503caba7....8ad3a506879a03b1e87992923d80428
            info: bc1qm32pq....3ewt0j37s2g
            amount: '0.72485000'
            fee: '0.00020000'
            time: 1688014586
            status: Pending
            key: btc-wallet-1
          - method: Bitcoin
            aclass: currency
            asset: XXBT
            refid: FTQcuak-V6Za8qrPnhsTx47yYLz8Tg
            txid: 29323ce212ceb2daf81255cbea8a5...ad7a626471e05e1f82929501e82934
            info: bc1qa35ls....3egf0872h3w
            amount: '0.72485000'
            fee: '0.00020000'
            time: 1688015423
            status: Failure
            status-prop: canceled
            key: btc-wallet-2
    cancel-3:
      title: Request Withdrawal Cancelation Request Body
      required:
        - nonce
        - asset
        - refid
      type: object
      properties:
        nonce:
          $ref: '#/components/schemas/nonce'
        asset:
          description: Asset being withdrawn
          type: string
        refid:
          description: Withdrawal reference ID
          type: string
      example:
        nonce: 1695828271
        asset: XBT
        refid: FTQcuak-V6Za8qrWnhzTx67yYHz8Tg
    pre-trade:
      title: PreTradeResponse
      type: object
      properties:
        result:
          description: An aggregated order book.
          type: object
          properties:
            symbol:
              type: string
              maxLength: 32
              description: The symbol of the currency pair.
              example: BTC/USD
            description:
              type: string
              maxLength: 350
              description: The full description of the currency pair.
              example: Bitcoin / US Dollars
            base_asset:
              type: string
              format: ISO 4217
              description: Currency code for the base asset.
              example: BTC
            base_dti_code:
              type: string
              description: Digital Token Identifier (DTI) code for the base asset.
            base_dti_short_name:
              type: string
              description: DTI short name for the base asset.
            quote_dti_code:
              type: string
              description: Digital Token Identifier (DTI) code for the quote asset.
            quote_dti_short_name:
              type: string
              description: DTI short name for the quote asset.
            base_notation:
              type: string
              description: Indicates how the quantity is expressed.
              enum:
                - UNIT
                - NOML
            quote_asset:
              type: string
              format: ISO 4217
              description: Currency in which the trading price is expressed.
              example: USD
            quote_notation:
              type: string
              description: Indicates that the price is expressed in monetary value.
              enum:
                - MONE
            venue:
              type: string
              format: ISO 10383
              description: >-
                Market Identifier Code (MIC) of the trading platform where the
                order was submitted.
              enum:
                - PGSL
            system:
              type: string
              description: Indicates the order system is a Central Limit Order Book.
              enum:
                - CLOB
            bids:
              type: array
              items:
                type: object
                properties:
                  side:
                    type: string
                    description: >-
                      Indicates whether the price level is a bid (BUY) or offer
                      (SELL).
                    enum:
                      - BUY
                  price:
                    type: string
                    description: Price level in the Central Limit Order Book (CLOB).
                    example: '102002.1'
                  qty:
                    type: string
                    description: The aggregated quantity at the price level.
                    example: '102002.1'
                  count:
                    type: integer
                    description: The number of orders in the price level.
                    minLength: 1
                  submission_ts:
                    type: string
                    format: ISO 8601
                    description: Timestamp the order at this price level was submitted.
                    example: '2024-05-30T12:34:56.123456Z'
                  publication_ts:
                    type: string
                    format: ISO 8601
                    description: Timestamp the price level was last updated and published.
                    example: '2024-05-30T12:34:56.123456Z'
            asks:
              type: array
              items:
                type: object
                properties:
                  side:
                    type: string
                    description: >-
                      Indicates whether the price level is a bid (BUY) or offer
                      (SELL).
                    enum:
                      - SELL
                  price:
                    type: string
                    description: Price level in the Central Limit Order Book (CLOB).
                    example: '102002.1'
                  qty:
                    type: string
                    description: The aggregated quantity at the price level.
                    example: '102002.1'
                  count:
                    type: integer
                    description: The number of orders in the price level.
                    minLength: 1
                  submission_ts:
                    type: string
                    format: ISO 8601
                    description: Timestamp the order at this price level was submitted.
                    example: '2024-05-30T12:34:56.123456Z'
                  publication_ts:
                    type: string
                    format: ISO 8601
                    description: Timestamp the price level was last updated and published.
                    example: '2024-05-30T12:34:56.123456Z'
        error:
          $ref: '#/components/schemas/error'
    post-trade:
      title: PostTradeResponse
      description: >-
        A list of trades. A maximum of `count` trades will be returned in a
        single query, as specified in the query parameters.
      type: object
      properties:
        result:
          type: object
          properties:
            last_ts:
              type: string
              format: ISO 8601
              description: >
                Timestamp of the latest trade in the list. 

                This field can be used as the `from_ts` parameter when
                requesting the next batch of trades.
              example: '2024-05-30T12:34:56.123456789Z'
            count:
              type: integer
              description: The number of trades returned.
              minimum: 0
              maximum: 1000
            trades:
              type: array
              description: A list of trades in ascending timestamp order.
              items:
                type: object
                format: Trade
                minItems: 0
                maxItems: 1000
                properties:
                  trade_id:
                    type: string
                    maxLength: 19
                    description: Kraken unique trade identifier.
                    example: TGBB7L-HT5LX-J3BZ4A
                  price:
                    type: string
                    description: Trade price excluding fees and commissions.
                    example: '102002.1'
                  quantity:
                    type: string
                    description: Unconsolidated trade quantity from execution.
                    example: '1.24'
                  symbol:
                    type: string
                    maxLength: 32
                    description: The symbol of the currency pair.
                    example: BTC/USD
                  description:
                    type: string
                    maxLength: 350
                    description: The full description of the currency pair.
                    example: Bitcoin / US Dollars
                  base_asset:
                    type: string
                    format: ISO 4217
                    description: Currency code for the base asset.
                    example: BTC
                  base_notation:
                    type: string
                    description: Indicates that the quantity is expressed in nominal value.
                    enum:
                      - UNIT
                  quote_asset:
                    type: string
                    format: ISO 4217
                    description: Currency in which the trading price is expressed.
                    example: USD
                  quote_notation:
                    type: string
                    description: Indicates that the price is expressed in monetary value.
                    enum:
                      - MONE
                  trade_venue:
                    type: string
                    format: ISO 10383
                    maxLength: 12
                    description: >-
                      Market Identifier Code (MIC) of the trading platform where
                      the trade was executed.
                    example: PGSL
                  trade_ts:
                    type: string
                    format: ISO 8601
                    description: >-
                      Timestamp the trade was matched in the engine to
                      microsecond precision.
                    example: '2024-05-30T12:34:56.123456789Z'
                  publication_venue:
                    type: string
                    format: ISO 10383
                    maxLength: 12
                    description: >-
                      Market Identifier Code (MIC) of the trading platform where
                      the trade was published.
                    example: PGSL
                  publication_ts:
                    type: string
                    format: ISO 8601
                    description: Timestamp the trade was published to market data streams.
                    example: '2024-05-30T12:34:56.123456789Z'
        error:
          $ref: '#/components/schemas/error'
  parameters:
    assetVersion:
      in: query
      name: assetVersion
      required: false
      schema:
        type: integer
        enum:
          - 1
      description: >
        Controls whether response keys and asset identifier fields use Kraken's
        internal names or display names.


        * Omitted (default): internal names are used. Asset keys use legacy
        `X`/`Z`-prefixed format (`XXBT`, `ZUSD`). Pair keys use the internal
        format (`XXBTZUSD`). Asset identifier fields (`base`, `quote`,
        `fee_volume_currency`) also use internal names.

        * `assetVersion=1`: display names are used. Asset keys become their
        canonical display names (`BTC`, `USD`). Pair keys become the
        slash-separated display format (`BTC/USD`). On `/public/AssetPairs`, the
        `base`, `quote`, and `fee_volume_currency` fields also switch to display
        names.


        Only `assetVersion=1` is currently supported. The `altname` and `wsname`
        fields are not affected by this parameter.
    asset:
      in: query
      name: asset
      schema:
        type: string
      description: >-
        Comma delimited list of assets to get info on (optional, default all
        available assets)
      example: XBT,ETH
    aclass:
      in: query
      name: aclass
      schema:
        type: string
        enum:
          - currency
          - tokenized_asset
        default: currency
      description: |
        Filters the asset class to retrieve (optional)
          * `currency` = spot currency pairs.
          * `tokenized_asset` = xstocks.
    wildcard_pair:
      in: query
      name: pair
      description: >-
        Asset pair to get data for (optional, default: all tradeable exchange
        pairs)
      required: false
      schema:
        type: string
      example: XBTUSD
    pair:
      in: query
      name: pair
      description: Asset pair to get data for
      required: true
      schema:
        type: string
      example: XBTUSD
    asset_class:
      name: asset_class
      in: query
      description: >-
        This parameter is required on requests for non-crypto pairs, i.e. use
        `tokenized_asset` for xstocks.
      required: false
      schema:
        type: string
        enum:
          - tokenized_asset
  requestBodies:
    balance:
      required: true
      content:
        application/json:
          schema:
            title: Update Account Profile Request
            description: Update Account Profile Request Body
            required:
              - nonce
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              asset:
                description: Base asset used to determine balance
                type: string
                default: ZUSD
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1695828490
              asset: ZUSD
    openOrders:
      required: true
      content:
        application/json:
          schema:
            title: Get Open Orders Request Body
            required:
              - nonce
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              trades:
                description: Whether or not to include trades related to position in output
                type: boolean
                default: false
              userref:
                description: Restrict results to given user reference
                type: integer
                format: int32
              cl_ord_id:
                description: Restrict results to given client order id
                type: string
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1234567
              trades: true
              cl_ord_id: 9cc788d8-9c00-4b25-94d3-26d93603948d
    closedOrders:
      required: true
      content:
        application/json:
          schema:
            title: Get Closed Orders Request Body
            required:
              - nonce
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              trades:
                description: Whether or not to include trades related to position in output
                type: boolean
                default: false
              userref:
                description: Restrict results to given user reference
                type: integer
                format: int32
              cl_ord_id:
                description: Restrict results to given client order id
                type: string
              start:
                description: Starting unix timestamp or order tx ID of results (exclusive)
                type: integer
              end:
                description: Ending unix timestamp or order tx ID of results (inclusive)
                type: integer
              ofs:
                description: Result offset for pagination
                type: integer
              closetime:
                description: Which time to use to search
                type: string
                enum:
                  - open
                  - close
                  - both
                default: both
              consolidate_taker:
                description: >-
                  Whether or not to consolidate trades by individual taker
                  trades
                type: boolean
                default: true
              without_count:
                description: >-
                  Whether or not to include page count in result (`true` is much
                  faster for users with many closed orders)
                type: boolean
                default: false
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1234567
              trades: true
              cl_ord_id: 9cc788d8-9c00-4b25-94d3-26d93603948d
              start: 1695728276
              end: 1695828276
              closetime: open
    history:
      required: true
      content:
        application/json:
          schema:
            title: Get Trades History Request Body
            required:
              - nonce
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              type:
                description: Type of trade
                type: string
                default: all
                enum:
                  - all
                  - any position
                  - closed position
                  - closing position
                  - no position
              trades:
                description: Whether or not to include trades related to position in output
                type: boolean
                default: false
              start:
                description: Starting unix timestamp or trade tx ID of results (exclusive)
                type: integer
              end:
                description: Ending unix timestamp or trade tx ID of results (inclusive)
                type: integer
              ofs:
                description: Result offset for pagination
                type: integer
              without_count:
                description: >-
                  If true, does not retrieve count of ledger entries. Request
                  can be noticeably faster for users with many ledger entries as
                  this avoids an extra database query.
                type: boolean
                default: false
              consolidate_taker:
                description: >-
                  Whether or not to consolidate trades by individual taker
                  trades
                type: boolean
                default: true
              ledgers:
                description: >
                  Whether or not to include related ledger ids for given trade

                  <br><sub><sup>Note that setting this to true will slow request
                  performance</sub></sup>
                type: boolean
                default: false
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1695828490
              type: all
              trades: false
              consolidate_taker: true
    query:
      required: true
      content:
        application/json:
          schema:
            title: Get Trades Info Request Body
            required:
              - nonce
              - txid
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              txid:
                description: >-
                  Comma delimited list of transaction IDs to query info about
                  (20 maximum)
                type: string
              trades:
                description: Whether or not to include trades related to position in output
                type: boolean
                default: false
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1695828490
              txid: L2QE42-IGSZ3-WEVTLK, STMH53C-C54CG-4SO42I
              trades: false
    info:
      required: true
      content:
        application/json:
          schema:
            title: Get Ledgers Info Request Body
            required:
              - nonce
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              asset:
                description: Filter output by asset or comma delimited list of assets
                type: string
                default: all
              aclass:
                description: Filter output by asset class
                type: string
                default: currency
              type:
                description: Type of ledger to retrieve
                type: string
                default: all
                enum:
                  - all
                  - trade
                  - deposit
                  - withdrawal
                  - transfer
                  - margin
                  - adjustment
                  - rollover
                  - credit
                  - settled
                  - staking
                  - dividend
                  - sale
                  - nft_rebate
              start:
                description: Starting unix timestamp or ledger ID of results (exclusive)
                type: integer
              end:
                description: Ending unix timestamp or ledger ID of results (inclusive)
                type: integer
              ofs:
                description: Result offset for pagination
                type: integer
              without_count:
                description: >-
                  If true, does not retrieve count of ledger entries. Request
                  can be noticeably faster for users with many ledger entries as
                  this avoids an extra database query.
                type: boolean
                default: false
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1695828490
              type: trade
              start: 1695728276
              end: 1695828276
    query-2:
      required: true
      content:
        application/json:
          schema:
            title: Get Ledger Info Request Body
            required:
              - nonce
              - id
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              id:
                description: >-
                  Comma delimited list of ledger IDs to query info about (20
                  maximum)
                type: string
              trades:
                description: Whether or not to include trades related to position in output
                type: boolean
                default: false
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1695828490
              id: LUI2RA-CJFLB-EN5I4P, L2QE42-IGSZ3-WEVTLK
              trade: false
    volume:
      required: true
      content:
        application/json:
          schema:
            title: Get Trade Volume
            required:
              - nonce
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
              pair:
                description: >
                  Asset pair(s) for which to retrieve fee info (optional, but
                  required if any fee info is desired). Accepts one of the
                  following formats:

                  * A comma-delimited list of pair names — each is looked up as
                  a forex pair.

                  * A list of `{ asset, aclass }` objects (`pairs_with_class`).
                  Required to request fees for non-forex classes such as
                  `equity_pair`, `derivatives`, or `futures_contract`.
                anyOf:
                  - type: string
                    title: Comma-delimited list
                    description: >-
                      Comma-delimited list of pair names, each looked up as a
                      forex pair.
                  - type: array
                    title: List of pairs with class
                    description: >-
                      List of `{ asset, aclass }` objects. Required for
                      non-forex classes.
                    items:
                      type: object
                      required:
                        - asset
                        - aclass
                      properties:
                        asset:
                          description: >-
                            The pair name. All result amounts will be expressed
                            in units of this asset.
                          type: string
                        aclass:
                          description: The asset class of the pair.
                          type: string
                          enum:
                            - currency
                            - forex
                            - equity
                            - equity_pair
                            - nft
                            - derivatives
                            - tokenized_asset
                            - futures_contract
              fee-info:
                description: >-
                  Whether or not to include fee info in the results (legacy
                  parameter, accepted for backwards compatibility).
                default: false
                oneOf:
                  - type: string
                    title: string
                  - type: boolean
                    title: boolean
                  - type: number
                    title: number
              fee_schedule:
                description: >-
                  Whether to include the full fee schedule per trading pair in
                  the response (returned in `schedules`).
                type: boolean
                nullable: true
              rebase_multiplier:
                $ref: '#/components/schemas/rebase_multiplier'
            example:
              nonce: 1695828490
              pair:
                - asset: BTC/USD
                  aclass: forex
                - asset: PF_XBTUSD
                  aclass: derivatives
    nonceOnly:
      required: true
      content:
        application/json:
          schema:
            required:
              - nonce
            type: object
            properties:
              nonce:
                $ref: '#/components/schemas/nonce'
            example:
              nonce: 1695828436
x-tagGroups:
  - name: Public Endpoints
    tags:
      - Market Data
      - Transparency
  - name: Authenticated Endpoints
    tags:
      - Account Data
      - Trading
      - Funding
      - Subaccounts
      - Earn
