# User Flows

These pages document the end-to-end transaction flows for each user-facing operation in the Fira protocol. Each flow includes a Mermaid sequence diagram, preconditions, relevant view functions, emitted events, and reward share formulas where applicable.

{% hint style="info" %}
All user operations go through the **FiraRouterV4** (except variable-rate lending, which interacts with the LendingMarket directly). Users must approve the relevant tokens to the router before calling.
{% endhint %}

## Common parameter structs

| Struct           | Fields                                                                               |
| ---------------- | ------------------------------------------------------------------------------------ |
| `MarketParams`   | `loanToken`, `collateralToken`, `oracle`, `irm`, `ltv`, `lltv`, `whitelist`          |
| `TokenInput`     | `tokenIn`, `netTokenIn`, `tokenMintFw`, `firaSwap`, `swapData`                       |
| `TokenOutput`    | `tokenOut`, `minTokenOut`, `tokenRedeemFw`, `firaSwap`, `swapData`                   |
| `LimitOrderData` | Pricing limits for BT/FW market swap (interface compat, not used in current version) |

## Flows

* [Borrow at Fixed Rate](/developers/user-flows/borrow-fixed-rate.md)
* [Repay Fixed-Rate Debt](/developers/user-flows/repay-fixed-rate.md)
* [Variable-Rate Lending](/developers/user-flows/variable-rate-lending.md)
* [Repay Variable-Rate Debt](/developers/user-flows/repay-variable-rate.md)
* [FW Deposit & Redeem](/developers/user-flows/fw-deposit-redeem.md)
* [Provide Liquidity](/developers/user-flows/provide-liquidity.md)
* [Remove Liquidity](/developers/user-flows/remove-liquidity.md)
* [Trade BT & CT](/developers/user-flows/trade-bt-ct.md)
* [Pre/Post-Expiry Exits](/developers/user-flows/pre-post-expiry-exits.md)


---

# Agent Instructions: 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:

```
GET https://docs.fira.money/developers/user-flows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
