# Flash Loans

> FLASH_LOAN command: the FlashLoanIds enum and how a flash loan wraps a composer operation sequence.

Source: https://docs.1delta.io/smart-contract-api/flash-loan/

---

[Operations](./operations.md) → Flash Loans _(Composer)_

Lead type: `ComposerCommands.FLASH_LOAN`.

The sub types are defined by the following enum:

`FlashLoanIds` Enum

| Value | Name          | Description                 |
| ----- | ------------- | --------------------------- |
| 0     | `MORPHO`      | Morpho Blue flash loans     |
| 1     | `BALANCER_V2` | Balancer V2 (covers Swaap)  |
| 2     | `AAVE_V3`     | Aave V3 (covers many forks) |
| 3     | `AAVE_V2`     | Aave V2 (covers many forks) |

To encode an operation, the caller has to append this data to the call.

```solidity
abi.encodePacked(
    uint8(ComposerCommands.FLASH_LOAN),
    uint8(FlashLoanIds.[FlashLoanProvider]),
    ...params
)
```

Alternative sources can be Uniswap V4 and Balancer V3. These are triggered via the lead type: `ComposerCommands.GEN_2025_SINGELTONS`. We elaborate on these later.

## Specific lenders

-   [Accepted sources](./flash-loan/accepted-sources.md)
-   [Standard providers](./flash-loan/standardized-interface.md)
-   [Singletons](./flash-loan/singletons.md)
