Skip to content

Instantly share code, notes, and snippets.

txs_calldata: pl.LazyFrame = (
pl.scan_parquet("data/raw/transactions/*.parquet")
.select(
"block_number",
"transaction_hash",
"input",
)
.with_columns([pl.col("input").str.len_bytes().alias("calldata_size")])
.with_columns(pl.col("calldata_size") - 1)
.select("transaction_hash", "block_number", "calldata_size")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import matplotlib.pyplot as plt
import yfinance as yf
import pandas as pd
from scipy.optimize import curve_fit
from fastdtw import fastdtw
from scipy.spatial.distance import euclidean
from scipy.signal import find_peaks, peak_widths
from scipy.interpolate import interp1d
from queryportal.subgraphinterface import SubgraphInterface as sgi
import polars as pl
pl.Config.set_fmt_str_lengths(200)
endpoints = [
'https://api.thegraph.com/subgraphs/name/messari/uniswap-v3-ethereum',
'https://api.thegraph.com/subgraphs/name/messari/uniswap-v3-arbitrum',
'https://api.thegraph.com/subgraphs/name/messari/uniswap-v3-polygon',
'https://api.thegraph.com/subgraphs/name/messari/uniswap-v3-optimism',
from queryportal.subgraphinterface import SubgraphInterface as sgi
import polars as pl
pl.Config.set_fmt_str_lengths(200)
endpoints = ['https://api.thegraph.com/subgraphs/name/denverbaumgartner/rubiconv2-optimism-mainnet',
'https://api.thegraph.com/subgraphs/name/denverbaumgartner/rubiconv2-optimism-goerli',
'https://api.thegraph.com/subgraphs/name/denverbaumgartner/rubiconv2-arbitrum-goerli',
'https://api.thegraph.com/subgraphs/name/denverbaumgartner/rubiconv2-polygon-mumbai'
]