# Developers

- [Tech Hub](https://docs.fira.money/developers/developers.md)
- [Protocol Primer](https://docs.fira.money/developers/fira-protocol-primer.md): A high-level introduction to the Fira protocol — what it does, why it exists, and how the pieces fit together.
- [Features](https://docs.fira.money/developers/features.md): The Fira protocol provides a comprehensive set of features for yield tokenization, fixed-rate lending, and liquidity provisioning on Ethereum.
- [Fixed-Rate Lending](https://docs.fira.money/developers/features/fixed-rate-lending.md): Fira enables fixed-rate borrowing through a lending market where BT serves as the loan token, giving borrowers predictable costs.
- [Variable-Rate Lending](https://docs.fira.money/developers/features/variable-rate-lending.md): Fira supports variable-rate lending and borrowing through the SisuVault and a standard lending market with oracle-enforced LTV.
- [Bond Token (BT)](https://docs.fira.money/developers/features/bond-token-bt.md): Bond Token (BT) is the fixed-rate principal token in Fira's yield tokenization system.
- [Coupon Token (CT)](https://docs.fira.money/developers/features/coupon-token-ct.md): Coupon Token (CT) is the floating-yield token in Fira's yield tokenization system, representing a claim on variable yield generated by the underlying asset.
- [FW (FiraWrapped)](https://docs.fira.money/developers/features/fw-fira-wrapped.md): FW (Fira Wrapped) tokens are ERC-20 wrappers around yield-bearing assets that provide the base layer for the entire Fira protocol.
- [Fira Market AMM](https://docs.fira.money/developers/features/fira-market-amm.md): The Fira Market is a specialized AMM for trading Bond Tokens against Fira Wrapped tokens, with time-decaying implied-rate pricing.
- [Rehypothecation](https://docs.fira.money/developers/features/rehypothecation.md): The Rehypothecation Module controls how FW tokens balance between idle reserves and yield-generating vault deployments.
- [Liquidity Injector](https://docs.fira.money/developers/features/liquidity-injector.md): The Liquidity Injector bootstraps fixed-rate lending markets by minting and supplying BT as initial liquidity.
- [Architecture](https://docs.fira.money/developers/architecture.md): An overview of Fira's system architecture, module dependencies, and cross-cutting design decisions.
- [Router Architecture](https://docs.fira.money/developers/architecture/router-architecture.md): The Fira Router uses a diamond-like proxy pattern where each function selector maps to a specialized action facet via delegatecall.
- [Protocol Contracts](https://docs.fira.money/developers/protocol-contracts.md): Protocol contracts form the core logic of the Fira protocol — the AMM, yield tokenization, router, lending markets, and supporting modules.
- [Core](https://docs.fira.money/developers/protocol-contracts/core.md): The core directory contains the AMM trading infrastructure and yield tokenization system — the two pillars of the Fira protocol.
- [FiraMarket](https://docs.fira.money/developers/protocol-contracts/core/fira-market.md): FiraMarket is the BT/FW AMM — it holds reserves, executes swaps, manages LP tokens, and maintains TWAP oracle state.
- [FiraMarketFactory](https://docs.fira.money/developers/protocol-contracts/core/fira-market-factory.md): FiraMarketFactory deploys FiraMarket instances via split-code CREATE2 and manages fee configuration.
- [MarketMathCore](https://docs.fira.money/developers/protocol-contracts/core/market-math-core.md): MarketMathCore encodes the time-decaying pricing curve and trade execution math used by FiraMarket. OracleLib provides the TWAP ring buffer.
- [Lending](https://docs.fira.money/developers/protocol-contracts/lending.md): Fira's lending infrastructure includes separate markets for fixed-rate (BT-denominated) and variable-rate (USDC-denominated) lending.
- [Router](https://docs.fira.money/developers/protocol-contracts/router.md): The Fira Router is a diamond-like proxy that delegates user calls to specialized action facets via selector-to-facet mappings.
- [ActionSwapBT](https://docs.fira.money/developers/protocol-contracts/router/action-swap-bt.md): ActionSwapBTV3 provides entry points for swapping tokens or FW to/from Bond Tokens via the Fira Market AMM.
- [ActionSwapCT](https://docs.fira.money/developers/protocol-contracts/router/action-swap-ct.md): ActionSwapCTV3 synthesizes CT swaps through the BT/FW AMM using a flash-callback pattern with BT+CT minting/redeeming.
- [ActionAddRemoveLiq](https://docs.fira.money/developers/protocol-contracts/router/action-add-remove-liq.md): ActionAddRemoveLiqV3 supports 10 liquidity operation variants — dual-sided, single-sided, and keep-CT strategies for providing and removing liquidity.
- [ActionBorrow](https://docs.fira.money/developers/protocol-contracts/router/action-borrow.md): ActionBorrow integrates with the lending market for fixed-rate borrowing and repayment in a single transaction.
- [ActionSimple](https://docs.fira.money/developers/protocol-contracts/router/action-simple.md): ActionSimple provides gas-optimized swap and liquidity functions using on-chain approximation instead of off-chain hints.
- [ActionMisc](https://docs.fira.money/developers/protocol-contracts/router/action-misc.md): ActionMiscV3 handles FW and BT+CT minting/redemption, position exits, multicall batching, and transaction simulation.
- [Yield Contracts](https://docs.fira.money/developers/protocol-contracts/yield-contracts.md): Yield contracts split FW into a fixed-rate principal token (BT) and a floating-yield token (CT), minted and redeemed at the BC index rate.
- [Bond Token](https://docs.fira.money/developers/protocol-contracts/yield-contracts/bond-token.md): BondToken is the fixed-rate principal token — intentionally minimal, with strict access control limiting minting to CT and the LiquidityInjector.
- [Coupon Token](https://docs.fira.money/developers/protocol-contracts/yield-contracts/coupon-token.md): CouponToken is the stateful contract driving the BT/CT lifecycle — minting, redemption, interest accounting, and post-expiry behavior.
- [YieldContractFactory](https://docs.fira.money/developers/protocol-contracts/yield-contracts/yield-contract-factory.md): YieldContractFactory creates BT/CT pairs for a given FW and expiry, using split-code deployment for CT.
- [Rehypothecation Module](https://docs.fira.money/developers/protocol-contracts/rehypothecation-module.md): RehypothecationModule defines the idle/vault ratio parameters that control how FW tokens balance reserves and yield deployment.
- [Liquidity Injector](https://docs.fira.money/developers/protocol-contracts/liquidity-injector.md): LiquidityInjector mints unbacked BT to bootstrap fixed-rate lending markets with initial loan token supply.
- [Token Contracts](https://docs.fira.money/developers/token-contracts.md): Token contracts define the ERC-20 tokens used throughout the Fira protocol, including FW wrappers, BT, CT, and the custom FiraERC20 base.
- [FiraERC20](https://docs.fira.money/developers/token-contracts/fira-erc20.md): FiraERC20 is the custom ERC-20 base used by every token in the protocol, providing a built-in reentrancy guard and transfer hooks.
- [Bond Token](https://docs.fira.money/developers/token-contracts/bond-token.md): BondToken (BT) is the fixed-rate principal ERC-20 token with strict minting restricted to CouponToken and LiquidityInjector.
- [Coupon Token](https://docs.fira.money/developers/token-contracts/coupon-token.md): CouponToken (CT) is the floating-yield ERC-20 token with built-in interest tracking and post-expiry treasury sweep.
- [FW Tokens](https://docs.fira.money/developers/token-contracts/fw-tokens.md): FW token base contracts and the USDCFW implementation that wraps USDC through an ERC-4626 vault for yield generation.
- [Utility Contracts](https://docs.fira.money/developers/utility-contracts.md): Utility contracts include the oracle infrastructure for pricing BT, CT, and LP tokens, and the shared math and helper libraries.
- [Oracles](https://docs.fira.money/developers/utility-contracts/oracles.md): Oracle contracts provide manipulation-resistant TWAP pricing for BT, CT, and LP tokens, consumed by lending markets and external integrators.
- [Solvency Oracle](https://docs.fira.money/developers/utility-contracts/oracles/solvency-oracle.md): FiraSolvencyOracle is the top layer of the fixed-rate lending oracle pipeline, providing collateral pricing to the FiraLendingMarket.
- [LP Oracle](https://docs.fira.money/developers/utility-contracts/oracles/lp-oracle.md): LpOracleLib computes TWAP-based LP token prices by simulating a hypothetical rebalancing trade at the oracle-implied rate.
- [BC Oracle](https://docs.fira.money/developers/utility-contracts/oracles/bc-oracle.md): BCOracleLib computes TWAP-based prices for Bond Tokens and Coupon Tokens from the FiraMarket's implied rate observations.
- [Libraries](https://docs.fira.money/developers/utility-contracts/libraries.md): Shared utility and math libraries used across the Fira protocol for arithmetic, token transfers, error handling, and deployment patterns.
- [Math](https://docs.fira.money/developers/utility-contracts/libraries/math.md): Fixed-point arithmetic libraries operating at 1e18 scale — the arithmetic backbone of the Fira protocol.
- [Helpers](https://docs.fira.money/developers/utility-contracts/libraries/helpers.md): Helper libraries for token transfers, error definitions, ownership patterns, and the split-code deployment factory for contracts exceeding the 24KB limit.
- [Contract Deployments](https://docs.fira.money/developers/deployment.md): Mainnet contract addresses, market configurations, oracle pipelines, router facets, and key roles for the Fira Protocol deployment.
- [User Flows](https://docs.fira.money/developers/user-flows.md): Step-by-step user flows for every major operation in the Fira protocol, with sequence diagrams, preconditions, views, and events.
- [Borrow Fixed Rate](https://docs.fira.money/developers/user-flows/borrow-fixed-rate.md): Supply collateral and borrow at a fixed rate in a single transaction, receiving USDC via the BT→FW→token path.
- [Repay Fixed Rate](https://docs.fira.money/developers/user-flows/repay-fixed-rate.md): Repay fixed-rate debt using any input token, with automatic BT acquisition via AMM swap (pre-expiry) or BT+CT minting (post-expiry).
- [Variable Rate Lending](https://docs.fira.money/developers/user-flows/variable-rate-lending.md): Supply collateral and borrow USDC at a variable rate directly from the lending market, or lend USDC via the SisuVault for variable yield.
- [Repay Variable Rate](https://docs.fira.money/developers/user-flows/repay-variable-rate.md): Repay variable-rate USDC debt directly on the lending market.
- [Trade BT/CT](https://docs.fira.money/developers/user-flows/trade-bt-ct.md): Mint BT+CT from tokens by splitting FW, and redeem BT+CT back to tokens with different handling pre- and post-expiry.
- [Provide Liquidity](https://docs.fira.money/developers/user-flows/provide-liquidity.md): Provide liquidity to the BT/FW market using dual-sided, single-sided, or keep-CT strategies and receive LP tokens.
- [Remove Liquidity](https://docs.fira.money/developers/user-flows/remove-liquidity.md): Burn LP tokens to withdraw proportional BT and FW from the FiraMarket pool.
- [FW Deposit & Redeem](https://docs.fira.money/developers/user-flows/fw-deposit-redeem.md): Deposit tokens into FW to earn yield, and redeem FW shares back to underlying tokens.
- [Pre/Post Expiry Exits](https://docs.fira.money/developers/user-flows/pre-post-expiry-exits.md): Unwind LP, BT, and CT positions to a single token or FW in one transaction, with different strategies pre- and post-expiry.
- [Events & Indexing](https://docs.fira.money/developers/events-and-indexing.md): Event tracking and position measurement across Fira markets, covering the 8 role buckets and their on-chain event sources.
- [Event Table](https://docs.fira.money/developers/events-and-indexing/event-table.md): Corrected event-to-role mapping for the Fira incentive indexer, with analysis of issues found in the original table.
- [Position Measurement](https://docs.fira.money/developers/events-and-indexing/reward-measurement.md): Position measurement formulas and on-chain function calls for each role bucket. Technical reference for integrators tracking user exposure across Fira markets.
- [Integrations](https://docs.fira.money/developers/integrations.md): A practical guide for protocols and front-ends integrating with Fira's on-chain contracts.
- [Interfaces](https://docs.fira.money/developers/integrations/interfaces.md): Complete reference of all Fira Protocol Solidity interfaces, grouped by module, with key function signatures and type definitions.
- [Security Practices](https://docs.fira.money/developers/security-and-audits.md): Security overview for the Fira Protocol, covering multi-layered defences baked into every contract layer.
- [Security Design](https://docs.fira.money/developers/security-and-audits/security-practices.md): In-depth coverage of the security patterns and invariants enforced across the Fira Protocol smart contract stack.
- [Audits](https://docs.fira.money/developers/security-and-audits/audits.md)
- [Glossary](https://docs.fira.money/developers/glossary.md): Definitions of key terms, abbreviations, and concepts used throughout the Fira Protocol documentation.


---

# 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.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.
