> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lunya.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Flash Loans

> Borrow pool balances within a single transaction

## What they are

Every pool on the exchange — CL, CP, and STABLE alike — supports **flash loans**: borrow any amount of the pool's balances, use it, and repay it plus the fee before the transaction ends. If repayment doesn't happen, the whole transaction reverts as if nothing occurred.

## How it works

<Steps>
  <Step title="Call flash">
    A contract calls `flash` on the pool, specifying the amounts of each token to borrow and a recipient.
  </Step>

  <Step title="Receive the callback">
    The pool transfers the tokens out, then calls the borrower's callback. Inside it, the borrower does whatever the loan was for — arbitrage, collateral swaps, liquidations.
  </Step>

  <Step title="Repay plus fee">
    Before the callback returns, the borrower must have paid back the amounts borrowed plus the flash fee. The pool verifies its balances; anything short reverts the entire transaction.
  </Step>
</Steps>

## Fees

The flash fee follows the pool's swap fee, and the paid fees accrue to the pool's liquidity providers (and the protocol share) exactly like trading fees — flash volume is another revenue stream for LPs.

## For whom

Flash loans are a developer primitive: arbitrageurs, liquidation bots, and protocols building collateral-migration or refinancing flows. There is nothing to configure as an LP — your liquidity simply earns the extra fees.

<Info>
  Callback interface details for integrators are in the [Developers](/developers/integrations) section.
</Info>
