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:

FunctionWhat movesFlash loanSwapFee base
refinanceWhole loan, to a market with the same two tokensThe debtNoneThe debt
swapCollateralAll debt, to another collateral with old collateral being soldThe debtExact inputThe debt
leverageCollateral bought with the flash loan, borrowed with the feeflashAssetsExact inputflashAssets
deleverageDebt repaid with own collateral, close empties the positionThe repaid debtExact outputThe repaid debt
moveSupplyLender’s whole supply, same loan tokenNoneNoneThe supply withdrawn

Inside the transaction

What a Flash Credit move looks like
  1. You send one transaction, with your bounds in it

  2. Your signed grant gives FlasetCredit permission on your position

  3. Deadline, allowlist, fee and caps are checked

  4. The lending market lends the flash loan, with no fee

  5. The steps of your move run, in their fixed order

  6. The lending market takes the flash loan back

  7. Health is checked against your minimum and the floor

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

FlasetCredit: fee
fee = amount * feeBps / 10_000
feeBps      = 20

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

Refinance, worked out
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 maxFee that settles
$5 USDC
Lowest maxBorrow that 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