> 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

ActionAddRemoveLiqV3 supports 10 liquidity operation variants — dual-sided, single-sided, and keep-CT strategies for providing and removing liquidity.

{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
