ypricemagic
Use this tool to extract historical on-chain price data from an archive node.
ypricemagic is built to work seamlessly with both sync and async Python codebases using the ez-a-sync framework.
Requirements
- Python 3.9 or higher.
- At least 16GB of RAM.
Prerequisites
- First, you will need to bring your own archive node. This can be one you run yourself, or one from one of the common providers (Tenderly, Alchemy, QuickNode, etc.)
- You will also need an auth token for Etherscan's API. Follow their guide to get your key, and set env var
ETHERSCAN_TOKENwith its value.
Installation
ypricemagic is published on PyPI. Simply install it just as you would any other library.
pip install ypricemagic
Network Configuration
ypricemagic utilizes the Brownie framework for Ethereum smart contract interactions. As such, it's essential that users configure a Brownie network to use their chosen RPC. Ensure you have access to an Ethereum node (e.g., through Infura or Alchemy) and add the provided API endpoint to your Brownie network configuration.
Refer to the Brownie documentation on network management for detailed guidance on setting up your networks. This setup is critical, as without it, ypricemagic will not be able to communicate with your RPC.
Usage
There are 2 main entrypoints to ypricemagic, y.get_price and y.get_prices.
from y import get_price
price = get_price(token,block)
# OR
from y import get_prices
prices = get_prices(tokens, block)
You can also use ypricemagic asynchronously:
price = await get_price(token, block, sync=False)
# OR
prices = await get_prices(tokens, block, sync=False)
See the docs for more usage information.
Debug logging
If you need to spot long-running async calls, enable the y.stuck? logger at DEBUG to get periodic "still executing" messages. Details: y.stuck? logger.
Extras
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)
These are not 'supported' per se and are subject to change at any time. But they can come in handy. The not-very-organized docs site will be your friend here.
Enjoy!
Shoutouts
Shoutout to Banteg (@bantg) and nymmrx (@nymmrx) for their awesome work on yearn-exporter that made this library possible.
Metadata
Release files for ypricemagic 5.2.29
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ypricemagic-5.2.29.tar.gz | 281.0 kB | Without provenance | Details for ypricemagic-5.2.29.tar.gz |
Built distributions (wheels)
Total release size: 14.6 MB
Release files / ypricemagic-5.2.29.tar.gz
| Download URL | ypricemagic-5.2.29.tar.gz |
|---|---|
| Size | 281.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ff0b8ade0f6e030c714a56c98a3b86e7f87602ba10fbfc2383906a740092e56
|
|
BLAKE2b-256 checksum How to use checksums |
db6089e42959f1ce73176621a1567c3e10139e6f48f6c301a285480297aa9b54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp313-cp313-win_amd64.whl
| Download URL | ypricemagic-5.2.29-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 465.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
87e36f32d09e3afd695b233e507d9876ab28ce8f09a806bcfd157ae9d9b706c2
|
|
BLAKE2b-256 checksum How to use checksums |
5f6fd4304ec86fb3f7fa3777f2c205313f8f2177e7d2ff658801cbc212e00384
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp313-cp313-win32.whl
| Download URL | ypricemagic-5.2.29-cp313-cp313-win32.whl |
|---|---|
| Size | 437.3 kB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
9fb3ea76c4ca7c43f2fd689e5a746eb36d84e2de26dc696f09551d2c878cff28
|
|
BLAKE2b-256 checksum How to use checksums |
c04e074d691f6275baa64b6501fcf49ce487fda990fdd6cd4e4f98734fd90cf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 713.1 kB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
db3cabde63f449b53a4e09153dfad72f675d091520c45aa332d916f84f9b0702
|
|
BLAKE2b-256 checksum How to use checksums |
b6d60aba17e774c143a3d2b0e6b35bc4390f650d455e978bd2f5c02a55f14fce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 716.1 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
66f0c4b4eb40ebee49135d95a9e313a13bcb36e91178d7a54f2179b46738707c
|
|
BLAKE2b-256 checksum How to use checksums |
37d4f30f914f9ad787a4a6160ab8542a2ecc3e38eb391606a49ef7d0ad970131
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl
| Download URL | ypricemagic-5.2.29-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl |
|---|---|
| Size | 740.5 kB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
de5e20ad85b90315619bdf624ee2e2a6be53c311128604e52713e84a97614e0f
|
|
BLAKE2b-256 checksum How to use checksums |
b6270c004f3056de7eafe50043ed45c1e5ab241f86ebe779d343126e3fb3c993
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | ypricemagic-5.2.29-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 529.8 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3068ac6defc9099de7e71f7b59df26a76b4d46e1e0d7a8f0ea0c7390fbfcde88
|
|
BLAKE2b-256 checksum How to use checksums |
25b8082fcf5b704bd07e9c9c52ad8845bee7e2d85c48d5b27adbf61c28a73f7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp312-cp312-win_amd64.whl
| Download URL | ypricemagic-5.2.29-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 464.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8fd274e4a927b82cc31099a8a7ded71398e59e876ad3fd49bd96b953d3ce3243
|
|
BLAKE2b-256 checksum How to use checksums |
9fb32f9bbd3fbaa87f1e1df48adabafae41bb4fb2ae32a806fd5ebda40f89342
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp312-cp312-win32.whl
| Download URL | ypricemagic-5.2.29-cp312-cp312-win32.whl |
|---|---|
| Size | 437.4 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
1ea8df694be0c987e44bf28ead136571fe9fea0bbbc9b16353a41b2399e6e3cc
|
|
BLAKE2b-256 checksum How to use checksums |
d3c21ee66e8ed6f48418e70c3a85cd45d754e3a3483769da7bac48a6895c0467
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 718.1 kB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
53af8aa465569e1939c6ba444ec6c781011aca0fb0850ac0dda0802f8a4b4b37
|
|
BLAKE2b-256 checksum How to use checksums |
ebc8c009104b426297e3a9e7401ab2a888273b1e31088fff42ddb9aa55fea679
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 722.2 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
600798c58ecfad3cdbabfcea820b712cfb599531fd052e076ec398282a74e83f
|
|
BLAKE2b-256 checksum How to use checksums |
70c9a98f6c94c4005954b11eafbbbb789e84b07ea98bfd359cd9b3510a6936c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl
| Download URL | ypricemagic-5.2.29-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl |
|---|---|
| Size | 742.3 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
3ef5ee5319227cd9196efa83a4dd1a14709d4764f572cffbad000d447c28a0e2
|
|
BLAKE2b-256 checksum How to use checksums |
20e0883764d896633f79b32665c5cc7a05652ef8294c1b7b043c4cd60945ebfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | ypricemagic-5.2.29-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 530.0 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
61e8340793cf353a2607d23a71f16cf49f59ffcf4d48fa81b7a21881df736202
|
|
BLAKE2b-256 checksum How to use checksums |
b330eb70675d313b712e9fa7bd2efb6ff4c5ec20881338442e14eafbc69a92ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp311-cp311-win_amd64.whl
| Download URL | ypricemagic-5.2.29-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 462.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
27882f11d7cea8512bbb70d387fc349c513789af61f7986c2ed7cbaf1d605660
|
|
BLAKE2b-256 checksum How to use checksums |
b2c43c0e1ad7480aa82bdf392dda9a65daae0c8930022162fb7f206a9412ff1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp311-cp311-win32.whl
| Download URL | ypricemagic-5.2.29-cp311-cp311-win32.whl |
|---|---|
| Size | 435.1 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
30cf6980cf2eace7c60b017394b90787eb2d93a1c7db2f8e6307be6c92a3789a
|
|
BLAKE2b-256 checksum How to use checksums |
4e25d0c517f57d32c349df181fba08b5035a8298247fd972fa93c3294d453e5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 705.4 kB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
931227d542fc5ba1350f472ac0dad23aeefa5d2b288071a093eae8bf47da5a57
|
|
BLAKE2b-256 checksum How to use checksums |
6fb6709064dcb8c7a5fa3978e57133ab0de1324dc0d6a3e9fcec8a6d91616ad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 700.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4315b3cd9ca2bbca809d28ddabcd176298b581f8d961ef47b648408bd9522572
|
|
BLAKE2b-256 checksum How to use checksums |
fd249d0ec18f57e0d90b5d6f79db7997c806b8012a69abd817b2fcf43617601d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl
| Download URL | ypricemagic-5.2.29-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl |
|---|---|
| Size | 706.0 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
4249b3e6332e57530c33772cb8591a499e7c3fe5cdb16c060fd9d0e6f3b333dd
|
|
BLAKE2b-256 checksum How to use checksums |
4b4c9def162358e3797521620f44d8556b9c70d2a449afcd53e700a75cc7d589
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | ypricemagic-5.2.29-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 527.1 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9f167c39debd4cdfe6c6ad0946526dc2df5ea694d8935006504882ba5a282d3a
|
|
BLAKE2b-256 checksum How to use checksums |
a4e4e6e8fd6c8e45f84e3e81f629b8cb91a7a9c03811dd7a49b78a0fcb5e13e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp310-cp310-win_amd64.whl
| Download URL | ypricemagic-5.2.29-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 462.5 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
710c3f8d69bfaf1910de2333061b0dd128f59f2cb469ad3d63f66b2786530254
|
|
BLAKE2b-256 checksum How to use checksums |
5a3ed8891436172d4f3217343823dc0742c1b5d4ed3fa4381c8ab1590945096e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp310-cp310-win32.whl
| Download URL | ypricemagic-5.2.29-cp310-cp310-win32.whl |
|---|---|
| Size | 435.7 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
e8c885b5813fedabbfb10ce794c53fc2d56fe8d123840b2f35902c210d79efe5
|
|
BLAKE2b-256 checksum How to use checksums |
6b284b8151c209d400b138f23093af073cf87cc300796b761aced1dfb5aa3e1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 711.8 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
062c26ac71f8c94d60ab0789bd2d04fdba0a3d21a04f53efe236ecc19f6e47be
|
|
BLAKE2b-256 checksum How to use checksums |
aee1d7b050964a84fda2489fed2bb4af940e51c6ab100b893033cd053eb2c550
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ypricemagic-5.2.29-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 706.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e342e32a8fbc17d2647b49687222439cba234dd4d0c64af410d2b369b8910fb6
|
|
BLAKE2b-256 checksum How to use checksums |
bb50ca01ac10cbe36eb23b20494976b344cd31009c11d5f9044d27fbd61b8d10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl
| Download URL | ypricemagic-5.2.29-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl |
|---|---|
| Size | 713.2 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
0ec3309cc9721b728a6a8437bc10ab2651ea9f6a18c5871ebd5a01ef1bcfa313
|
|
BLAKE2b-256 checksum How to use checksums |
46a0dc86c65bb6518b6343ffc56e44bbad01f986a4c20fd98a41a8cbecec3e66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ypricemagic-5.2.29-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | ypricemagic-5.2.29-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 530.1 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ff31d3db360126d6f3ea2b9a2c131b2ed28db4ac9aa749c4834d7a0fe826d58f
|
|
BLAKE2b-256 checksum How to use checksums |
5c33b8a95016e105f4d482ccdde1a17f28e6f8426da43457d61b0bc6e5755792
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for ypricemagic 5.2.29
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.