ActionBorrow
ActionBorrow integrates with the lending market for fixed-rate borrowing and repayment in a single transaction.
Last updated
ActionBorrow integrates with the lending market for fixed-rate borrowing and repayment in a single transaction.
Source: src/fira_bonding/router/ActionBorrow.sol
supplyAndBorrowSingleTokenSupply collateral → borrow BT → swap BT to FW → redeem FW to desired token. All in one transaction.
borrowSingleTokenSame flow but assumes collateral is already supplied.
repayConverts input token to BT and repays the lending market:
Pre-expiry: Input token → FW (mint) → BT (AMM swap) → repay. Refunds excess BT.
Post-expiry: Input token → FW (mint) → BT+CT (via CT.mintBC) → repay with BT. CT is minted but has zero value post-expiry.
The borrow position is owned by msg.sender, but the router is the token receiver — BT is held transiently and swapped immediately.
tokensToRepay must be ≤ current debt, otherwise reverts with "AB: repay too much".
Requires the user to have authorized the router on the LendingMarket (setAuthorization(router, true)).
Last updated