Flash Credit
Flash Credit lets you move loans/ deposits, swap collateral, adjust leverage and close positions in a single transaction.
On this page
- On the roadmap
- V1 Foundation
- Lending and flash loans
- Onchain lending market
- Flash loan fee
- 0
- Health floor
- 1.25
- Transactions
- 1
Managing a lending position
Flash Credit lets borrowers and lenders adjust their positions in one transaction instead of managing each step separately.
- Lower borrowing rates: Move a loan and its collateral to a market with a lower interest rate.
- Swap collateral: Replace your collateral with another supported token without closing the loan.
- Adjust leverage: Increase or reduce your WETH exposure using a flash loan.
- Close a loan: Repay debt using your collateral, without needing the borrowed token in your wallet.
- Move deposits: Transfer supplied assets from one lending market to another.
The Five Functions
Each function executes a fixed block of lending market operations. See below:
| Function | What moves | Flash loan | Swap | Fee base |
|---|---|---|---|---|
refinance | Whole loan, to a market with the same two tokens | The debt | None | The debt |
swapCollateral | All debt, to another collateral with old collateral being sold | The debt | Exact input | The debt |
leverage | Collateral bought with the flash loan, borrowed with the fee | flashAssets | Exact input | flashAssets |
deleverage | Debt repaid with own collateral, close empties the position | The repaid debt | Exact output | The repaid debt |
moveSupply | Lender’s whole supply, same loan token | None | None | The supply withdrawn |
Inside the transaction
You send one transaction, with your bounds in it
Your signed grant gives FlasetCredit permission on your position
Deadline, allowlist, fee and caps are checked
The lending market lends the flash loan, with no fee
The steps of your move run, in their fixed order
The lending market takes the flash loan back
Health is checked against your minimum and the floor
Your signed revoke takes the permission back
SETTLEDThe flasetCredit permission is revoked after execution, leaving no token allowances or funds in the contract.
If any step fails, the entire transaction reverts.
Your Position
Loans, collateral and deposits stay on the lending market, positions can be liquidated if health falls below 1.00.
FlasetCredit executes your chosen function and checks its limits. If paused, you can still manage your position directly on the lending market.
To pay Flash Checkout invoices using a loan, use the separate Pay with Credit contract.
Permissions and Limits
With signed authorization, you grant FlasetCredit access and revoke it after execution. Smart wallets can use setAuthorization(FlasetCredit, true), which remains active until revoked. Each function only accesses the caller’s position (msg.sender).
Transaction Limits
Every function includes:
maxFee: Maximum Flaset fee.minHealth: Minimum health (1e18 is the liquidation threshold).deadline: Transaction expiry.
Depending on the function, additional limits include maxBorrow, minCollateralOut, maxCollateralIn and poolFee. If any limit fails, the transaction reverts.
How the move is charged
fee = amount * feeBps / 10_000
feeBps = 20Each move charges one fee in the loan token, deducted during execution. Check it before signing with quoteFee(amount), where amount is defined. The flash loan itself has no fee, you only pay if you make profit.
- Debt in the old market
- $10,000 USDC
- Fee, 10,000 × 20 ÷ 10,000
- $5 USDC
- Debt in the new market
- $10,005 USDC
- Lowest
maxFeethat settles - $5 USDC
- Lowest
maxBorrowthat settles - $10,005 USDC
Liquidation and Failed Transactions
- Liquidation risk: If health falls below 1.00, your collateral can be liquidated. Interest is at a variable rate and leverage increases risk. Health is checked when the transaction settles.
- Example: With 10 WETH at $2,000 and $10,000 USDG debt in a 77% LLTV market, health is 1.54. Liquidation becomes possible below around $1,299 per WETH, a 35% dump.
- Failed transactions: If a move fails, the entire transaction reverts.
- The lending market on mainnet: Flaset did not build or deploy it: 0x9D53d5E3bd5E8d4Cbfa6DB1ca238AEA02E651010