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

> ## Agent Instructions
> To query the Token Terminal data catalog, read https://tokenterminal.com/docs/catalog/agents-manual.md first. It is the whole catalog as one page: table naming grammar, key columns, partition and cluster rules, units, additivity, and the tables that are documented but not served yet.
> Never query a catalog table on a time bound alone. Also filter its cluster key, which you read from INFORMATION_SCHEMA.COLUMNS; an empty result means the object is a view, whose pruning contract is on its page. Compute is billed to the caller's own Google Cloud project.

# Withdrawals

> Every withdrawal from a lending market.

One row per withdrawal from a lending market, including the sending side of a receipt-token transfer. `amount` is the tokens taken out, and summing it per `user_address` replays a position.

## Columns

<table>
  <thead>
    <tr>
      <th width="270">Column</th>
      <th width="120">Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`block_timestamp`</td><td>TIMESTAMP</td><td>Time of the block containing the withdrawal. Partition column.</td></tr>
    <tr><td>`block_number`</td><td>INT64</td><td>Number of the block containing the withdrawal.</td></tr>
    <tr><td>`transaction_hash`</td><td>STRING</td><td>Hash of the transaction that emitted the withdrawal event.</td></tr>
    <tr><td>`log_index`</td><td>INT64</td><td>Position of the withdrawal event in the block.</td></tr>
    <tr><td>`unique_id`</td><td>INT64</td><td>Row key: fingerprint of chain\_id, block\_number, transaction\_hash, log\_index.</td></tr>
    <tr><td>`event_type`</td><td>STRING</td><td>Constant 'withdrawals'; stacking key across the lending facts.</td></tr>
    <tr><td>`project_id`</td><td>STRING</td><td>Protocol operating the market, such as aave.</td></tr>
    <tr><td>`app_id`</td><td>STRING</td><td>Deployment of the protocol the market belongs to.</td></tr>
    <tr><td>`chain_id`</td><td>STRING</td><td>Chain the withdrawal happened on.</td></tr>
    <tr><td>`lending_market_id`</td><td>STRING</td><td>Market the withdrawal left; joins `dimensions.lending_markets`.</td></tr>
    <tr><td>`lending_market_reserve_id`</td><td>STRING</td><td>Reserve within the market; joins `dimensions.lending_market_reserves`.</td></tr>
    <tr><td>`lending_market_contract_address`</td><td>STRING</td><td>Contract the market lives on; not a key.</td></tr>
    <tr><td>`receipt_token_address`</td><td>STRING</td><td>Receipt token whose balance moved (the aToken for Aave); null where positions are not tokenised.</td></tr>
    <tr><td>`token_id`</td><td>STRING</td><td>Token withdrawn: \{token\_address}-\{chain\_id}.</td></tr>
    <tr><td>`token_address`</td><td>STRING</td><td>Contract address of the token withdrawn.</td></tr>
    <tr><td>`token_symbol`</td><td>STRING</td><td>Symbol of the token withdrawn.</td></tr>
    <tr><td>`token_decimals`</td><td>INT64</td><td>Decimals of the token withdrawn.</td></tr>
    <tr><td>`withdrawer_address`</td><td>STRING</td><td>Where the value went: the receiver of the withdrawal, or the recipient on a receipt-token transfer.</td></tr>
    <tr><td>`user_address`</td><td>STRING</td><td>Account whose supplied balance fell; the position key across the lending facts.</td></tr>
    <tr><td>`shares_raw`</td><td>BIGNUMERIC</td><td>Movement in the protocol's interest-bearing unit, exact integer; summing per position replays the share balance.</td></tr>
    <tr><td>`shares`</td><td>BIGNUMERIC</td><td>shares\_raw decimal-corrected.</td></tr>
    <tr><td>`amount_raw`</td><td>BIGNUMERIC</td><td>Event-time amount in the token's stored unit, exact integer.</td></tr>
    <tr><td>`amount`</td><td>BIGNUMERIC</td><td>amount\_raw decimal-corrected into whole tokens. \*/}</td></tr>
  </tbody>
</table>

## Sample queries

> [!WARNING]
>
> This table is large and split by day. Bound `block_timestamp` and filter `chain_id` on every query, or you read the whole table and the whole table is billed to you.

**One day, one app**

`amount` is whole tokens and `amount_raw` the integer the contract emitted. `user_address` is whose supplied balance fell.

```sql theme={null}
select
    events.block_timestamp,
    events.token_symbol,
    events.amount,
    events.user_address
from `facts_lending_markets.withdrawals` as events
where events.block_timestamp >= timestamp('2026-09-01')
  and events.block_timestamp < timestamp('2026-09-02')
  and events.chain_id = 'ethereum'
  and events.app_id = 'aave-v3'
limit 100
```

**Daily withdrawals per app**

Group by `token_symbol` as well as app: `amount` is in each token's own units, so one sum per token is the comparable figure.

```sql theme={null}
select
    date(events.block_timestamp) as day,
    events.app_id,
    events.token_symbol,
    sum(events.amount) as withdrawn
from `facts_lending_markets.withdrawals` as events
where events.block_timestamp >= timestamp('2026-08-01')
  and events.block_timestamp < timestamp('2026-09-01')
  and events.chain_id = 'ethereum'
group by day, events.app_id, events.token_symbol
order by day, withdrawn desc
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.