> 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/user-flows.md).

# User Flows

Step-by-step user flows for every major operation in the Fira protocol, with sequence diagrams, preconditions, views, and events.

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](https://docs.fira.money/developers/user-flows/borrow-fixed-rate.md)
* [Repay Fixed-Rate Debt](https://docs.fira.money/developers/user-flows/repay-fixed-rate.md)
* [Variable-Rate Lending](https://docs.fira.money/developers/user-flows/variable-rate-lending.md)
* [Repay Variable-Rate Debt](https://docs.fira.money/developers/user-flows/repay-variable-rate.md)
* [FW Deposit & Redeem](https://docs.fira.money/developers/user-flows/fw-deposit-redeem.md)
* [Provide Liquidity](https://docs.fira.money/developers/user-flows/provide-liquidity.md)
* [Remove Liquidity](https://docs.fira.money/developers/user-flows/remove-liquidity.md)
* [Trade BT & CT](https://docs.fira.money/developers/user-flows/trade-bt-ct.md)
* [Pre/Post-Expiry Exits](https://docs.fira.money/developers/user-flows/pre-post-expiry-exits.md)


---

# 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/user-flows.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.
