11
2- <table >
3- <tr >
4- <td><a href="https://bitvavo.com"><img alt="Bitvavo" src="docs/assets/bitvavo-mark-square-blue.svg" width="100" title="Bitvavo Logo"></a></td>
5- <td><h1>Bitvavo SDK for Python</h1></td>
6- </tr >
7- </table >
2+ # Bitvavo SDK for Python
83
94Crypto starts with Bitvavo.
105You use Bitvavo SDK for Python to buy, sell, and store over 200 digital assets on Bitvavo from inside your app.
@@ -51,6 +46,10 @@ Want to quickly make a trading app? Here you go:
5146 ``` terminal
5247 python -m pip install python_bitvavo_api
5348 ```
49+
50+ If you installed from `test.pypi.com`, update the requests library: `pip install --upgrade requests`.
51+
52+
54531. **Create a simple Bitvavo implementation**
5554
5655 Add the following code to a new file in your app:
@@ -79,7 +78,8 @@ Want to quickly make a trading app? Here you go:
7978
8079 # Handle errors.
8180 def error_callback(self, error):
82- print("Errors:", json.dumps(error, indent=2))
81+ print("Add your error message.")
82+ #print("Errors:", json.dumps(error, indent=2))
8383
8484 # Retrieve the data you need from Bitvavo in order to implement your
8585 # trading logic. Use multiple workflows to return data to your
@@ -90,22 +90,24 @@ Want to quickly make a trading app? Here you go:
9090 # In your app you analyse data returned by the trading strategy, then make
9191 # calls to Bitvavo to respond to market conditions.
9292 def a_trading_strategy_callback(self, response):
93- print("All the latest trades:", json.dumps(response, indent=2))
94- # Iterate through the
93+ # Iterate through the markets
9594 for market in response:
96- print("Iterate through markets:", market["market"] )
95+
9796 match market["market"]:
98- case "ABC -EUR":
99- print("Check data against your trading strategy. For example , the bid is: ", market["bid"] )
97+ case "ZRX -EUR":
98+ print("Eureka , the latest bid for ZRX-EUR is: ", market["bid"] )
10099 # Implement calculations for your trading logic.
101100 # If they are positive, place an order: For example:
102- # self.bitvavo_socket.placeOrder("ABC -EUR",
101+ # self.bitvavo_socket.placeOrder("ZRX -EUR",
103102 # 'buy',
104103 # 'limit',
105104 # { 'amount': '1', 'price': '00001' },
106105 # self.order_placed_callback)
107106 case "a different market":
108107 print("do something else")
108+ case _:
109+ print("Not this one: ", market["market"])
110+
109111
110112
111113 def order_placed_callback(self, response):
@@ -128,8 +130,8 @@ Want to quickly make a trading app? Here you go:
128130 limit = self.bitvavo_engine.getRemainingLimit()
129131 except KeyboardInterrupt:
130132 self.bitvavo_socket.closeSocket()
131-
132-
133+
134+
133135 # Shall I re-explain main? Naaaaaaaaaa.
134136 if __name__ == '__main__':
135137 bvavo = BitvavoImplementation()
@@ -143,7 +145,8 @@ Want to quickly make a trading app? Here you go:
143145 Replace the values of `api_key` and `api_secret` with your credentials from [Bitvavo Dashboard](https://account.bitvavo.com/user/api).
144146
145147 You can retrieve public information such as available markets, assets and current market without supplying your key and secret.
146- However, Bitvavo returns an error.
148+ However, unauthenticated calls have lower rate limits based on your IP address, and your account is blocked for longer if
149+ you exceed your limit.
147150
1481511. **Run your app**
149152
0 commit comments