---
title: "Kraken"
description: "This page explains the default security-level models and markets of the KrakenBrokerageModel."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/kraken
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/kraken.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/24%20Reality%20Modeling/05%20Brokerages/02%20Supported%20Models/13%20Kraken
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Kraken

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Reality Modeling > Brokerages > [Supported Models](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models.md) > Kraken

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

This page explains the `KrakenBrokerageModel`, including the asset classes it supports, its default [security-level models](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/key-concepts.md#02-Security-Level-Models), and its default markets.

```python
self.set_brokerage_model(BrokerageName.KRAKEN, AccountType.CASH)
self.set_brokerage_model(BrokerageName.KRAKEN, AccountType.MARGIN)
```

For more information about this model, see the [class reference](https://www.lean.io/docs/v2/lean-engine/class-reference/py/QuantConnect/Brokerages/KrakenBrokerageModel/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Common/Brokerages/KrakenBrokerageModel.cs).

## Asset Classes

The `KrakenBrokerageModel` supports trading [Crypto](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto.md).

## Orders

The `KrakenBrokerageModel` supports several order types and order properties, but it doesn't support order updates.

### Order Types

The following table describes the available order types for each asset class that the `KrakenBrokerageModel` supports:

| Order Type | Crypto |
| --- | --- |
| [Market](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/market-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Limit](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/limit-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Limit if touched](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/limit-if-touched-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Stop market](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/stop-market-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Stop limit](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/stop-limit-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |

### Order Properties

The `KrakenBrokerageModel` supports custom order properties. The following table describes the members of the `KrakenOrderProperties` object that you can set to customize order execution:

| Property | Data Type | Description | Default Value |
| --- | --- | --- | --- |
| `time_in_force` | `TimeInForce` | A [TimeInForce](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-properties.md#03-Time-In-Force) instruction to apply to the order. The following instructions are supported: `DAY` `GOOD_TIL_CANCELED` `good_til_date` | `TimeInForce.GOOD_TIL_CANCELED` |
| `post_only` | `bool` | A flag to signal that the order must only add liquidity to the order book and not take liquidity from the order book. If part of the order results in taking liquidity rather than providing liquidity, the order is rejected without any part of it being filled. |  |
| `fee_in_base` | `bool` | A flag to signal that the order fees should be paid in the base currency, which is the default behavior when selling. This flag must be the opposite of the `fee_in_quote` flag. |  |
| `fee_in_quote` | `bool` | A flag to signal that the order fees should be paid in the quote currency, which is the default behavior when buying. This flag must be the opposite of the `fee_in_base` flag. |  |
| `no_market_price_protection` | `bool` | A flag to signal that no [Market Price Protection](https://support.kraken.com/hc/en-us/articles/201648183-Market-Price-Protection) should be used. |  |
| `conditional_order` | `Order` | An `Order` that's submitted when the primary order is executed. The `conditional_order` quantity must match the primary order quantity and the `conditional_order` direction must be the opposite of the primary order direction. This order property is only available for live algorithms. |  |

```python
def initialize(self) -> None:
    # Set the default order properties
    self.default_order_properties = KrakenOrderProperties()
    self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_CANCELED
    self.default_order_properties.post_only = False
    self.default_order_properties.fee_in_base = True
    self.default_order_properties.fee_in_quote = False
    self.default_order_properties.no_market_price_protection = True

def on_data(self, slice: Slice) -> None:
    # Use default order order properties
    self.limit_order(self._symbol, quantity, limit_price)

    # Override the default order properties
    order_properties = KrakenOrderProperties()
    order_properties.time_in_force = TimeInForce.DAY
    order_properties.post_only = True
    order_properties.fee_in_base = False
    order_properties.fee_in_quote = True
    order_properties.no_market_price_protection = True
    self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)

    order_properties.time_in_force = TimeInForce.good_til_date(datetime(year, month, day))
    order_properties.post_only = False
    order_properties.fee_in_base = True
    order_properties.fee_in_quote = False
    order_properties.no_market_price_protection = False
    order_properties.conditional_order = StopLimitOrder(self._symbol, -quantity, stop_limit_price, stop_price)
    self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
```

### Updates

The `KrakenBrokerageModel` doesn't support order updates, but you can cancel an existing order and then create a new order with the desired arguments. For more information about this workaround, see the [Workaround for Brokerages That Don’t Support Updates](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#workaround-for-brokerages-that-dont-support-updates).

## Fills

The `KrakenBrokerageModel` uses the [ImmediateFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/immediate-model.md).

## Slippage

The `KrakenBrokerageModel` uses the [NullSlippageModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/slippage/supported-models.md#02-Null-Model).

## Fees

The `KrakenBrokerageModel` uses the [KrakenFeeModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/transaction-fees/supported-models.md#14-Kraken-Model).

## Buying Power

The `KrakenBrokerageModel` uses the `CashBuyingPowerModel` for cash accounts and the `SecurityMarginModel` for margin accounts.

If you have a margin account, the `KrakenBrokerageModel` allows 1x leverage for most Crypto pairs. The following table shows pairs that have additional leverage available:

| Quote Currency | Base Currencies | Leverage |
| --- | --- | --- |
| ADA | BTC, ETH, USD, EUR | 3 |
| BCH | BTC, USD, EUR | 2 |
| BTC | USD, EUR | 5 |
| DASH | BTC, USD, EUR | 3 |
| EOS | BTC, ETH, USD, EUR | 3 |
| ETH | BTC, USD, EUR | 5 |
| LINK | BTC, ETH, USD, EUR | 3 |
| LTC | BTC, USD, EUR | 3 |
| REP | BTC, ETH, USD, EUR | 2 |
| TRX | BTC, ETH, USD, EUR | 3 |
| USDC | USD, EUR | 3 |
| USDT | USD, EUR | 2 |
| XMR | BTC, USD, EUR | 2 |
| XRP | BTC, USD, EUR | 3 |
| XTZ | BTC, ETH, USD, EUR | 2 |

## Settlement

The `KrakenBrokerageModel` uses the [ImmediateSettlementModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/supported-models.md#02-Immediate-Model).

## Margin Interest Rate

The `KrakenBrokerageModel` uses the [NullMarginInterestRateModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/margin-interest-rate/supported-models.md#02-Null-Model).

## Default Markets

The default market of the `KrakenBrokerageModel` is `Market.KRAKEN`.

## Account Currency

The `KrakenBrokerageModel` doesn't set a default currency. To change the algorithm's currency from USD to a different currency, see [Set Account Currency](https://www.quantconnect.com/docs/v2/writing-algorithms/initialization.md#03-Set-Account-Currency).
