Asynchronous client for Deribit exchange.
The program takes data from the exchange for Bitcoin and Ethereum once a minute. Next, the data is added to the table 'last_price_currency'. Another program creates an HTTP API server using the FastAPI library. Using requests, you can get data from the table at the last price of a currency, at all prices of a particular currency, at a price at a particular time (note that the time is specified in unix format).
Before running the program you need:
- Create a database in PostgreSQL. This can be done using a terminal or a windowed database application.
- Indicate in the code your personal data and the name of the database for the program to connect to it. This needs to be done in 'main.py' and 'database_and_requests.py'
- Create a table using the PostgreSQL.create_table function.
- Run the uvicorn server in a terminal from the root folder.
- Run the 'database_and_requests.py' file.
After that, you can receive the necessary data via HTTP requests.