####################################################################################################
##
## tradias GmbH WebSocket API
##
asyncapi: 2.6.0
info:
  title: tradias GmbH WebSocket API
  version: v2.1.0
  description: |
    tradias GmbH offers the following websocket APIs:
      * Prices
      * Orders
      * Trades
  license:
    name: tradias GmbH API License
  contact:
    name: tradias GmbH
    url: "https://www.tradias.de"
    email: "info-api@tradias.de"

servers:
  PROD:
    url: "api.tradias.app"
    protocol: wss
    description: PROD Server

defaultContentType: application/json

tags:
  - name: Prices
  - name: Orders
  - name: RFQ

channels:
  /ws/prices:
    publish:
      operationId: PriceSendMessage
      description: Messages processed by Tradias on the Price Channel
      message:
        oneOf:
          - $ref: "#/components/messages/SubscribePriceChannel"
          - $ref: "#/components/messages/UnSubscribeChannel"
          - $ref: "#/components/messages/SubscribeInstruments"
          - $ref: "#/components/messages/UnSubscribeInstruments"

    subscribe:
      operationId: PriceReceiveMessage
      description: Messages sent by Tradias on the Price Channel
      message:
        oneOf:
          - $ref: "#/components/messages/ChannelSubscriptionConfirmation"
          - $ref: "#/components/messages/ChannelSubscriptionError"
          - $ref: "#/components/messages/HeartBeat"
          - $ref: "#/components/messages/PriceUpdate"
          - $ref: "#/components/messages/PriceSubscriptionError"

  /ws/orders:
    publish:
      operationId: OrderSendMessage
      description: Messages processed by Tradias on the Order Channel
      message:
        oneOf:
          - $ref: "#/components/messages/SubscribeOrderChannel"
          - $ref: "#/components/messages/UnSubscribeChannel"
          - $ref: "#/components/messages/NewOrder"
    subscribe:
      operationId: OrderReceiveMessage
      description: Messages sent by Tradias on the Order Channel
      message:
        oneOf:
          - $ref: "#/components/messages/ChannelSubscriptionConfirmation"
          - $ref: "#/components/messages/ChannelSubscriptionError"
          - $ref: "#/components/messages/HeartBeat"
          - $ref: "#/components/messages/OrderExecution"
          - $ref: "#/components/messages/OrderStatusResponse"




