> For the complete documentation index, see [llms.txt](https://docs.btcd.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.btcd.fi/how-the-engine-works.md). Agents can also search and read this documentation through its [MCP server](https://docs.btcd.fi/~gitbook/mcp).

# How the Engine Works

The automated system that manages BTCD's reserves.

BTCD's reserves are held in bitcoin and dollars. The engine is the automated system that manages them. It values the reserves, keeps them balanced, invests them in on-chain yield strategies, pays out surplus as yield to stakers, and protects holders if the reserves ever fall short.

This section describes how the engine is designed to work. Specific parameter values are set through governance and change over time, so they are not listed here. Figures in the examples are illustrative.

## Why the reserves hold half their value in bitcoin

Because the peg moves about half as much as bitcoin, the total value of all BTCD behaves like a portfolio that is half bitcoin and half dollars. The engine holds the reserves the same way: about half of their value is exposed to the bitcoin price and half to the dollar. The 50/50 hedge matches the peg's first-order exposure. The illustrative table below shows the small second-order rebalancing gain.

Reserves held at 50% bitcoin, illustrative:

|                  | BTC +10% | BTC −10% |
| ---------------- | -------- | -------- |
| Reserves         | +5.00%   | −5.00%   |
| BTCD peg         | +4.88%   | −5.13%   |
| Collateral ratio | +0.11%   | +0.14%   |

The ratio edges up in both directions. The square-root curve bends, so a straight 50/50 mix finishes every move slightly ahead of it, and the idealized model rebalances to 50%. The engine implementation trades only partway back within its band, as described below.

Over time this adds a return that grows with bitcoin's volatility. A portfolio kept at 50/50 grows like $$\sqrt{\text{BTC}}$$ multiplied by $$e^{\sigma^2 t/8}$$, where $$\sigma$$ is bitcoin's annual volatility and $$t$$ is time in years. At 50% volatility that is about 3% a year, before trading costs.

## How the engine holds the 50/50 split

The engine measures bitcoin exposure across all the reserves, not one account. DeFi positions count by their net bitcoin exposure, so a strategy that borrows bitcoin against dollars counts partly negative. When the bitcoin share drifts outside a narrow band around 50%, the engine buys or sells bitcoin for USDC on its exchange account. It moves the share partway back toward 50% instead of all the way, so small wobbles don't set off a stream of trades.

The split is restored in steps, not continuously. Fast moves and trading costs reduce the rebalancing gain described above.

## In this section

* [One engine cycle](https://docs.btcd.fi/how-the-engine-works/one-engine-cycle.md): the steps the engine follows on every pass.
* [Collateral ratio and yield](https://docs.btcd.fi/how-the-engine-works/collateral-ratio-and-yield.md): how surplus is measured and paid.
* [When reserves fall short](https://docs.btcd.fi/how-the-engine-works/when-reserves-fall-short.md): how BTCD is priced if the reserves cannot cover every token at the peg.
* [Where reserves sit](https://docs.btcd.fi/how-the-engine-works/where-reserves-sit.md): the segments and how money moves between them.
* [Choosing DeFi strategies](https://docs.btcd.fi/how-the-engine-works/choosing-defi-strategies.md): how the engine sizes each strategy, and how strategies are admitted.
* [Minting, redemption and peg keeping](https://docs.btcd.fi/how-the-engine-works/minting-redemption-and-peg-keeping.md): who can create and destroy BTCD, and what pulls the market price to the peg.
* [Controls and governance](https://docs.btcd.fi/how-the-engine-works/controls-and-governance.md): the limits built into every cycle and the switches in the operators' hands.
