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

# Account Log

> Subscribe to account log information

<div className="api-banner">
  <span className="api-protocol ws">WSS</span>
  <span className="api-detail">futures.kraken.com/ws/v1</span>
  <span className="api-tag">account\_log</span>
</div>

This subscription feed publishes account information.

***

## Request

<ResponseField name="event" type="string" required>
  `subscribe` or `unsubscribe`
</ResponseField>

<ResponseField name="feed" type="string" required>
  The requested subscription feed. Value: `account_log`
</ResponseField>

<ResponseField name="api_key" type="string" required>
  The user API key.
</ResponseField>

<ResponseField name="original_challenge" type="string" required>
  The message that is received from a challenge request.
</ResponseField>

<ResponseField name="signed_challenge" type="string" required>
  The signed challenge message with user API secret.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribe",
    "feed": "account_log",
    "api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
    "original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
    "signed_challenge": "RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
  }
  ```
</CodeGroup>

***

## Response Success

<ResponseField name="event" type="string">
  <span className="field-attr">One of:</span> `subscribed`, `subscribed_failed`, `unsubscribed`, `unsubscribed_failed`

  The result.
</ResponseField>

<ResponseField name="feed" type="string">
  The requested subscription feed. Value: `account_log`
</ResponseField>

<ResponseField name="api_key" type="string">
  The user API key.
</ResponseField>

<ResponseField name="original_challenge" type="string">
  The message that is received from a challenge request.
</ResponseField>

<ResponseField name="signed_challenge" type="string">
  The signed challenge message with user API secret.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribed",
    "feed": "account_log",
    "api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
    "original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
    "signed_challenge": "RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
  }
  ```
</CodeGroup>

***

## Response Snapshot & Delta

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="logs" type="list of structures">
  A list containing the account logs.

  <Expandable title="properties">
    <ResponseField name="id" type="positive integer">The identifier of the log.</ResponseField>
    <ResponseField name="date" type="ISO8601 datetime">The creation time of the log according to server date and time.</ResponseField>
    <ResponseField name="asset" type="string">The asset related to the booking.</ResponseField>
    <ResponseField name="contract" type="string">The futures contract (symbol) associated with the log entry, if applicable.</ResponseField>
    <ResponseField name="info" type="string">A description of the booking.</ResponseField>
    <ResponseField name="booking_uid" type="string">The unique id of the booking.</ResponseField>
    <ResponseField name="margin_account" type="string">The name of the account associated with the entry.</ResponseField>
    <ResponseField name="old_balance" type="float">The account balance before the action described in `info`.</ResponseField>
    <ResponseField name="new_balance" type="float">The new balance of wallet or new size of the position after the action described in `info`.</ResponseField>
    <ResponseField name="old_average_entry_price" type="positive float">The average entry price of the position prior to this trade.</ResponseField>
    <ResponseField name="new_average_entry_price" type="positive float">The average entry price of the position after this trade.</ResponseField>
    <ResponseField name="trade_price" type="positive float">The price the trade was executed at.</ResponseField>
    <ResponseField name="mark_price" type="positive float">The mark price at the time the trade was executed.</ResponseField>
    <ResponseField name="realized_pnl" type="float">The pnl that is realized by reducing the position.</ResponseField>
    <ResponseField name="fee" type="float">The fee paid.</ResponseField>
    <ResponseField name="execution" type="string">The uid of the associated execution.</ResponseField>
    <ResponseField name="collateral" type="string">The currency of the associated entry.</ResponseField>
    <ResponseField name="funding_rate" type="float">The absolute funding rate.</ResponseField>
    <ResponseField name="realized_funding" type="float">The funding rate realized due to change in position size or end of funding rate period.</ResponseField>
    <ResponseField name="conversion_spread_percentage" type="float">The percentage conversion spread used in a currency conversion.</ResponseField>
    <ResponseField name="liquidation_fee" type="float">The liquidation fee associated with a liquidation/assignment entry. Not applicable for inverse futures.</ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```json Example: Snapshot theme={null}
  {
    "feed": "account_log_snapshot",
    "logs": [
      {
        "id": 1690,
        "date": "2019-07-11T08:00:00.000Z",
        "asset": "bch",
        "info": "funding rate change",
        "booking_uid": "86fdc252-1b6e-40ec-ac1d-c7bd46ddeebf",
        "margin_account": "f-bch:usd",
        "old_balance": 0.01215667051,
        "new_balance": 0.01215736653,
        "old_average_entry_price": 0.0,
        "new_average_entry_price": 0.0,
        "trade_price": 0.0,
        "mark_price": 0.0,
        "realized_pnl": 0.0,
        "fee": 0.0,
        "execution": "",
        "collateral": "bch",
        "funding_rate": -8.7002552653e-8,
        "realized_funding": 6.9602e-7,
        "conversion_spread_percentage": 0.0,
        "liquidation_fee": 0.0
      },
      {
        "id": 1689,
        "date": "2019-07-11T04:00:00.000Z",
        "asset": "bch",
        "info": "funding rate change",
        "booking_uid": "680d3973-5774-4a9d-b807-ab8aa73f95c3",
        "margin_account": "f-bch:usd",
        "old_balance": 0.01215715298,
        "new_balance": 0.01215667051,
        "old_average_entry_price": 0.0,
        "new_average_entry_price": 0.0,
        "trade_price": 0.0,
        "mark_price": 0.0,
        "realized_pnl": 0.0,
        "fee": 0.0,
        "execution": "",
        "collateral": "bch",
        "funding_rate": 6.0309345058e-8,
        "realized_funding": -4.8247e-7,
        "conversion_spread_percentage": 0.0,
        "liquidation_fee": 0.0
      }
    ]
  }
  ```

  ```json Example: Delta theme={null}
  {
    "feed": "account_log",
    "new_entry": {
      "id": 1697,
      "date": "2019-07-11T13:00:27.632Z",
      "asset": "pi_bchusd",
      "info": "futures trade",
      "booking_uid": "55a02b5b-2c90-4d43-b0eb-eb3801d50e3f",
      "margin_account": "f-bch:usd",
      "old_balance": 1.0,
      "new_balance": 2.0,
      "old_average_entry_price": 413.3,
      "new_average_entry_price": 374.3445326979084,
      "trade_price": 342.1,
      "mark_price": 342.4,
      "realized_pnl": 0.0,
      "fee": 0.0,
      "execution": "fc49fea9-8827-4a2e-8e36-c047523ddc30",
      "collateral": "bch",
      "funding_rate": 1.64955714332e-7,
      "realized_funding": -1.31965e-6,
      "conversion_spread_percentage": 0.0,
      "liquidation_fee": 0.0
    }
  }
  ```
</CodeGroup>

***

## Response Error

<ResponseField name="event" type="string">
  Value: `error`
</ResponseField>

<ResponseField name="message" type="string">
  <span className="field-attr">One of:</span> `Invalid feed`, `Json Error`

  An error message.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "error",
    "message": "Invalid feed"
  }
  ```
</CodeGroup>