####################################################################################################
##
## Price Channel Messages
##
components:
  messages:
    SubscribePriceChannel:
      name: SubscribePriceChannel
      title: Subscribe to a Channel
      summary:
        Message to subscribe to a price channel for this WebSocket. Only one subscription possible
        per WebSocket.
      payload:
        type: object
        required:
          - subscribe_price_channel
        additionalProperties: false
        properties:
          subscribe_price_channel:
            type: object
            required:
              - channel
            additionalProperties: false
            properties:
              channel:
                title: Channel to Subscribe - has to be "prices"
                $ref: "dict.yml#/components/schemas/channel_type"
              heartbeat_interval:
                $ref: "dict.yml#/components/schemas/heartbeat_interval_type"
        example:
          subscribe_price_channel:
            channel: "prices"
            heartbeat_interval: 30

    UnSubscribeChannel:
      name: UnSubscribeChannel
      title: End the Subscription of a Channel
      summary:
        Message to end the subscription for the channel of the current WebSocket connection.
        The channel must match the endpoint you are connected to (prices, orders, rfq). When the
        subscription ends all subscriptions to instruments are also ending. Only one
        subscription is possible per WebSocket.
      payload:
        type: object
        required:
          - unsubscribe_channel
        additionalProperties: false
        properties:
          unsubscribe_channel:
            type: object
            required:
              - channel
            additionalProperties: false
            properties:
              channel:
                title: Channel to Unsubscribe
                description: "Use 'prices' on /ws/prices, 'orders' on /ws/orders and 'rfq' on /ws/rfq"
                $ref: "dict.yml#/components/schemas/channel_type"
        example:
          unsubscribe_channel:
            channel: "<channel>"

    SubscribeInstruments:
      name: SubscribeInstruments
      title: Subscribe to Instrument Prices
      description: >
        This message is used to create subscriptions for prices. In a subscription message it is
        possible to make multiple subscriptions. Each subscription can be unsubscribed individually.


        A subscription gets a subscription_id which uniquely identifies the subscription on the
        channel. The subscription_id is defined by the API user. The concept of a subscription_id
        allows the API user to use an Id he/she can easily check in case of an update, and it also
        allows to have multiple subscriptions to the same instrument with different parameters.


        There are three parameters controlling the sending and merging of updates on the Server
        side.
          * **mergeable** - This boolean parameter defines if updates can be merged on the server
            side when the API client is not reading the channel fast enough. If set to **false**
            no merging will happen, meaning all updates are queued and sent (even delayed) until a
            maximal number of updates is queued, after this number is reached further updates will
            be merged until the number of pending non-merged updates is below the number of maximal
            non-merged updates. This may be useful if the API Client needs a tick by tick list of
            prices.
            If set to **true**, a new price update will overwrite an previous one of the same
            subscription. This merging ensures that no old data are sent to the API client, and in
            case of a slow processing of the messages on the API user side most actual data are
            sent.
          * **max_frequency** - This is a positive integer defining the number of milliseconds
            between two updates of a subscription. If set to **0** all updates will be sent (if not
            merged according to the *mergeable* parameter). To set this parameter to a number bigger
            than 0 is only allowed if *mergeable* is set to *true*. In that case, it is the number
            of milliseconds between two updates of that subscription. If a new update for a
            subscription is received and the last update is less than the max_frequency milliseconds
            ago, the update is put into the queue until the max_frequency milliseconds are over.
            This parameter allows an API user to control the update rate for a subscription.
          * **max_pending** - This is a positive integer defining the maximal number of updates for
            non-mergeable subscriptions. When the API client does not process data fast enough and
            more data are received and queued than can be processed, *max_pending* limits the
            number of pending non-mergeable updates for the subscription. When this number is
            reached, then further updates are merged into the last updated until the number of
            pending updates is again lower than here specified.
      payload:
        type: object
        required:
          - subscribe_instruments
        additionalProperties: false
        properties:
          subscribe_instruments:
            type: object
            required:
              - channel
              - subscriptions
            additionalProperties: false
            properties:
              channel:
                title: Channel to Use
                $ref: "dict.yml#/components/schemas/channel_type"
              subscriptions:
                type: array
                minItems: 1
                maxItems: 999
                description: Array containing a list of subscriptions
                items:
                  title: Subscription
                  type: object
                  required:
                    - subscription_id
                    - instrument
                  additionalProperties: false
                  properties:
                    subscription_id:
                      $ref: "dict.yml#/components/schemas/subscription_id_type"
                    instrument:
                      $ref: "dict.yml#/components/schemas/instrument_type"
                    mergeable:
                      title: Merging Flag
                      type: boolean
                      default: true
                    max_frequency:
                      title: Maximal Update Frequency
                      type: integer
                      minimum: 0
                      maximum: 100000
                      default: 0
                    max_pending:
                      title: Maximal number of pending Updates
                      type: integer
                      minimum: 0
                      maximum: 100000
                      default: 1000
        example:
          subscribe_instruments:
            channel: "prices"
            subscriptions:
              - subscription_id: "XX-4567"
                instrument: "BTC-EUR/SP"
                max_frequency: 500
              - subscription_id: "TS-BTC"
                instrument: "BTC-EUR/SP"
                mergeable: false
                max_pending: 100
              - subscription_id: "XX-4549"
                instrument: "ETH-EUR/SP"
                max_frequency: 500
              - subscription_id: "TS-ETH"
                instrument: "ETH-EUR/SP"
                mergeable: false

    UnSubscribeInstruments:
      name: UnSubscribeInstruments
      title: Un-Subscribe from a Subscription
      summary:
        Unsubscribe from a channel a list of subscriptions
      payload:
        type: object
        required:
          - unsubscribe_instruments
        additionalProperties: false
        properties:
          unsubscribe_instruments:
            type: object
            required:
              - channel
              - subscription_ids
            additionalProperties: false
            properties:
              channel:
                title: Channel to Use
                $ref: "dict.yml#/components/schemas/channel_type"
              subscription_ids:
                type: array
                minItems: 1
                maxItems: 999
                description: Array containing a list of subscriptions to unsubscribe from
                items:
                  title: Un-Subscribe
                  $ref: "dict.yml#/components/schemas/subscription_id_type"
        example:
          unsubscribe_instruments:
            channel: "prices"
            subscription_ids:
              - "XX-4567"
              - "TS-BTC"
              - "XX-4549"
              - "TS-ETH"

    ChannelSubscriptionConfirmation:
      name: ChannelSubscriptionConfirmation
      title: Channel Subscription Confirmation
      summary: Confirmation of a Channel Subscription
      payload:
        type: object
        required:
          - channel_subscription_confirmation
        additionalProperties: false
        properties:
          channel_subscription_confirmation:
            title: Channel Subscription Confirmation
            description: |
              Message received when the user is successfully subscribed to a channel.
            type: object
            required:
              - header
              - status
              - heartbeat_interval
            properties:
              header:
                $ref: "dict.yml#/components/schemas/header_type"
              status:
                $ref: "dict.yml#/components/schemas/channel_status_type"
              heartbeat_interval:
                $ref: "dict.yml#/components/schemas/heartbeat_interval_type"
        example:
          channel_subscription_confirmation:
            header:
              channel: "<channel>"
              timestamp: "1970-01-01T00:00:00.000000Z"
            status: "ACTIVE"
            heartbeat_interval: 30

    ChannelSubscriptionError:
      name: ChannelSubscriptionError
      title: Channel Subscription Failed
      summary: Channel Subscription has failed, channel can not be used
      payload:
        type: object
        required:
          - channel_subscription_error
        additionalProperties: false
        properties:
          channel_subscription_error:
            title: Channel Subscription Error
            description: |
              Message received when the subscription to a channel has failed
            type: object
            required:
              - header
              - error
            properties:
              header:
                $ref: "dict.yml#/components/schemas/header_type"
              error:
                $ref: "dict.yml#/components/schemas/error_type"
              error_text:
                $ref: "dict.yml#/components/schemas/error_text_type"
        example:
          channel_subscription_error:
            header:
              channel: "<channel>"
              timestamp: "1970-01-01T00:00:00.000000Z"
            error: "Unauthorized"
            error_text: "The channel subscription has been refused because you are not authorized to subscript to a channel."

    HeartBeat:
      name: HeartBeat
      title: Asynchronous HeartBeat
      summary: Asynchronous heart beat message send by the server to the subscriber
      payload:
        type: object
        required:
          - heartbeat
        additionalProperties: false
        properties:
          heartbeat:
            type: object
            required:
              - header
            additionalProperties: false
            properties:
              header:
                $ref: "dict.yml#/components/schemas/header_type"
        example:
          heartbeat:
            header:
              channel: "<channel>"
              timestamp: "1970-01-01T00:00:00.000000Z"

    PriceUpdate:
      name: PriceUpdate
      title: Asynchronous Price Update
      description:
        Asynchronous price update message send by the server to the API user. A price update is a
        list of updates for different subscriptions. An update is sent for an subscription for each
        new status or price.
      payload:
        type: object
        required:
          - price_update
        additionalProperties: false
        properties:
          price_update:
            type: object
            required:
              - header
              - update_list
            additionalProperties: false
            properties:
              header:
                $ref: "dict.yml#/components/schemas/header_type"
              update_list:
                title: List of Updates
                type: array
                minItems: 1
                maxItems: 100
                description: Array containing a list of updates for a subscription
                items:
                  type: object
                  required:
                    - subscription_id
                    - instrument
                    - update_ts
                  additionalProperties: false
                  properties:
                    subscription_id:
                      $ref: "dict.yml#/components/schemas/subscription_id_type"
                    instrument:
                      $ref: "dict.yml#/components/schemas/instrument_type"
                    status:
                      $ref: "dict.yml#/components/schemas/price_status_type"
                    update_ts:
                      title: The time when the update has been received
                      $ref: "dict.yml#/components/schemas/timestamp_type"
                    merged:
                      title: Merging Flag
                      type: boolean
                      default: false
                      description:
                        If *true* the update contains merged data.
                        If *false* or not present the update has not been merged
                    first_ts:
                      $ref: "dict.yml#/components/schemas/timestamp_type"
                      description:
                        If *merged* is true this timestamp is the time when the first update merged
                        has been received
                    levels:
                      title: Levels
                      description:
                        The levels element is only present when the instrument exists and the
                        price source is active. Otherwise the error field will be filled with
                        an error message explaining what is wrong.
                      type: array
                      minItems: 0
                      maxItems: 999
                      items:
                        title: Level
                        type: object
                        required:
                          - quantity
                        properties:
                          quantity:
                            title: Quantity
                            $ref: "dict.yml#/components/schemas/quantity_type"
                          buy_price:
                            title: Buy Price
                            $ref: "dict.yml#/components/schemas/price_type"
                            description:
                              The price to buy a quantity of 1.0 of leg_1 expressed in a leg_2
                              quantity.<br><br>
                              For example the instrument "BTC-EUR" the leg_1 is "BTC" and the leg_2
                              is "EUR". A buy price of "23768.63953056" means that you pay
                              23,768.63953956 EUR for one BTC.
                          sell_price:
                            title: Sell Price
                            $ref: "dict.yml#/components/schemas/price_type"
                            description:
                              The price to sell a quantity of 1.0 of leg_1 expressed in a leg_2
                              quantity.<br><br>
                              For example the instrument "BTC-EUR" the leg_1 is "BTC" and the leg_2
                              is "EUR". A sell price of "23767.23953056" means that you get
                              23,768.63953956 EUR for one BTC.
        example:
          price_update:
            header:
              channel: "prices"
              timestamp: "1970-01-01T00:08:00.000000Z"
            update_list:
              - subscription_id: "TS-BTC"
                instrument: "BTC-EUR/SP"
                status: "ACTUAL"
                update_ts: "1970-01-01T00:07:58.973000Z"
                levels:
                  - quantity: "1.25867895"
                    buy_price: "23768.69386464"
                    sell_price: "23767.67893759"
              - subscription_id: "TS-BTC"
                instrument: "BTC-EUR/SP"
                status: "ACTUAL"
                update_ts: "1970-01-01T00:07:59.657000Z"
                levels:
                  - quantity: "1.25867895"
                    buy_price: "23768.63953056"
                    sell_price: "23767.23953056"
              - subscription_id: "XX-4567"
                instrument: "BTC-EUR/SP"
                status: "ACTUAL"
                merged: true
                first_ts: "1970-01-01T00:07:58.973000Z"
                update_ts: "1970-01-01T00:07:59.657000Z"
                levels:
                  - quantity: "1.25867895"
                    buy_price: "23768.63953056"
                    sell_price: "23767.23953056"

    PriceSubscriptionError:
      name: PriceSubscriptionError
      title: Price Subscription Error
      summary: Rejection of a Price Subscription
      payload:
        type: object
        required:
          - price_subscription_error
        additionalProperties: false
        properties:
          price_subscription_error:
            title: Rejection of a Prices Subscription
            description: |
              Message received when a price subscription failed an is rejected.
            type: object
            required:
              - header
              - rejection_list
            additionalProperties: false
            properties:
              header:
                $ref: "dict.yml#/components/schemas/header_type"
              rejection_list:
                title: List of rejected subscriptions
                type: array
                minItems: 1
                maxItems: 100
                description: Array containing a list of rejected subscriptions
                items:
                  type: object
                  required:
                    - subscription_id
                    - instrument
                    - error
                  additionalProperties: false
                  properties:
                    subscription_id:
                      $ref: "dict.yml#/components/schemas/subscription_id_type"
                    instrument:
                      $ref: "dict.yml#/components/schemas/instrument_type"
                    error:
                      title: Error Text
                      $ref: "dict.yml#/components/schemas/error_text_type"
        example:
          price_subscription_error:
            header:
              channel: "prices"
              timestamp: "1970-01-01T00:08:00.000000Z"
            rejection_list:
              - subscription_id: "XX-4549"
                instrument: "ETH-EUR/SP"
                error: "Not allowed to trade the instrument"
              - subscription_id: "TS-ETH"
                instrument: "ETH-EUR/SP"
                error: "NotFound"


