Skip to main content

Python SDK for interacting with Pendle Finance data

Project description

pendle-yield

pendle-yield is a Python SDK for interacting with Pendle Finance data. It provides a high-level, developer-friendly interface to fetch, analyze, and work with on-chain data from sources like the Etherscan and Pendle Finance APIs.

The primary goal is to simplify data access for developers, analysts, and enthusiasts building tools and strategies around the Pendle ecosystem.

Installation

⚠️ Alpha Version: This package is under active development. APIs may change between releases.

Install from PyPI:

pip install pendle-yield

Quick Start

from pendle_yield import PendleEpoch, PendleYieldClient

# Initialize with your Etherscan API key
client = PendleYieldClient(etherscan_api_key="your_api_key_here")

# Create epoch object, epoch starts on Th 00:00:00 and ends on Wd 23:59:59
epoch = PendleEpoch("2025-08-21")

# Get enriched vote events for the epoch
votes = client.get_votes_by_epoch(epoch)

# Display vote information
for vote in votes:
    print(f"Voter: {vote.voter_address}")
    print(f"Pool: {vote.pool_name} ({vote.protocol})")
    print(f"APY: {vote.voter_apy*100:.2f}%")
    print(f"Bias: {vote.bias:,}")
    print(f"Slope: {vote.slope:,}")
    print(f"VePendle Value: {vote.ve_pendle_value:.4f}")

What it does now

The get_votes_by_epoch() method:

  1. Fetches vote events from Etherscan for the specified Pendle epoch
  2. Enriches them with pool metadata from Pendle Finance API
  3. Returns structured data combining both sources

Each vote event includes:

  • Voter address and transaction details
  • Pool information (name, address, protocol, expiry, current voter APY)
  • Vote parameters (bias, slope)
  • VePendle value: Calculated voting power at the time of the vote using the formula VePendle = max(0, (bias - slope × timestamp) / 10^18)

Requirements

Development

This project uses PDM for dependency management:

# Install dependencies
pdm install

# Run tests
pdm run pytest

# Run the example
pdm run python examples/basic_usage.py

Pendle API

To update pendle client

openapi-python-client generate --url https://api-v2.pendle.finance/core/docs-json --meta pdm --output-path src --config openapi.yaml --overwrite

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pendle_yield-0.1.0a1.tar.gz (146.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pendle_yield-0.1.0a1-py3-none-any.whl (408.0 kB view details)

Uploaded Python 3

File details

Details for the file pendle_yield-0.1.0a1.tar.gz.

File metadata

  • Download URL: pendle_yield-0.1.0a1.tar.gz
  • Upload date:
  • Size: 146.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.13.7 Darwin/23.6.0

File hashes

Hashes for pendle_yield-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 ace5b5927a163419b7ba3f38312c0e53cb54c9b211cfa0c9d09b59ea753815d1
MD5 1a06a2fefe543e595e4156218e1f91d6
BLAKE2b-256 2b51285ad8963c8dfdd435feae86f9b83f0404546aeff418cb1f3fd2d541620b

See more details on using hashes here.

File details

Details for the file pendle_yield-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: pendle_yield-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 408.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.13.7 Darwin/23.6.0

File hashes

Hashes for pendle_yield-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8df72d3b1d8c9a4e742d731b3d67123deffcca97f8e7cbad8abe3206faea3394
MD5 b01f3c39c41bb35af860adeb451e7e41
BLAKE2b-256 7ca3338d11dbe9cbddf3ed92f3489137e5f785cb5d30fb8cff970dd0e0ee7c8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page