Getting Started¶
Setup¶
Environment setup and configuration.
- Requirements
- EmbedPy >= 1.3.1 (See License)
- Coinbase Pro Account (See Coinbase Pro)
- Suggested
- kdb+ 3.6
- Linux OS
- Anaconda Python
Note
For best results, follow suggested environment.
Cross platform/version compatibility may require some tweaking.
See environment.yml for dependencies.
Installation¶
Anaconda installation guide.
Step 1 Clone or download the repo
Step 2 Create conda environment. In terminal run:
conda env create -f environment.yml -n env_name
The conda environment will download and install all required dependencies.
License¶
EmbedPy requires a 64-bit kdb installation and license.
Conda will install automatically
The first time you run q from this environment, you will be prompted by a standard license agreement message.
Make sure to enter a valid email address because you will be asked to confirm within 72 hours or your license will expire.
If you already have a kdb+ license associated with your email address then kdb will just use that license after you enter that email address.
The script resetqenv is provided to help reconcile multiple Q environments. (QHOME/QLIC clashes)
Coinbase Pro¶
Integrated Q client for the Coinbase Pro API
API Support¶
Environment¶
- Live
- Production exchange
- Sandbox
- The sandbox provides all of the functionality of the production exchange but allows you to add fake funds for testing.
Warning
LIVE TRADES CAN BE EXCUTED VIA THIS API.
Setting CBPRO_ENV variable to live will enable live trading.
SANDBOX MODE STRONGLY RECOMMENDED
Authentication¶
A Coinbase Pro API key is required to execute authenticated API calls for either environment.
Login sessions and API keys are separated by environment.
Use the respective web interface to generate the corresponding environment API key.
Configuration¶
- CBPRO_ENV - Sets application environment (live or sandbox)
- CBPRO_PRIV_KEY - Auto generated by Coinbase Pro
- CBPRO_PRIV_SECRET - Auto generated by Coinbase Pro
- CBPRO_PRIV_PASSPHRASE - User generated (password)
Start¶
Step 1 Activate conda environment. In terminal run:
conda activate cbpro
Step 2 Initialize base qoinbase app. In terminal run:
./startup_example
This script will initialize the qoinbase framework in the kdb server.
And you’re ready to start executing API calls.
Follow examples here Basic API
Reference script startup_example for example application config.