Integrations
A practical guide for protocols and front-ends integrating with Fira's on-chain contracts.
This section is aimed at developers who want to build on top of the Fira Protocol — whether you are a DeFi aggregator routing swaps, a lending protocol using Fira yield tokens as collateral, or a front-end displaying position data.
Quick start
1. Identify the entry point
Wrap USDC into yield-bearing FW
USDCFW
IFiraWrappedStandardized
Swap BT ↔ FW
FiraMarket
IPMarket
Mint / redeem BT + CT
CouponToken
IBCToken
Add / remove LP liquidity
FiraRouter
IPActionAddRemoveLiqV3
Borrow at fixed rate
FiraRouter
IPActionBorrow
Read market state & oracle
FiraMarket
IPMarket.readState, observe
2. Approve tokens
All Fira entry points pull tokens from msg.sender via transferFrom. Before calling any state-mutating function, approve the target contract (or the Router) for the relevant ERC-20.
3. Use the Router or call contracts directly
The FiraRouter aggregates most user-facing actions behind a single address with typed facet interfaces. Integrators can:
Call Router facets for complex multi-step flows (swap + borrow, add liquidity with single-sided input, etc.).
Call individual contracts (FiraMarket, USDCFW, CouponToken) directly for simpler interactions.
Common patterns
Reading prices and rates
Previewing deposits and redeems
Checking expiry
Post-expiry, BT redeems 1:1 for FW and CT stops accruing. LP positions should be exited before expiry for optimal value.
Amount conventions
FW, BT, CT amounts — Native token decimals (matching the underlying, e.g. 6 for USDC-backed FW).
Exchange rates, indices, proportions — 1e18 fixed-point.
Signed integers (
int256) — Used for swap amounts. Negative = paying, positive = receiving.Slippage — Always the caller's responsibility via
minOut/minSharesOutparameters. The contracts will revert if the minimum is not met.
Pages
Interfaces & API Surface — Complete reference of all Fira interfaces, grouped by module
Last updated