####################################################################################################
##
## Order Channel Messages
##
    SubscribeOrderChannel:
      name: SubscribeOrderChannel
      title: Subscribe to a Order Channel
      summary:
        Message to subscribe to a order channel for this WebSocket. Only one subscription possible
        per WebSocket
      payload:
        type: object
        required:
          - subscribe_order_channel
        additionalProperties: false
        properties:
          subscribe_order_channel:
            type: object
            required:
              - channel
            additionalProperties: false
            properties:
              channel:
                title: Channel to Subscribe - has to be "orders"
                $ref: "dict.yml#/components/schemas/channel_type"
              heartbeat_interval:
                $ref: "dict.yml#/components/schemas/heartbeat_interval_type"
        example:
          subscribe_channel:
            channel: "orders"
            heartbeat_interval: 30

    NewOrder:
      name: NewOrder
      title: New Order
      summary:
        Message to sent a new order
      payload:
        type: object
        required:
          - new_order
        additionalProperties: false
        properties:
          new_order:
            title: New Order
            type: object
            required:
              - order_ref
              - order_type
              - instrument
              - side
              - amount
            additionalProperties: false
            properties:
              order_ref:
                $ref: "dict.yml#/components/schemas/external_ref_type"
              req_header:
                $ref: "dict.yml#/components/schemas/req_header_type"
              order_type:
                $ref: "dict.yml#/components/schemas/order_type_type"
              instrument:
                $ref: "dict.yml#/components/schemas/instrument_type"
              side:
                $ref: "dict.yml#/components/schemas/side_type"
              amount:
                $ref: "dict.yml#/components/schemas/order_amount_type"
              counter_leg_precision:
                $ref: "dict.yml#/components/schemas/asset_precision_type"
                description:
                  This optional parameter defines the precision of execution of the counter leg
                  (leg 2) of the instrument. If not given, the default precision of the asset is
                  used.
              time_in_force:
                $ref: "dict.yml#/components/schemas/time_in_force_type"
                description:
                  This optional parameter defines how long a limit order is valid.
              limit_price:
                $ref: "dict.yml#/components/schemas/price_type"

        example:
          new_order:
            order_ref: "c8d16891-b669-11ed-bc43-f1002b6e6125"
            req_header:
              req_id: "ca57eead-b699-11ed-b3ff-cc17d418c9e0"
              user_data:
                - tag: "Correlation-Id"
                  value: "c8d16891-b669-11ed-bc43-f1002b6e6125"
                - tag: "TX-Id"
                  value: "18955457"
            order_type: "MARKET"
            instrument: "BTC-EUR/SP"
            side: "BUY"
            amount:
              leg_2_amount: "50000"

    OrderExecution:
      name: OrderExecution
      title: Order Execution
      summary: Report the execution of a earlier sent order
      payload:
        type: object
        required:
          - order_execution
        additionalProperties: false
        properties:
          order_execution:
            title: Order Execution Confirmation
            description: |
              Message received when a *new_order* sent by the API user gets executed.
            type: object
            required:
              - header
              - order_id
              - trade_id
              - order_ref
              - order_type
              - instrument
              - side
              - amount
              - order_status
              - leg_1_executed_amount
              - leg_2_executed_amount
              - execution_price
            properties:
              header:
                $ref: "dict.yml#/components/schemas/header_type"
              order_id:
                $ref: "dict.yml#/components/schemas/internal_ref_type"
              trade_id:
                $ref: "dict.yml#/components/schemas/internal_ref_type"
              order_ref:
                $ref: "dict.yml#/components/schemas/external_ref_type"
              req_header:
                  $ref: "dict.yml#/components/schemas/req_header_type"
              order_type:
                $ref: "dict.yml#/components/schemas/order_type_type"
              instrument:
                $ref: "dict.yml#/components/schemas/instrument_type"
              side:
                $ref: "dict.yml#/components/schemas/side_type"
              amount:
                $ref: "dict.yml#/components/schemas/order_amount_type"
              order_status:
                $ref: "dict.yml#/components/schemas/order_status_type"
              leg_1_executed_amount:
                $ref: "dict.yml#/components/schemas/quantity_type"
              leg_2_executed_amount:
                $ref: "dict.yml#/components/schemas/quantity_type"
              execution_price:
                $ref: "dict.yml#/components/schemas/price_type"
        example:
          order_execution:
            header:
              channel: "orders"
              timestamp: "1970-01-01T00:00:00.000000Z"
            order_id: "6aa21c20-ae4b-11ed-b304-81a12bb57b04"
            trade_id: "7b8f1c30-ae4b-11ed-9f5c-3f2a4e4e5d3c"
            order_ref: "c8d16891-b669-11ed-bc43-f1002b6e6125"
            req_header:
              req_id: "ca57eead-b699-11ed-b3ff-cc17d418c9e0"
              user_data:
                - tag: "Correlation-Id"
                  value: "c8d16891-b669-11ed-bc43-f1002b6e6125"
                - tag: "TX-Id"
                  value: "18955457"
            order_type: "MARKET"
            instrument: "BTC-EUR/SP"
            side: "BUY"
            amount:
              leg_2_amount: "50000"
            order_status: "DONE"
            leg_1_executed_amount: "0.49103363"
            leg_2_executed_amount: "50000"
            execution_price: "101826.020129"

    OrderStatusResponse:
      name: OrderStatusResponse
      title: Order Status Response
      summary: Message received when a *new_order* can not be executed
      payload:
        type: object
        required:
          - order_status
        additionalProperties: false
        properties:
          order_status:
            title: Order Status Message
            description: |
              Message received when a *new_order* can not be executed
            type: object
            required:
              - header
              - order_id
              - order_ref
              - order_type
              - instrument
              - side
              - amount
              - order_status
            properties:
              header:
                $ref: "dict.yml#/components/schemas/header_type"
              order_id:
                $ref: "dict.yml#/components/schemas/internal_ref_type"
              order_ref:
                $ref: "dict.yml#/components/schemas/external_ref_type"
              req_header:
                  $ref: "dict.yml#/components/schemas/req_header_type"
              order_type:
                  $ref: "dict.yml#/components/schemas/order_type_type"
              instrument:
                  $ref: "dict.yml#/components/schemas/instrument_type"
              side:
                  $ref: "dict.yml#/components/schemas/side_type"
              amount:
                  $ref: "dict.yml#/components/schemas/order_amount_type"
              order_status:
                $ref: "dict.yml#/components/schemas/order_status_type"
              rejection_reason:
                $ref: "dict.yml#/components/schemas/rejection_reason_type"
              rejection_text:
                $ref: "dict.yml#/components/schemas/error_text_type"
        example:
          order_status:
            header:
              channel: "orders"
              timestamp: "1970-01-01T00:00:00.000000Z"
            order_id: "6aa21c20-ae4b-11ed-b304-81a12bb57b04"
            order_ref: "c8d16891-b669-11ed-bc43-f1002b6e6125"
            req_header:
              req_id: "ca57eead-b699-11ed-b3ff-cc17d418c9e0"
              user_data:
                - tag: "Correlation-Id"
                  value: "c8d16891-b669-11ed-bc43-f1002b6e6125"
                - tag: "TX-Id"
                  value: "18955457"
            order_type: "MARKET"
            instrument: "THE-EUR-SP"
            side: "BUY"
            amount:
              leg_2_amount: "50000"
            order_status: "REJECTED"
            rejection_reason: "INVALID_REQUEST"
            rejection_text: "Invalid leg 1 asset"



