# Liquidity Injector

## Overview

Fixed-rate lending markets need BT as the loan token, but BT can normally only be created by splitting FW through the yield tokenization process. The Liquidity Injector solves this chicken-and-egg problem by having a special privilege to mint BT directly, without backing FW.

{% hint style="info" %}
The "unbacked" BT minted by the Liquidity Injector is safe because the lending market requires borrowers to post collateral. When borrowers repay their loans, the BT is burned. The injector is simply the bootstrap mechanism.
{% endhint %}

## How it works

### Inject liquidity

`injectLiquidity(params, amount)`:

1. Validates the market is a fixed-rate market (`params.irm == address(0)`)
2. Mints BT via `BondToken.mintByLI()` — the only way to create BT outside the normal FW→BT+CT path
3. Supplies the BT to the lending market via `lendingMarket.supply()`
4. Tracks the injection amount in `marketStats[marketId]`

### Withdraw liquidity

`withdrawLiquidity(params, amount)`:

1. Checks available liquidity (total supply minus total borrows)
2. Withdraws BT from the lending market
3. Burns the BT via `BondToken.burnByLI()`
4. Updates `marketStats[marketId]`

The available liquidity check prevents withdrawal from disrupting existing borrows.

## Key features

* **Owner-only operation** — Only the protocol owner can inject or withdraw
* **No resting state** — BT is either in the lending market or burned; the injector never holds BT idly
* **Per-market tracking** — `marketStats` records net injected amounts per market
* **Self-balancing** — Borrowers must repay BT, which is then burned, closing the loop

## Risk considerations

The unbacked BT creates a soft protocol liability: if the underlying FW exchange rate rises significantly, BT becomes more valuable than when it was minted. However, since borrowers must post collateral and repay in BT, the system is self-balancing.

## Related contracts

* [`LiquidityInjector.sol`](https://docs.fira.money/developers/protocol-contracts/liquidity-injector) — Contract details
* [`BondToken.sol`](https://docs.fira.money/developers/protocol-contracts/yield-contracts/bond-token) — BT contract with `mintByLI`/`burnByLI`
