whit3he4d / token-price

A simple API for fetching the price of a given token or uniswap LP pair

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Token price API

Return the price of tokens and uniswap pairs for a given address

Setup

Install the required packages:

pip install -r requirements.txt

Copy .env.example to .env and put your Infura Project ID in it.

Usage

Run the server with:

flask run

To get the current UNI price open https://127.0.0.1:5000/token_price/0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

To get the current ETH/UNI Uniswap LP token price open https://127.0.0.1:5000/uniswap_pair_price/0xd3d2e2692501a5c9ca623199d38826e513033a17

About

A simple API for fetching the price of a given token or uniswap LP pair


Languages

Language:Python 57.3%Language:Solidity 41.9%Language:Dockerfile 0.7%Language:Shell 0.0%