> For the complete documentation index, see [llms.txt](https://docs.kaiko.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kaiko.com/cloud-delivery/lending-and-borrowing/borrows-repayments-liquidations-and-withdrawals.md).

# Borrows, repayments, liquidations, and withdrawals

{% hint style="info" %}

### This data is included in the following Kaiko packages

* Level 1 & Level 2 Data \[Level 1 Tick-Level Tier]
* Level 1 & Level 2 Data \[Level 2 Aggregations Tier]
  {% endhint %}

## What is this dataset?

This dataset offers transactions (borrows, repayments, withdrawals, deposits and liquidations) registered on-chain, for the main L\&B protocols.

### File structure details

* File Name: \[blockchain]\_\[kaiko\_exchange\_code]\_\[underlying\_asset\_symbol]\_\[underlying\_asset\_address]\_\[event\_type]\_\[date].csv
  * Files are created on a daily basis.
  * example: ethereum\_aav2\_WETH\_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\_withdraw\_2023-02-14.csv.gz
* Cut-off time: `00:00:00 UTC`
  * We use the timestamp of the block in order to cut-off the data points between days.
* Column Delimiter: , (comma)
* Decimal Mark (in numbers): . (dot)

| Field              | Description                                                      | Example                                      |
| ------------------ | ---------------------------------------------------------------- | -------------------------------------------- |
| `blockchain`       | The blockchain on which the transaction happened.                | `ethereum`                                   |
| `protocol`         | Code of the L\&B protocol.                                       | `aave/v2`                                    |
| `block_number`     | The height of the block in which the transaction happened.       | `16025918`                                   |
| `datetime`         | The timestamp of the block in which the transaction happened.    | `1669124591`                                 |
| `transaction_hash` | Transaction hash                                                 | ---                                          |
| `log_index`        | Log index of the transaction                                     | `152`                                        |
| `type`             | Event type: Borrow, deposit, withdraw, repayment or liquidation. | `borrow`, `deposit`, etc                     |
| `user_address`     | Address of the user.                                             | `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045` |
| `asset_symbol`     | Symbol of the underlying asset.                                  | `crv`                                        |
| `asset_address`    | Address of the underlying asset.                                 | `0xd533a949740bb3306d119cc777fa900ba034cd52` |
| `asset_decimals`   | Decimals of the underlying asset.                                | `18`                                         |
| `receipt_symbol`   | Symbol of the receipt asset.                                     | `acrv`                                       |
| `receipt_address`  | Address of the receipt asset.                                    | `0x8dae6cb04688c62d939ed9b68d32bc62e49970b1` |
| `receipt_decimals` | Decimals of the receipt asset.                                   | `18`                                         |
| `amount`           | Amounts of the borrowed token.                                   | `299894.78`                                  |

#### As well as the following fields specific to each event type:

*Borrow Event*

| Field            | Description                                                                          | Example                                      |
| ---------------- | ------------------------------------------------------------------------------------ | -------------------------------------------- |
| `amount_receipt` | Amounts of the receipt token.                                                        | `299899`                                     |
| `rate`           | Borrow rate (at the event level or at the contract level depending on the protocol). | `0.02820253961814756`                        |
| `rate_type`      | Stable (1) or Variable (2)                                                           | `1` or `2`                                   |
| `on_behalf_of`   | The address of the user who will incur the debt.                                     | `0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31` |

*Deposit Even*t

| Field            | Description                                       | Example                                      |
| ---------------- | ------------------------------------------------- | -------------------------------------------- |
| `amount_receipt` | Amounts of the receipt token.                     | `299899`                                     |
| `rate`           | Supply rate of the overall lending pool.          | `0.000203088325657998768898798`              |
| `on_behalf_of`   | The address that will receive the receipt tokens. | `0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31` |

*Withdraw Event*

| Field            | Description                                         | Example                                      |
| ---------------- | --------------------------------------------------- | -------------------------------------------- |
| `amount_receipt` | Amounts of the receipt token.                       | `299899`                                     |
| `on_behalf_of`   | The address that will receive the underlying token. | `0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31` |

*Repayment Event*

| Field              | Description                                      | Example                                      |
| ------------------ | ------------------------------------------------ | -------------------------------------------- |
| `amount_receipt`   | Amounts of the receipt token.                    | `299899`                                     |
| `on_behalf_of`     | The address of the user who will incur the debt. | `0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31` |
| `borrow_rate_mode` | Stable (1) or Variable (2)                       | `1` or `2`                                   |

*Liquidation Event*

| Field                              | Description                                                                               | Example                                      |
| ---------------------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------- |
| `liquidation_debt_asset_symbol`    | Symbol of the debt asset.                                                                 | `renfil`                                     |
| `liquidation_debt_asset_address`   | Address of the debt asset.                                                                | `0xd5147bc8e386d91cc5dbe72099dac6c9b99276f5` |
| `liquidation_debt_asset_decimals`  | Decimals of the debt asset.                                                               | `18`                                         |
| `liquidation_debt_amount_in_asset` | Amount of the debt asset.                                                                 | `1899`                                       |
| `liquidation_caller_address`       | The address that triggered the liquidation transaction.                                   | `0xdfd3bd446f1b7fd96dc995126ee845af0b1254cd` |
| `receive_receipt_token`            | The liquidator chooses to receive the collateral's asset (False) or receipt token (True). | `True` or `False`                            |
| `liquidation_type`                 | Debt (1) or Collateral (2)                                                                | `1`                                          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kaiko.com/cloud-delivery/lending-and-borrowing/borrows-repayments-liquidations-and-withdrawals.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
