> For the complete documentation index, see [llms.txt](https://docs.fira.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fira.money/developers/protocol-contracts/router/action-add-remove-liq.md).

# ActionAddRemoveLiq

{% hint style="info" %}
**Source:** `src/fira_bonding/router/ActionAddRemoveLiqV3.sol`
{% endhint %}

## Add liquidity variants

| Function                        | Input      | Strategy                                    |
| ------------------------------- | ---------- | ------------------------------------------- |
| `addLiquidityDualTokenAndBt`    | Token + BT | Mint FW from token, add with BT             |
| `addLiquidityDualFwAndBt`       | FW + BT    | Direct dual-sided add                       |
| `addLiquiditySingleToken`       | Token only | Mint FW, swap portion to BT, add both       |
| `addLiquiditySingleBt`          | BT only    | Swap portion to FW, add both                |
| `addLiquiditySingleFw`          | FW only    | Swap portion to BT, add both                |
| `addLiquiditySingleTokenKeepCt` | Token only | Mint FW, mint BT+CT, use BT for LP, keep CT |
| `addLiquiditySingleFwKeepCt`    | FW only    | Same keep-CT strategy                       |

### Keep-CT strategy

Instead of swapping FW to BT, the router mints BT+CT from FW. BT goes to the market for liquidity, CT goes to the user. This way the user gets LP exposure plus floating yield from CT simultaneously.

## Remove liquidity variants

| Function                        | Output                                                     |
| ------------------------------- | ---------------------------------------------------------- |
| `removeLiquidityDualFwAndBt`    | FW + BT separately                                         |
| `removeLiquidityDualTokenAndBt` | Token (from FW redeem) + BT                                |
| `removeLiquiditySingleBt`       | BT only (FW swapped to BT)                                 |
| `removeLiquiditySingleFw`       | FW only (BT swapped to FW, or redeemed via CT post-expiry) |
| `removeLiquiditySingleToken`    | Token (everything converted)                               |

### Post-expiry removal

Since the market doesn't allow swaps post-expiry, single-FW removal sends BT to the CT contract and redeems via `CT.redeemBC()`.

## Core mechanics

All add operations ultimately call `FiraMarket.mint(receiver, netFwUsed, netBtUsed)`. Single-sided adds use approximation libraries to calculate how much to swap before depositing both sides. All remove operations call `FiraMarket.burn`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fira.money/developers/protocol-contracts/router/action-add-remove-liq.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
