Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ausaf007/uniswap-tracker

High Performance Go-Fiber Microservice to Track UniswapV3 Liquidity Pools
https://github.com/ausaf007/uniswap-tracker

go go-fiber microservice monitoring-tool rest-api sqlite sqlite3 tracking uniswap-v3

Last synced: 4 days ago
JSON representation

High Performance Go-Fiber Microservice to Track UniswapV3 Liquidity Pools

Awesome Lists containing this project

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

[![](https://img.shields.io/badge/Built_with-Go-green?style=for-the-badge&logo=Go)](https://go.dev/)
[![](https://img.shields.io/badge/Built_with-sqlite-blue?style=for-the-badge&logo=sqlite)](https://www.sqlite.org/)

## Prerequisites

Download and install [Golang 1.20](https://go.dev/doc/install) (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!