> 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

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