Skip to content

fritjof-b/btcusd-vwap-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTC-USD VWAP Calculator

This application calculates the Volume Weighted Average Price (VWAP) for BTC-USD. It utilizes the Gemini API to fetch trade entries and calculate VWAP.

Prerequisites

Ensure that you have the following installed:

  • Java 17 or higher

The project is formatted with Spotless according to Google Java Style.

Building the Project

To build the project, including external dependencies, open your terminal/command line, navigate to the project directory and run the following command:

./gradlew clean shadowJar

Running the Application

Once you've built the project, you can run the application using the following command:

java -jar build/libs/btcusd-1.0.0-release.jar

When the application starts, it will fetch trade entries from the Gemini API and store them in an in-memory trade history, represented by a Deque. The application then starts three tasks:

Useful Info

The initial call to the Gemini API fetches all trade entries from the last ten minutes. We can get a hunch if this number is correct by running the following command (assuming you have jq installed), assuming there are 500 trades or less:

curl https://api.gemini.com/v1/trades/btcusd\?limit_trades\=500\&timestamp\=<TIMESTAMP> | jq length

Where <TIMESTAMP> is the timestamp displayed as the application starts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages