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

# Pendle Events

> Track yield trading activities and strategies in Pendle markets

The `ethereum.yields.pendle_events` table captures all yield trading activities from Pendle's Router V4 contract, providing detailed information about different yield management strategies and their execution.

### Table Details

| Property | Value |
| - | - |
| Table Name | `ethereum.yields.pendle_events` |
| Table Status | Production-Ready |
| Unique Key | `unique_id` |

### Table Columns

| Column Name | Data Type | Description |
| - | - | - |
| block\_timestamp | TIMESTAMP\_NTZ(9) | Timestamp (UTC) of the block that contains this record. |
| block\_number | NUMBER(38,0) | Sequential number of the block that contains this record. |
| transaction\_hash | VARCHAR(66) | Hash of the transaction that produced this record. Uniquely identifies a transaction within the blockchain. |
| strategy | VARCHAR(16777216) | Type of yield strategy (long\_yield, short\_yield, mint\_pt\_yt, redeem\_pt\_yt, mint\_sy, redeem\_sy, add\_liquidity, remove\_liquidity). |
| event\_name | VARCHAR(16777216) | Name of the Pendle router event that produced this record. |
| receiver | VARCHAR(16777216) | Address receiving tokens from the event. |
| market | VARCHAR(16777216) | Pendle market (liquidity pool) address. |
| market\_name | VARCHAR(16777216) | Human-readable market name. |
| lp\_amount\_str | VARCHAR(16777216) | Amount of liquidity pool tokens, as a string to retain precision. |
| lp\_amount | FLOAT | Amount of liquidity pool tokens. |
| lp\_amount\_usd | FLOAT | USD value of the liquidity pool tokens. |
| sy | VARCHAR(16777216) | Standardized yield token address. |
| sy\_name | VARCHAR(16777216) | Name of the standardized yield token. |
| sy\_amount\_str | VARCHAR(16777216) | Amount of standardized yield tokens, as a string to retain precision. |
| sy\_amount | FLOAT | Amount of standardized yield tokens. |
| sy\_amount\_usd | FLOAT | USD value of the standardized yield tokens. |
| pt | VARCHAR(16777216) | Principal token address. |
| pt\_name | VARCHAR(16777216) | Name of the principal token. |
| pt\_amount\_str | VARCHAR(16777216) | Amount of principal tokens, as a string to retain precision. |
| pt\_amount | FLOAT | Amount of principal tokens. |
| pt\_amount\_usd | FLOAT | USD value of the principal tokens. |
| yt | VARCHAR(16777216) | Yield token address. |
| yt\_name | VARCHAR(16777216) | Name of the yield token. |
| yt\_amount\_str | VARCHAR(16777216) | Amount of yield tokens, as a string to retain precision. |
| yt\_amount | FLOAT | Amount of yield tokens. |
| yt\_amount\_usd | FLOAT | USD value of the yield tokens. |
| token | VARCHAR(16777216) | Address of the token being swapped in or out. |
| token\_name | VARCHAR(16777216) | Name of the token being swapped. |
| token\_symbol | VARCHAR(16777216) | Symbol of the token being swapped. |
| token\_amount\_str | VARCHAR(16777216) | Amount of tokens being swapped, as a string to retain precision. |
| token\_amount | FLOAT | Amount of tokens being swapped. |
| token\_amount\_usd | FLOAT | USD value of the swapped tokens. |
| usd\_amount | FLOAT | Total USD value of the event. |
| extra\_fields | VARIANT | JSON object containing additional fields from the onchain event that are not part of the standard schema. |
| transaction\_index | NUMBER(38,0) | Zero-based position of the transaction within its block. The first transaction in a block has index 0. |
| log\_index | NUMBER(38,0) | Zero-based position of this event log within its transaction. The first log emitted by a transaction has index 0. |
| block\_hash | VARCHAR(66) | Cryptographic hash of the block header that contains this record. Uniquely identifies a block. |
| unique\_id | VARCHAR(16777216) | Allium's deterministic unique identifier for this row, generated from the fields that uniquely identify the record. Stable across full refreshes. |
| \_created\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was created in the database. |
| \_updated\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was last updated in the database. |
| \_changed\_since\_full\_refresh | BOOLEAN | Indicates if the record has changed since the last full data refresh. |

### Strategy Types

Events are mapped to specific strategies based on the type of operation:

1. **Yield Position Strategies**

   * `long_yield`: Buying YT or selling PT
   * `short_yield`: Selling YT or buying PT

2. **Token Management**

   * `mint_pt_yt`: Minting principal and yield tokens
   * `redeem_pt_yt`: Redeeming principal and yield tokens
   * `mint_sy`: Minting standardized yield tokens
   * `redeem_sy`: Redeeming standardized yield tokens

3. **Liquidity Operations**
   * `add_liquidity`: Adding tokens to markets
   * `remove_liquidity`: Removing tokens from markets

### Strategy Mapping Logic

The strategy field is determined by the following rules:

| Event Type | Condition | Strategy |
| - | - | - |
| Swap YT | YT amount > 0 | long\_yield |
| Swap YT | YT amount \< 0 | short\_yield |
| Swap PT | PT amount > 0 | short\_yield |
| Swap PT | PT amount \< 0 | long\_yield |
| Mint/Redeem | MintPyFromToken/Sy | mint\_pt\_yt |
| Mint/Redeem | RedeemPyToToken/Sy | redeem\_pt\_yt |
| Mint/Redeem | MintSyFromToken | mint\_sy |
| Mint/Redeem | RedeemSyToToken | redeem\_sy |
| Liquidity | AddLiquidity | add\_liquidity |
| Liquidity | RemoveLiquidity/Exit | remove\_liquidity |

### Usage Example

This query fetches the strategies that have been used in a market.

```sql theme={null}
select
  date(block_timestamp) as date,
  strategy, 
  sum(usd_amount) as usd 
from ethereum.yields.pendle_events
where market = '0x9a63fa80b5ddfd3cab23803fdb93ad2c18f3d5aa'
group by all
order by 1 desc
```

This query finds the largest yield trading positions in the last 30 days.

### Related Docs

* [EVM Yields Pendle Events](/historical-data/supported-blockchains/evm/core-schemas/yields/pendle-events)
