A simple Python script that calculates the average buying and selling prices for various cryptocurrencies traded on Coinbase Pro.
Retrieves data using the Coinbase Pro API (formerly known as the GDAX)
Note: this library may be subtly broken or buggy. The code is released under the MIT License – please take the following message to heart:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Quickly calculate the average buying and selling prices for cryptocurrencies (similar to how platforms like Fidelity tell you your cost basis and selling price)
- Do not worry about handling the nuances of the API
- Gain an advantage in the market by knowing exactly where you are profitable!
- Unit tests
- Adding Python 3.11 support
- Make Coinbase Advanced pagination work
- Fix ReadMe
- Clean up code
- Add docstrings
- Make error messages more useful
- Login to Coinbase Pro, and press your profile pic (in the top right corner), then API.
- Generate a new API key (+ New API Key), with the "View" permission at minimum. Note your Passphrase and API secret, they are only displayed once.
- Document your key, API secret, passphrase, new API key, and new secret key in a file
auth.txt
, along with your name, and save it within this directory, as shown below (each element on a separate line):
Salvatore Bracco
db70a7f6498dd7f9bcad29d077be779d
xZEo5hAQqdWAA6ZbhI1X9wTsZiZXqikRL9awpCgpRbIGPBfILrbn2lJeeHY7eS9U4z9p5dGus68avl2cLLTkWg==
xhhpas1ijmi
gRllCD7P4lVsHnlS
xZ0dSgdmLt66WwefAQZQLP21fd3234jk
- Install Python 3.9.0.
Note: This script works on Windows 10 with Python 3.9.0. Other platforms and/or versions are not guaranteed at this time.
- Install the Coinbase Pro Python wrapper by running
pip install cbpro
.
- Define the symbols you wish to calculate prices for in the
syms.txt
file (one on each line). - Open the
Average Prices Calculator.py
and it should run in a window. Press "enter" key to close the window.