storm Profile picture
Aug 4 β€’ 8 tweets β€’ 4 min read Twitter logo Read on Twitter
πŸŒ‹πŸ”₯ very exciting breakthrough πŸ”₯πŸŒ‹

if you are doing rpc data extraction in python, cryo will make your code faster

it can do 10,000+ requests per second in rust and return results as a python dataframe. up to 16x faster than a highly-optimized native python client

details πŸ‘‡ Image
what is cryo? it’s a rust tool for bulk data extraction from EVM nodes

it can be used to build pipelines that are fast + robust + embracing open data standards

cryo can extract lots of ethereum datatypes (logs, traces, state diffs, etc)

it also has many options for 1) filtering the data, 2) formatting the output, and 3) controlling the concurrency+ratelimit of data acquisition


Image
Image
Image
Image
how do you use cryo from python?

pip install cryo_python
import cryo
df = cryo.collect(β€˜txs’, …)

...it’s that simple
the cryo python adapter has full feature parity with the rust lib

πŸπŸ€πŸ¦€

you can return the results as:
- a polars dataframe
- a pandas dataframe
- a dict of lists
- a list of dicts
- parquet / csv / json / avro files

see this notebook for examples datasets.paradigm.xyz/notebooks/cryo…
that notebook contains an example benchmark comparing cryo to a highly-optimized β€œnative” python client

the native client uses msgspec (h/t @bantg ) for C++ serde under the hood

even so, cryo is anywhere between 4x faster to 16x faster than the native python client Image
if you do bulk data extraction in python, give cryo a try

leaning on cryo instead of native python will make your code faster and simpler

this is **alpha-level** software, please report any bugs to the issue tracker
exciting roadmap ahead so stay tuned. better performance + more features otw

github:

telegram: https://t.co/FbEKaNRMDqgithub.com/paradigmxyz/cr…
t.me/paradigm_flood

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with storm

storm Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @notnotstorm

Mar 17
πŸŸ©πŸ“ŠπŸŒ€excited to announce the launch of the Paradigm Data Portal πŸŸ©πŸ“ŠπŸŒ€

TLDR: we are assembling a bunch of public crypto datasets for researchers and tool builders

short thread
crypto has a very unique relationship to data
- unprecedented levels of openness and detail πŸ”Ž
- trustless consensus on a single global state 🌎
- culture of open-source-first πŸ—½

but there's a massive problem
obtaining crypto datasets requires a lot of of time βŒ›, money πŸ’°, and/or expertise πŸ•΅οΈ

this creates massive friction for any research that requires such datasets
Read 13 tweets
Oct 3, 2022
wanna look up defi APY's and TVL's from the command line?

let me show you how

1 / 13
ctc is an open source toolkit for collecting and analyzing crypto data from the command line + in python

ctc can display yield + TVL data from multiple data sources including @DefiLlama, @iearnfinance, and more

2 / 13
Defi Llama is the most comprehensive data source for this, with nearly yield and TVL data for nearly 10k pools across >1000 protocols on >100 chains

defillama.com/docs/api

3 / 13
Read 13 tweets
Oct 2, 2022
how I made a cli with 90+ subcommands in python...
I recently released ctc 0.3.0, which contains a large suite of cli tools

I want to briefly explain why I implemented it using a custom cli framework instead of reaching for an already-existing cli framework

2 / 17
I'm a long time user of argparse, python's built-in cli argument parsing library

it's great for when things are relatively simple

however, it quickly turns clunky when you're trying to make a complicated cli with many subcommands (for example git or kubectl)

3 / 17
Read 17 tweets
Oct 1, 2022
are you trying to scrape large amounts of data from an EVM RPC node? πŸ€”πŸ€”

it's a simple task in theory, but in practice it can require a lot of book-keeping, boilerplate, and fault-tolerant infra

allow me to explain how ctc's new RPC client makes this process easy and efficient
ctc is a python library for collecting and analyzing EVM data

it implements an RPC client that is specifically designed for data scraping:
1. it is async-first, making it easy to orchestrate many concurrent queries
2. it utilizes JSON-RPC batching to maximize performance
being async-first gives you a low-effort way to parallelize RPC requests using standard python async idioms

this is particularly helpful when querying a remote RPC node, as network latency is usually the biggest bottleneck
Read 11 tweets
Sep 30, 2022
⌨️πŸ–₯️⌨️

new set of tools for performing eth_call's from the command line

βŒπŸ–±οΈβŒ

[a thread with many screenshots and examples]

1 / 16
whether you work on smart contracts, frontend products, or data analysis, there **will** come a point where you need to check the outputs of on-chain contract functions

the easiest way to do this is using etherscan's "Read Contracts" tab

2 / 16
but as you do this more and more, you might want something that's a little faster and a little more programmatic

a natural choice is cli tools

there are many great tools for performing eth_call's from the cli, including:
- seth (dapptools)
- cast (foundry)
- ethereal

3 / 16
Read 16 tweets
Sep 29, 2022
**10 ways** that ctc makes it easy to work with ABI's of contracts, functions, and events

ctc is a python+cli toolkit for collecting+analyzing EVM data

it has lots of built in machinery for handling ABI's to make your life easier
1. **ignore ABI's**

the best part about working with ABI's in ctc is that you don't need to work with ABI's at all

to make an eth_call or gather events, you just need the function name or event name

ctc automatically grabs the ABI from your friendly neighborhood block explorer ImageImageImageImage
2. **don't ignore ABI's**

but if you want to explicitly process/manage ABI's, ctc gives you many different tools to do so

e.g. ctc has functions for interconverting between

abis
signatures
selectors
parameter names
parameter types
output names
output types ImageImageImageImage
Read 13 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(