Skip to main content

cbpa

Coinbase Pro Automation for making buy orders from a default bank account.

Quickstart

  1. Install with pip

    pip install cbpa
    
  2. Create a Coinbase API Key, you will need to select all fields of access.

  3. (Optional). Create a Discord webhook.

  4. Make your config file. See the examples for more.

    ---
    api:
        key: "myKey"
        secret: "mySecret"
        passphrase: "myPassphrase"
        url: "https://api.pro.coinbase.com"
    discord:
        webhook: https://discord.com/api/webhooks/123/abc
    account:
        auto_funding_limit: 20
        fiat_currency: USD
    buys:
        - send_currency: USD
            send_amount: 2
            receive_currency: BTC
        - send_currency: USD
            send_amount: 2
            receive_currency: ETH
        - send_currency: USD
            send_amount: 2
            receive_currency: DOGE
    
  5. Make your orders!

    cbpa run -f my-buys.yaml
    

Running cbpa in Google Cloud Run

You can run cbpa as a server in Google Cloud Run, which can called by Google Cloud Scheduler to automatically place buys for you each day, or on any cron schedule you like.

These steps assume you have installed and configured gcloud already.

  1. Store your buy order file as a secret in GCP.

    gcloud secrets versions add my_buys --data-file=my-buys.yaml
    
  2. Build and push your docker container to Google Cloud, and then deploy your container.

    ./scripts/docker-build.sh && ./scripts/docker-push.sh; SECRET_ID=my_buys ./scripts/gcloud-run-deploy.sh
    
  3. Create an authenticated scheduler that uses an http target to hit the buy endpoint.

Release files for cbpa 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cbpa 0.1.1
File Size Uploaded
cbpa-0.1.1.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cbpa 0.1.1
File Interpreter ABI Platform
cbpa-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.9 kB

Release files / cbpa-0.1.1.tar.gz

Download URL cbpa-0.1.1.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e1a488fe0fc2a7b06c9d6d306c4230797150f032e46550293324d1064e2b8158
BLAKE2b-256 checksum
How to use checksums
de96e5a36225cda28196f17e1b214ff57b352d68a5e5dfb7f4f0b29590941cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release files / cbpa-0.1.1-py3-none-any.whl

Download URL cbpa-0.1.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db9c2a1d93483fa0a72b095dc073333e70ab12e9f287a1a5eb4d7e8d6bfec146
BLAKE2b-256 checksum
How to use checksums
161e42217824d2ecf69448138eaf7e7200f2cd3bd99ea3ec8957c10fef4650df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page