####################################################################################################
##
## Trade Channel Messages
##
    SubscribeTradeChannel:
      name: SubscribeTradeChannel
      title: Subscribe to a Trade Channel
      summary:
        Message to subscribe to a trade channel for this WebSocket. Only one subscription possible
        per WebSocket
      payload:
        type: object
        required:
          - subscribe_trade_channel
        additionalProperties: false
        properties:
          subscribe_trade_channel:
            type: object
            required:
              - channel
            additionalProperties: false
            properties:
              channel:
                title: Channel to Subscribe - has to be "trades"
                $ref: "dict.yml#/components/schemas/channel_type"
              heartbeat_interval:
                $ref: "dict.yml#/components/schemas/heartbeat_interval_type"
              seq_number:
                title: Sequence number of the trade to start delivery with
                description: |
                  The trade with the given sequence number will be the first trade delivered after
                  the subscription is confirmed. If this parameter is not given, but
                  *execution_time* is given, the first trade with an execution time equal or after
                  the given time will be the first trade delivered. If neither *seq_number* nor
                  *execution_time* is given, the delivery will start with the first trade of the
                  current day. It is not supported to give both parameters.
                $ref: "dict.yml#/components/schemas/sequence_type"
              execution_time:
                title: Execution time of the trade to start delivery with
                description: |
                  The trade with the given sequence number will be the first trade delivered after
                  the subscription is confirmed. If this parameter is not given, but
                  *execution_time* is given, the first trade with an execution time equal or after
                  the given time will be the first trade delivered. If neither *seq_number* nor
                  *execution_time* is given, the delivery will start with the first trade of the
                  current day. It is not supported to give both parameters.
                $ref: "dict.yml#/components/schemas/timestamp_type"
        example:
          subscribe_trade_channel:
            channel: "trades"
            heartbeat_interval: 30
            seq_number: 47110815

    Trade:
      name: Trade
      title: Trade Message
      summary: Message received when a execution happens
      payload:
        type: object
        required:
          - trade
        additionalProperties: false
        properties:
          trade:
            title: Trade Message
            type: object
            required:
              - trade_id
            additionalProperties: false
            properties:
              trade_id:
                $ref: "dict.yml#/components/schemas/internal_ref_type"
              seq_number:
                $ref: "dict.yml#/components/schemas/sequence_type"
              order_id:
                $ref: "dict.yml#/components/schemas/internal_ref_type"
              order_ref:
                $ref: "dict.yml#/components/schemas/external_ref_type"
              req_header:
                $ref: "dict.yml#/components/schemas/req_header_type"
              order:
                $ref: "dict.yml#/components/schemas/order_data_type"
              trade:
                $ref: "dict.yml#/components/schemas/trade_type"
              history_done:
                title: Flag to mark that this trade ist the last one from the history
                type: boolean
            example:
              trade:
                trade_id: "6aa21c20-ae4b-11ed-b304-81a12bb57b04"
                seq_number: 47110815
                order_id: "73f2e419-e4ac-4db2-84ab-81a12ad43d54"
                order_ref: "18955839"
                req_header:
                  req_id: "ca57eead-b699-11ed-b3ff-cc17d418c9e0"
                  user_data:
                    - tag: "Correlation-Id"
                      value: "c8d16891-b669-11ed-bc43-f1002b6e6125"
                    - tag: "TX-Id"
                      value: "18955457"
                order:
                  instrument: "BTC-EUR"
                  order_type: "MARKET"
                  side: "BUY"
                  amount:
                    leg_2_amount: "50000"
                  arrived_at: "1970-01-01T00:00:00.000000Z"
                  order_status: "DONE"
                trade:
                  leg_1_executed_amount: "3.159354"
                  leg_2_executed_amount: "50000"
                  execution_price: "15.826,020129"
                  executed_at: "1970-01-01T00:00:00.000000Z"
                  leg_1_status: PENDING
                  leg_2_status: SETTLED
                history_done: true


