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.

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 TypeConditionStrategy
Swap YTYT amount > 0long_yield
Swap YTYT amount < 0short_yield
Swap PTPT amount > 0short_yield
Swap PTPT amount < 0long_yield
Mint/RedeemMintPyFromToken/Symint_pt_yt
Mint/RedeemRedeemPyToToken/Syredeem_pt_yt
Mint/RedeemMintSyFromTokenmint_sy
Mint/RedeemRedeemSyToTokenredeem_sy
LiquidityAddLiquidityadd_liquidity
LiquidityRemoveLiquidity/Exitremove_liquidity

Usage Example

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

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.

Table Columns

Column NameDescription
strategyType of yield strategy (long_yield, short_yield, mint_pt_yt, etc.)
event_nameName of the Pendle Router V4 event
receiverAddress receiving tokens from the event
marketPendle market (liquidity pool) address
market_nameHuman-readable market name
lp_amountAmount of liquidity pool tokens
syStandardized yield token address
sy_nameName of standardized yield token
sy_amountAmount of standardized yield tokens
ptPrincipal token address
pt_nameName of principal token
pt_amountAmount of principal tokens
ytYield token address
yt_nameName of yield token
yt_amountAmount of yield tokens
tokenAddress of token being swapped
token_nameName of token being swapped
token_symbolSymbol of token being swapped
token_amountAmount of tokens being swapped
token_amount_usdUSD value of swapped tokens
usd_amountTotal USD value of event
callerAddress initiating the transaction
transaction_hashTransaction hash
transaction_indexIndex of transaction in block
block_timestampBlock timestamp
block_numberBlock number
block_hashBlock hash
from_addressTransaction sender address
to_addressTransaction recipient contract
log_indexEvent log index
topic0First event log topic
extra_fieldsAdditional event fields
unique_idUnique event identifier