---
title: "Supported Models"
description: "This page describes all of the pre-built risk free interest rate models in LEAN. If none of these models perform exactly how you want, create a custom risk free interest rate model"
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/risk-free-interest-rate/supported-models
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/risk-free-interest-rate/supported-models.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/24%20Reality%20Modeling/10%20Risk%20Free%20Interest%20Rate/02%20Supported%20Models
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Supported Models

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Reality Modeling > Risk Free Interest Rate > Supported Models

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

## Introduction

This page describes all of the pre-built risk free interest rate models in LEAN. If none of these models perform exactly how you want, create a [custom risk free interest rate model](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/risk-free-interest-rate/key-concepts.md#04-Model-Structure).

## Constant Model

The `ConstantRiskFreeRateInterestRateModel` returns a constant rate across time. It's the default risk free interest rate model.

```python
self.set_risk_free_interest_rate_model(ConstantRiskFreeRateInterestRateModel(0.02))
```

The following table describes the arguments the model accepts:

| Argument | Data Type | Description | Default Value |
| --- | --- | --- | --- |
| `risk_free_rate` | `float` | The risk free interest rate |  |

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

## Function Model

The `FuncRiskFreeRateInterestRateModel` calls a function you provide to get the risk free interest rate. The function you pass to the constructor effectively replaces the [GetInterestRate](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/risk-free-interest-rate/key-concepts.md#06-Get-Interest-Rate) method.

```python
self.set_risk_free_interest_rate_model(FuncRiskFreeRateInterestRateModel(self.get_interest_rate_func))
```

The following table describes the arguments the model accepts:

| Argument | Data Type | Description | Default Value |
| --- | --- | --- | --- |
| `get_interest_rate_func` | `Callable[[datetime], float]` | A function that returns the risk free interest rate for a given date |  |

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

## Interest Rate Provider Model

The `InterestRateProvider` returns the primary credit rate from the Federal Open Market Committee (FOMC).

```python
self.set_risk_free_interest_rate_model(InterestRateProvider())
```

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