Repay Fixed Rate
Repay fixed-rate debt using any input token, with automatic BT acquisition via AMM swap (pre-expiry) or BT+CT minting (post-expiry).
Key references: ActionBorrow.repay.
Details
Goal: Repay debt using an input token; router converts to BT as needed.
Preconditions:
Existing borrow: else
"AB: no borrow".tokensToRepaymust be ≤ current debt: else"AB: repay too much".Input token approval to router.
Expiry handling:
Pre-expiry: Input token → FW (mint) → BT (AMM swap via FiraMarket). Repay, refund excess BT.
Post-expiry: Input token → FW (mint to CT contract) →
CT.mintBCproduces BT + CT. Only BT is used for repayment. CT is minted but NOT burned — it stays in the router with zero economic value.
Views and events
Views
Lending:
getUserPosition(pre/post),position(id, user).Market:
isExpired().FW:
previewDeposit,bcIndexStored()for estimation on expired paths.
Events
Lending:
EventsLib.Repay(assets, shares), possiblyEventsLib.AccrueInterest.Router/Misc:
MintFwFromToken,MintBcFromFwwhen conversions occur.
Last updated