Git Product home page Git Product logo

fetch's Introduction

fetch

Simple functions to pull price/pool data from Web3 subgraphs

Dependencies

Python3, pandas

Overview

Easily pull data from Web3 subgraphs. Currently supports:

  • fetching historical price data for coins/pools, and
  • identifying coins in pools

for Curve, Uniswap3, and Sushiswap.

Additional queries/providers can be easily added as subclasses.

Examples

#Pull all trades for tricrypto2, return lists of price/volume for each coin pair
tricrypto2 = '0xD51a44d3FaE010294C616388b506AcdA1bfAAE46'
data = fetch.trades('curve', pools=tricrypto2)

#Pull tricrypto2 trades between April 1 and May 1, 2022
from datetime import datetime
t_start = datetime(2022,4,1).timestamp()
t_end =datetime(2022,5,1).timestamp()

data = fetch.trades('curve', pools=tricrypto2, t_start=t_start, t_end=t_end)

#Pull all trades for tricrypto2, return 6H candles for each coin pair
data = fetch.trades('curve', pools=tricrypto2, candles='6H')

#Pull all UniV3 trades between the coins in tricrypto2, return 6H candles for each pair
coinaddresses = fetch.poolcoins('curve', tricrypto2)
data = fetch.trades('uni', coins=coinaddresses, candles='6H')

#Pull all SushiSwap trades between the coins in tricrypto2, return 6H candles for each pair
data = fetch.trades('sushi', coins=coinaddresses, candles='6H')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.