uniswap-tracker

command module
v0.0.0-...-efd78f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 12 Imported by: 0

README

Uniswap Tracker

High Performance Go-Fiber Microservice to Track UniswapV3 Liquidity Pools

Table of Contents

About The Project

Monitoring service for Uniswap V3 pools that continuously tracks and logs essential data points with go-ethereum, stores them in a persistent datastore (sqlite3), and provides access to the data through a REST endpoint.

Tech Stack

Prerequisites

Download and install Golang 1.20 (or higher).

How To Use?

  1. Navigate to uniswap-tracker/:
    cd /path/to/folder/uniswap-tracker/
    
  2. Open config.json file and fill in the eth_client_url field. This is useful to connect to the Ethereum Node. Also fill in the pool_address of the Uniswap V3 Pool you want to track. Rest of the fields can be left to default. Here are some details about the fields in the config file:
    1. pause_duration: Pause duration between consecutive RPC Calls. Default is 6 seconds. (Default=6000)
    2. log_frequency: After this many number of blocks the pool data be stored in the db. (Default=12)
  3. Get dependencies:
    go mod tidy
    
  4. Run the app:
    go run . 
    # use "--verbose" flag to get additional logs
    go run . --verbose 
    
  5. Get latest data with pool_id being 1:
    curl -X GET "http://127.0.0.1:3000/v1/api/pool/1?latest"
    
  6. Get block 420 data with pool_id being 1:
    curl -X GET "http://127.0.0.1:3000/v1/api/pool/1?block=420"
    
  7. Get historic data:
    curl -X GET "http://127.0.0.1:3000/v1/api/pool/1/historic"
    
  8. In case you want to know the pool_id for all the pool addresses tracked:
    curl -X GET "http://127.0.0.1:3000/v1/api/pool_mapping"
    

Thank you!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
bindings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL