2018-07-27 20:18:12 +00:00
# Sandbox API testing
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
Where an exchange provides a sandbox for risk-free integration, or end-to-end, testing CCXT provides access to these.
This document is a *light overview of configuring Freqtrade and GDAX sandbox.
This can be useful to developers and trader alike as Freqtrade is quite customisable.
When testing your API connectivity, make sure to use the following URLs.
***Website**
https://public.sandbox.gdax.com
***REST API**
https://api-public.sandbox.gdax.com
---
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
# Configure a Sandbox account on Gdax
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
Aim of this document section
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
- An sanbox account
- create 2FA (needed to create an API)
- Add test 50BTC to account
- Create :
- - API-KEY
- - API-Secret
- - API Password
## Acccount
This link will redirect to the sandbox main page to login / create account dialogues:
https://public.sandbox.pro.coinbase.com/orders/
2018-07-28 17:42:56 +00:00
After registration and Email confimation you wil be redirected into your sanbox account. It is easy to verify you're in sandbox by checking the URL bar.
2018-07-27 20:18:12 +00:00
> https://public.sandbox.pro.coinbase.com/
## Enable 2Fa (a prerequisite to creating sandbox API Keys)
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
From within sand box site select your profile, top right.
>Or as a direct link: https://public.sandbox.pro.coinbase.com/profile
2018-08-07 07:25:21 +00:00
From the menu panel to the left of the screen select
2018-07-27 20:18:12 +00:00
> Security: "*View or Update*"
2018-08-07 07:25:21 +00:00
In the new site select "enable authenticator" as typical google Authenticator.
2018-07-27 20:18:12 +00:00
- open Google Authenticator on your phone
2018-08-07 07:25:21 +00:00
- scan barcode
- enter your generated 2fa
## Enable API Access
2018-07-27 20:18:12 +00:00
From within sandbox select profile>api>create api-keys
>or as a direct link: https://public.sandbox.pro.coinbase.com/profile/api
2018-08-07 07:25:21 +00:00
Click on "create one" and ensure **view** and **trade** are "checked" and sumbit your 2FA
2018-07-28 17:42:56 +00:00
- **Copy and paste the Passphase** into a notepade this will be needed later
- **Copy and paste the API Secret** popup into a notepad this will needed later
- **Copy and paste the API Key** into a notepad this will needed later
2018-07-27 20:18:12 +00:00
## Add 50 BTC test funds
2018-07-29 09:12:05 +00:00
2018-08-07 07:25:21 +00:00
To add funds, use the web interface deposit and withdraw buttons.
2018-07-29 09:12:05 +00:00
To begin select 'Wallets' from the top menu.
2018-07-27 20:18:12 +00:00
> Or as a direct link: https://public.sandbox.pro.coinbase.com/wallets
- Deposits (bottom left of screen)
2018-08-07 07:25:21 +00:00
- - Deposit Funds Bitcoin
- - - Coinbase BTC Wallet
- - - - Max (50 BTC)
2018-07-27 20:18:12 +00:00
- - - - - Deposit
2018-07-29 09:12:05 +00:00
*This process may be repeated for other currencies, ETH as example*
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
---
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
# Configure Freqtrade to use Gax Sandbox
The aim of this document section
2018-08-07 07:25:21 +00:00
- Enable sandbox URLs in Freqtrade
- Configure API
- - secret
- - key
- - passphrase
2018-07-27 20:18:12 +00:00
## Sandbox URLs
2018-08-07 07:25:21 +00:00
Freqtrade makes use of CCXT which in turn provides a list of URLs to Freqtrade.
These include `['test']` and `['api']` .
2018-07-29 09:12:05 +00:00
- `[Test]` if available will point to an Exchanges sandbox.
- `[Api]` normally used, and resolves to live API target on the exchange
2018-07-27 20:18:12 +00:00
To make use of sandbox / test add "sandbox": true, to your config.json
2018-08-07 07:25:21 +00:00
```json
2018-07-27 20:18:12 +00:00
"exchange": {
"name": "gdax",
"sandbox": true,
"key": "5wowfxemogxeowo;heiohgmd",
"secret": "/ZMH1P62rCVmwefewrgcewX8nh4gob+lywxfwfxwwfxwfNsH1ySgvWCUR/w==",
"password": "1bkjfkhfhfu6sr",
2018-08-07 07:25:21 +00:00
"outdated_offset": 5
2018-07-27 20:18:12 +00:00
"pair_whitelist": [
"BTC/USD"
```
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
Also insert your
2018-08-07 07:25:21 +00:00
2018-07-27 20:18:12 +00:00
- api-key (noted earlier)
- api-secret (noted earlier)
- password (the passphrase - noted earlier)
---
2018-08-07 07:25:21 +00:00
## You should now be ready to test your sandbox
2018-07-27 20:18:12 +00:00
Ensure Freqtrade logs show the sandbox URL, and trades made are shown in sandbox.
2018-08-07 07:25:21 +00:00
** Typically the BTC/USD has the most activity in sandbox to test against.
2018-07-27 20:18:12 +00:00
## GDAX - Old Candles problem
2018-08-07 07:25:21 +00:00
It is my experience that GDAX sandbox candles may be 20+- minutes out of date. This can cause trades to fail as one of Freqtrades safety checks.
To disable this check, add / change the `"outdated_offset"` parameter in the exchange section of your configuration to adjust for this delay.
Example based on the above configuration:
2018-07-27 20:18:12 +00:00
2018-08-07 07:25:21 +00:00
```json
"exchange": {
"name": "gdax",
"sandbox": true,
"key": "5wowfxemogxeowo;heiohgmd",
"secret": "/ZMH1P62rCVmwefewrgcewX8nh4gob+lywxfwfxwwfxwfNsH1ySgvWCUR/w==",
"password": "1bkjfkhfhfu6sr",
"outdated_offset": 30
"pair_whitelist": [
"BTC/USD"
2018-07-27 20:18:12 +00:00
```