Description

This repository queries The Graph API for Uniswap data. More specifically it creates a backend API endpoint that when given a token’s contract address, it returns a list of Uniswap pools associated with the token.

Getting Started

Change into the src directory and run the following to get started in development:

go run .

You can try the following endpoint:

GET http://localhost:8080/tokens/:tokenContractAdddress/pools

For e.g. USDC’s contract address is 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.

Future Improvements

  • Validations on inputs
  • Additional endpoints (volume filtered by time, swaps in a given block)
  • Pagination
  • Rate limiting
  • Caching
  • Automatic error monitoring/alerting
  • Conversion of unix timestamp to ISO8601
  • Backup sevices in case subgraph is unavailable
  • Testing
  • More robust handling of GraphQL queries and fragments

GitHub

View Github