Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 776 Bytes

README.md

File metadata and controls

30 lines (25 loc) · 776 Bytes

Use this tool to extract historical on-chain price data from an archive node.

Shoutout to Banteg (@bantg) and nymmrx (@nymmrx) for their awesome work on yearn-exporter that made this library possible.

To install:

pip install ypricemagic

To use:

from ypricemagic import magic
magic.get_price(token,block)

Or:

from ypricemagic.magic import get_price
get_price(token,block)

You can also import protocol specific modules. For example:

from ypricemagic import uniswap
uniswap.get_price(token, block)
from ypricemagic.compound import get_price
get_price(compoundToken, block)