You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crypto starts with Bitvavo. You use Bitvavo SDK for Python to buy, sell, and store over 200 digital assets on Bitvavo from inside your own app.
15
+
Crypto starts with Bitvavo. You use Bitvavo SDK for Python to buy, sell, and store over 200 digital assets on Bitvavo from inside your app.
16
16
17
17
To trade and execute your advanced trading strategies, Bitvavo SDK for Python is a wrapper that enables you to easily call every endpoint in [Bitvavo API](https://docs.bitvavo.com/).
18
18
19
19
-[Prerequisites](#prerequisites) - what you need to start developing with Bitvavo SDK for Python.
20
-
-[Get started](#get-started) - rapidy create an app and start trading with Bitvavo.
20
+
-[Get started](#get-started) - rapidly create an app and start trading with Bitvavo.
21
21
-[API reference](#api-reference) - in-depth information about Bitvavo SDK for Python
22
22
23
23
This page shows you how to use Bitvavo SDK for Python with websockets. For REST, see [Readme-rest](./README-REST.md).
@@ -28,7 +28,7 @@ To start programming with Bitvavo SDK for Python you need:
28
28
29
29
-[Python3](https://www.python.org/downloads/) installed on your development environment
30
30
31
-
If you are working on MacOS, ensure that that you have installed SSH certificates:
31
+
If you are working on macOS, ensure that you have installed SSH certificates:
32
32
```terminal
33
33
open /Applications/Python\ 3.12/Install\ Certificates.command
34
34
open /Applications/Python\ 3.12/Update\ Shell\ Profile.command
@@ -41,11 +41,11 @@ To start programming with Bitvavo SDK for Python you need:
41
41
- **Trade**: place, update, view and cancel orders.
42
42
- **Withdraw**: withdraw funds.
43
43
44
-
Best practice is to not grant his privilage, withdrawals using the API do not require 2FA and e-mail confirmation.
44
+
Best practice is to not grant his privilege, withdrawals using the API do not require 2FA and e-mail confirmation.
45
45
46
46
## Get started
47
47
48
-
Want to quickly make a first app? Here we go:
48
+
Want to quickly make a trading app? Here you go:
49
49
50
50
1. **Install Bitvavo SDK for Python**
51
51
@@ -58,21 +58,21 @@ Want to quickly make a first app? Here we go:
58
58
Add the following code to a new file in your app:
59
59
60
60
```python
61
-
# Import Bitvavo SDK for Python
61
+
# Import Bitvavo SDK for Python.
62
62
from python_bitvavo_api.bitvavo import Bitvavo
63
63
import json
64
64
import time
65
65
66
66
67
-
# Use this class to connect to Bitvavo and make your first calls
67
+
# Use this class to connect to Bitvavo and make your first calls.
68
68
# Add trading strategies to implement your business logic.
69
69
class bitvavo_implementation:
70
70
api_key = "<Replace with your your API key from Bitvavo Dashboard>"
71
71
api_secret = "<Replace with your API secrete from Bitvavo Dashboard>"
72
72
bitvavo_engine = None
73
73
bitvavo_socket = None
74
74
75
-
# Connect securely to Bitvavo, create the websocket and error callbacks
75
+
# Connect securely to Bitvavo, create the websocket and error callbacks.
76
76
def __init__(self):
77
77
self.bitvavo_engine = Bitvavo({
78
78
'APIKEY': self.api_key,
@@ -81,44 +81,50 @@ Want to quickly make a first app? Here we go:
# Sockets are fast, but asynchronous. Keep the socket open while you are
120
122
# trading.
121
123
def wait_and_close(self):
124
+
# Bitvavo uses a weight based rate limiting system. Your app is limited to 1000 weight points per IP or
125
+
# API key per minute. The rate weighting for each endpoint is supplied in the Bitvavo API documentation.
126
+
# This call returns the amount of points left. If you make more requests than permitted by the weight limit,
127
+
# your IP or API key is banned.
122
128
limit = self.bitvavo_engine.getRemainingLimit()
123
129
try:
124
130
while (limit > 0):
@@ -133,7 +139,9 @@ Want to quickly make a first app? Here we go:
133
139
bvavo = bitvavo_implementation()
134
140
bvavo.a_trading_strategy()
135
141
bvavo.wait_and_close()
142
+
136
143
```
144
+
137
145
1. **Add security information**
138
146
139
147
Replace the values of `api_key` and `api_secret` with your credentials from [Bitvavo Dashboard](https://account.bitvavo.com/user/api).
@@ -146,8 +154,8 @@ Want to quickly make a first app? Here we go:
146
154
- Command line warriors: `python3 <filename>`.
147
155
- IDE heroes: press the big green button.
148
156
149
-
Your app connects to Bitvavo and returns a list the latest trade price for each market. The callback cycles through the
150
-
market data so you can implement your trading logic.
157
+
Your app connects to Bitvavo and returns a list the latest trade price for each market. You use this data to implement
158
+
your trading logic.
151
159
152
160
## API reference
153
161
@@ -208,8 +216,9 @@ The rate weighting for each endpoint is supplied in the [Bitvavo API documentati
208
216
209
217
#### REST requests
210
218
211
-
For all functions, required parameters are passed as separate values, optional parameters are passed as a dictionary;
212
-
return parameters are in dictionary format such that `response['<key>'] = '<value>'`. Only when [placing orders](#place-order) some of the optional parameters are required, since a limit order requires more information than a market order.
219
+
For all functions, required parameters are passed as separate values, optional parameters are passed as a dictionary.
220
+
Return parameters are in dictionary format: `response['<key>'] = '<value>'`. However, as a limit order requires
221
+
more information than a market order, some optional parameters are required when you [place an order](#place-order).
When placing an order, make sure that the correct optional parameters are set. For a limit order it is required to set both the amount and price. A market order is valid if either amount or amountQuote has been set.
0 commit comments