# FlashloanLogic

{% hint style="info" %}
It records when a **flash loan** is executed, including who initiated it, the borrowed asset, the amount, the applied premium, and whether it results in stable/variable borrowing if not repaid instantly.
{% endhint %}

### Events

* **FlashLoan(target, initiator, asset, amount, interestRateMode, premium, referralCode)**\
  Emitted when a **flash loan** is executed in the protocol.
  * `target`: Address of the contract that receives the flash loaned funds.
  * `initiator`: Address that triggered the flash loan transaction.
  * `asset`: Token address of the asset borrowed.
  * `amount`: Amount of tokens borrowed in the flash loan.
  * `interestRateMode`: Debt mode chosen if the flash loan is not fully repaid (stable or variable debt).
  * `premium`: Fee charged for using the flash loan.
  * `referralCode`: Optional referral code for partner programs.

```
[
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true, "internalType": "address", "name": "target", "type": "address" },
      { "indexed": false, "internalType": "address", "name": "initiator", "type": "address" },
      { "indexed": true, "internalType": "address", "name": "asset", "type": "address" },
      { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" },
      { "indexed": false, "internalType": "enum DataTypes.InterestRateMode", "name": "interestRateMode", "type": "uint8" },
      { "indexed": false, "internalType": "uint256", "name": "premium", "type": "uint256" },
      { "indexed": true, "internalType": "uint16", "name": "referralCode", "type": "uint16" }
    ],
    "name": "FlashLoan",
    "type": "event"
  }
]

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://colend.gitbook.io/home/abi/flashloanlogic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
