Skip to content

This script sends a request to https://bitquery.io/ API, retriving the price data for historical DEX trades on BSC.

Notifications You must be signed in to change notification settings

Jimmy-sha256/DEX_Price_History

Repository files navigation

DEX Trade Prices

This script sends a request to https://bitquery.io/ API, retriving the price data for historical DEX trades on BSC.

Table of Contents

  1. Installation
  2. Bitquery API
  3. Create Client Object
  4. Last Trade Price
  5. Historical Trade Price
  6. Add Prices To CSV File
git clone https://github.com/Jimmy-sha256/DEX_Price_History

virtualenv --python=/usr/bin/python3.10 venv

source venv/bin/activate

pip install -r requirements.txt

Create an account:

Generate an API Key:

from bit_query import BitQuery as bq
api_key = 'Insert BitQuery API Key Here' 
client = bq(api_key)

MREX = '0x76837d56d1105bb493cddbefeddf136e7c34f0c4'
client.dex_price(MREX)

XRX = '0xb25583e5e2db32b7fcbffe3f5e8e305c36157e54' 
date = '2022-12-09 09:43:56' 
client.dex_price(XRX, date)

REX = '0x5e0b09b04d6990e76dfe9bf84552a940fd0be05e' 
csv_file = 'REX-0x5e0b09b04d6990e76dfe9bf84552a940fd0be05e.csv' 
client.add_price_csv(csv_file, REX) 

About

This script sends a request to https://bitquery.io/ API, retriving the price data for historical DEX trades on BSC.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages