bitvavo-api-upgraded 2.0.0__py3-none-any.whl → 2.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bitvavo-api-upgraded
3
- Version: 2.0.0
3
+ Version: 2.2.0
4
4
  Summary: A unit-tested fork of the Bitvavo API
5
5
  Author: Bitvavo BV (original code), NostraDavid
6
6
  Author-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
@@ -8,7 +8,6 @@ License: ISC License
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Environment :: Console
10
10
  Classifier: Framework :: Pytest
11
- Classifier: Framework :: tox
12
11
  Classifier: Intended Audience :: Developers
13
12
  Classifier: Intended Audience :: Financial and Insurance Industry
14
13
  Classifier: License :: OSI Approved :: ISC License (ISCL)
@@ -26,12 +25,35 @@ Requires-Dist: pydantic-settings==2.*,>=2.6
26
25
  Requires-Dist: requests==2.*,>=2.26
27
26
  Requires-Dist: structlog>=21.5,==25.*
28
27
  Requires-Dist: websocket-client==1.*,>=1.2
28
+ Requires-Dist: cudf-cu12>=24.0.0 ; extra == 'cudf'
29
+ Requires-Dist: narwhals>=2.0.0 ; extra == 'cudf'
30
+ Requires-Dist: narwhals[dask]>=2.0.0 ; extra == 'dask'
31
+ Requires-Dist: narwhals[duckdb]>=2.0.0 ; extra == 'duckdb'
32
+ Requires-Dist: narwhals[ibis]>=2.0.0 ; extra == 'ibis'
33
+ Requires-Dist: narwhals[modin]>=2.0.0 ; extra == 'modin'
34
+ Requires-Dist: narwhals[pandas]>=2.0.0 ; extra == 'pandas'
35
+ Requires-Dist: narwhals[polars]>=2.0.0 ; extra == 'polars'
36
+ Requires-Dist: narwhals[pyarrow]>=2.0.0 ; extra == 'pyarrow'
37
+ Requires-Dist: narwhals[pyspark]>=2.0.0 ; extra == 'pyspark'
38
+ Requires-Dist: narwhals[pyspark-connect]>=2.0.0 ; extra == 'pyspark-connect'
39
+ Requires-Dist: narwhals[sqlframe]>=2.0.0 ; extra == 'sqlframe'
29
40
  Maintainer: NostraDavid
30
41
  Maintainer-email: NostraDavid <55331731+NostraDavid@users.noreply.github.com>
31
42
  Requires-Python: >=3.9
32
43
  Project-URL: changelog, https://github.com/Thaumatorium/bitvavo-api-upgraded/blob/master/CHANGELOG.md
33
44
  Project-URL: homepage, https://github.com/Thaumatorium/bitvavo-api-upgraded
34
45
  Project-URL: repository, https://github.com/Thaumatorium/bitvavo-api-upgraded
46
+ Provides-Extra: cudf
47
+ Provides-Extra: dask
48
+ Provides-Extra: duckdb
49
+ Provides-Extra: ibis
50
+ Provides-Extra: modin
51
+ Provides-Extra: pandas
52
+ Provides-Extra: polars
53
+ Provides-Extra: pyarrow
54
+ Provides-Extra: pyspark
55
+ Provides-Extra: pyspark-connect
56
+ Provides-Extra: sqlframe
35
57
  Description-Content-Type: text/markdown
36
58
 
37
59
  # Bitvavo API (upgraded)
@@ -44,6 +66,46 @@ A **typed, tested, and enhanced** Python wrapper for the Bitvavo cryptocurrency
44
66
  pip install bitvavo_api_upgraded
45
67
  ```
46
68
 
69
+ ### Optional Dataframe Support
70
+
71
+ This package supports multiple dataframe libraries via [Narwhals](https://narwhals-dev.github.io/narwhals/), providing a unified interface across:
72
+
73
+ - **pandas** - The most popular Python data analysis library
74
+ - **polars** - Fast, memory-efficient DataFrames in Rust
75
+ - **cuDF** - GPU-accelerated DataFrames (NVIDIA RAPIDS)
76
+ - **modin** - Distributed pandas on Ray/Dask
77
+ - **PyArrow** - In-memory columnar data format
78
+ - **Dask** - Parallel computing with task scheduling
79
+ - **DuckDB** - In-process analytical database
80
+ - **Ibis** - Portable analytics across backends
81
+ - **PySpark** - Distributed data processing
82
+ - **PySpark Connect** - Client for remote Spark clusters
83
+ - **SQLFrame** - SQL-like operations on DataFrames
84
+
85
+ Install with your preferred dataframe library:
86
+
87
+ ```bash
88
+ # Basic installation (dict output only)
89
+ pip install bitvavo_api_upgraded
90
+
91
+ # With pandas support
92
+ pip install bitvavo_api_upgraded[pandas]
93
+
94
+ # With polars support
95
+ pip install bitvavo_api_upgraded[polars]
96
+
97
+ # With multiple libraries
98
+ pip install bitvavo_api_upgraded[pandas,polars,pyarrow]
99
+
100
+ # With GPU acceleration (cuDF)
101
+ pip install bitvavo_api_upgraded[cudf]
102
+
103
+ # With distributed computing (Dask)
104
+ pip install bitvavo_api_upgraded[dask]
105
+
106
+ # Note: polars-gpu support will be available in a future release
107
+ ```
108
+
47
109
  Scroll down for detailed usage examples and configuration instructions.
48
110
 
49
111
  ## What Makes This "Upgraded"?
@@ -56,14 +118,19 @@ This wrapper improves upon the official Bitvavo SDK with:
56
118
  - 🔄 **Up-to-date API compliance** including MiCA regulatory requirements
57
119
  - 📚 **Enhanced documentation** with examples and clear usage patterns
58
120
  - 🐍 **Modern Python support** (3.9+, dropped EOL versions)
121
+ - 🔑 **Multi-key & keyless support** for enhanced rate limiting and public access
59
122
  - ⚡ **Better error handling** and rate limiting
60
123
  - 🔧 **Developer-friendly tooling** (ruff, mypy, pre-commit hooks)
124
+ - 📊 **Unified dataframe support** via Narwhals (pandas, polars, cuDF, modin, PyArrow, Dask, DuckDB, Ibis, PySpark, SQLFrame)
61
125
 
62
126
  ## Features
63
127
 
64
128
  ### Full API Coverage
65
129
 
66
130
  - ✅ All REST endpoints (public and private)
131
+ - ✅ **Multiple API key support** with automatic load balancing
132
+ - ✅ **Keyless access** for public endpoints without authentication
133
+ - ✅ **Comprehensive dataframe support** via Narwhals (pandas, polars, cuDF, modin, PyArrow, Dask, DuckDB, Ibis, PySpark, and more)
67
134
  - ✅ WebSocket support with reconnection logic
68
135
  - ✅ Rate limiting with automatic throttling
69
136
  - ✅ MiCA compliance reporting endpoints
@@ -79,6 +146,7 @@ This wrapper improves upon the official Bitvavo SDK with:
79
146
  ### Production Ready
80
147
 
81
148
  - ✅ Automatic rate limit management
149
+ - ✅ Multi-key failover support
82
150
  - ✅ Connection retry logic
83
151
  - ✅ Proper error responses
84
152
  - ✅ Memory efficient WebSocket handling
@@ -88,8 +156,19 @@ This wrapper improves upon the official Bitvavo SDK with:
88
156
  Create a `.env` file in your project root:
89
157
 
90
158
  ```env
159
+ # Single API key (traditional)
91
160
  BITVAVO_APIKEY=your-api-key-here
92
161
  BITVAVO_APISECRET=your-api-secret-here
162
+
163
+ # Multiple API keys (for rate limiting)
164
+ # BITVAVO_APIKEYS='[{"key": "key1", "secret": "secret1"}, {"key": "key2", "secret": "secret2"}]'
165
+
166
+ # Keyless access (public endpoints only)
167
+ BITVAVO_PREFER_KEYLESS=true
168
+
169
+ # Enhanced settings
170
+ BITVAVO_API_UPGRADED_DEFAULT_RATE_LIMIT=750
171
+ BITVAVO_API_UPGRADED_PREFER_KEYLESS=false
93
172
  ```
94
173
 
95
174
  Then use the settings:
@@ -106,6 +185,17 @@ bitvavo = Bitvavo({
106
185
  # Option 2: Auto-load from .env
107
186
  settings = BitvavoSettings()
108
187
  bitvavo = Bitvavo(settings.model_dump())
188
+
189
+ # Option 3: Multiple API keys
190
+ bitvavo = Bitvavo({
191
+ 'APIKEYS': [
192
+ {'key': 'key1', 'secret': 'secret1'},
193
+ {'key': 'key2', 'secret': 'secret2'}
194
+ ]
195
+ })
196
+
197
+ # Option 4: Keyless (public endpoints only)
198
+ bitvavo = Bitvavo({'PREFER_KEYLESS': True})
109
199
  ```
110
200
 
111
201
  ## WebSocket Usage
@@ -135,6 +225,66 @@ except KeyboardInterrupt:
135
225
  ws.closeSocket()
136
226
  ```
137
227
 
228
+ ## Multi-Key & Keyless Examples
229
+
230
+ ### Multiple API Keys for Rate Limiting
231
+
232
+ ```python
233
+ from bitvavo_api_upgraded import Bitvavo
234
+
235
+ # Configure multiple API keys
236
+ bitvavo = Bitvavo({
237
+ 'APIKEYS': [
238
+ {'key': 'key1', 'secret': 'secret1'},
239
+ {'key': 'key2', 'secret': 'secret2'},
240
+ {'key': 'key3', 'secret': 'secret3'}
241
+ ]
242
+ })
243
+
244
+ # API automatically balances load across keys
245
+ balance = bitvavo.balance({}) # Uses least-used key
246
+ orders = bitvavo.getOrders('BTC-EUR', {}) # May use different key
247
+ trades = bitvavo.getTrades('BTC-EUR', {}) # Automatic failover if rate limit reached
248
+ ```
249
+
250
+ ### Keyless Access (Public Endpoints)
251
+
252
+ ```python
253
+ from bitvavo_api_upgraded import Bitvavo
254
+
255
+ # No API keys needed for public data
256
+ bitvavo = Bitvavo({'PREFER_KEYLESS': True})
257
+
258
+ # These work without authentication and don't count against your rate limits
259
+ markets = bitvavo.markets({})
260
+ ticker = bitvavo.ticker24h({'market': 'BTC-EUR'})
261
+ trades = bitvavo.publicTrades('BTC-EUR', {})
262
+ book = bitvavo.book('BTC-EUR', {})
263
+ candles = bitvavo.candles('BTC-EUR', '1h', {})
264
+
265
+ # Private endpoints will still require authentication
266
+ # account = bitvavo.account() # This would fail without API keys
267
+ ```
268
+
269
+ ### Hybrid Configuration
270
+
271
+ ```python
272
+ # Combine keyless preference with API keys for optimal performance
273
+ bitvavo = Bitvavo({
274
+ 'APIKEYS': [
275
+ {'key': 'key1', 'secret': 'secret1'},
276
+ {'key': 'key2', 'secret': 'secret2'}
277
+ ],
278
+ 'PREFER_KEYLESS': True # Use keyless for public endpoints, API keys for private
279
+ })
280
+
281
+ # Public calls use keyless (no rate limit impact)
282
+ markets = bitvavo.markets({})
283
+
284
+ # Private calls use API keys with load balancing
285
+ balance = bitvavo.balance({})
286
+ ```
287
+
138
288
  ## API Examples
139
289
 
140
290
  ### Public Endpoints (No Authentication)
@@ -213,6 +363,74 @@ book_report = bitvavo.reportBook(
213
363
  history = bitvavo.accountHistory(options={})
214
364
  ```
215
365
 
366
+ ### Dataframe Usage
367
+
368
+ The library supports multiple dataframe formats for tabular data like market data, asset information, and candlestick data:
369
+
370
+ ```python
371
+ from bitvavo_api_upgraded import Bitvavo
372
+
373
+ bitvavo = Bitvavo({'APIKEY': 'key', 'APISECRET': 'secret'})
374
+
375
+ # Get markets as different dataframe types
376
+ markets_dict = bitvavo.markets({}, output_format='dict') # Default dict format
377
+ markets_pandas = bitvavo.markets({}, output_format='pandas') # Pandas DataFrame
378
+ markets_polars = bitvavo.markets({}, output_format='polars') # Polars DataFrame
379
+ markets_pyarrow = bitvavo.markets({}, output_format='pyarrow') # PyArrow Table
380
+
381
+ # Get assets information as dataframes
382
+ assets_cudf = bitvavo.assets(
383
+ {},
384
+ output_format='cudf' # GPU-accelerated with cuDF
385
+ )
386
+
387
+ # Get candlestick data with distributed processing
388
+ candles_dask = bitvavo.candles(
389
+ 'BTC-EUR',
390
+ '1h',
391
+ {'limit': 100},
392
+ output_format='dask' # Distributed with Dask
393
+ )
394
+
395
+ # Get public trades with analytical databases
396
+ trades_duckdb = bitvavo.publicTrades(
397
+ 'BTC-EUR',
398
+ {'limit': 1000},
399
+ output_format='duckdb' # DuckDB relation
400
+ )
401
+
402
+ # Account balance with PySpark for big data processing
403
+ balance_spark = bitvavo.balance(
404
+ {},
405
+ output_format='pyspark' # PySpark DataFrame
406
+ )
407
+ ```
408
+
409
+ ### Working with Different Libraries
410
+
411
+ ```python
412
+ # Pandas example - most common
413
+ import pandas as pd
414
+ df = bitvavo.markets({}, output_format='pandas')
415
+ print(df.describe())
416
+ df.to_csv('markets.csv')
417
+
418
+ # Polars example - faster for large datasets
419
+ import polars as pl
420
+ df = bitvavo.candles('BTC-EUR', '1h', {'limit': 1000}, output_format='polars')
421
+ result = df.filter(pl.col('close') > 50000).select(['timestamp', 'close'])
422
+
423
+ # DuckDB example - analytical queries
424
+ import duckdb
425
+ rel = bitvavo.publicTrades('BTC-EUR', {'limit': 10000}, output_format='duckdb')
426
+ high_volume_trades = duckdb.query("SELECT * FROM rel WHERE amount > 1.0")
427
+
428
+ # PyArrow example - columnar data
429
+ import pyarrow as pa
430
+ table = bitvavo.assets({}, output_format='pyarrow')
431
+ df = table.to_pandas() # Convert to pandas when needed
432
+ ```
433
+
216
434
  ## Error Handling
217
435
 
218
436
  ```python
@@ -247,11 +465,28 @@ print(f"Remaining API calls: {remaining}")
247
465
  if remaining > 10:
248
466
  # Safe to make API calls
249
467
  response = bitvavo.balance({})
468
+
469
+ # With multiple API keys, rate limits are distributed
470
+ bitvavo_multi = Bitvavo({
471
+ 'APIKEYS': [
472
+ {'key': 'key1', 'secret': 'secret1'},
473
+ {'key': 'key2', 'secret': 'secret2'}
474
+ ]
475
+ })
476
+
477
+ # Each key gets its own rate limit pool
478
+ # Automatic failover when one key hits limits
479
+ for i in range(2000): # Would exceed single key limit
480
+ markets = bitvavo_multi.markets({}) # Automatically switches keys
481
+
482
+ # Keyless calls don't count against authenticated rate limits
483
+ bitvavo_keyless = Bitvavo({'PREFER_KEYLESS': True})
484
+ markets = bitvavo_keyless.markets({}) # Uses public rate limit pool
250
485
  ```
251
486
 
252
487
  ## Development & Contributing
253
488
 
254
- ```shell
489
+ ````shell
255
490
  echo "install development requirements"
256
491
  uv sync
257
492
  echo "run tox, a program that creates separate environments for different python versions, for testing purposes (among other things)"
@@ -283,7 +518,7 @@ uv run mypy src/
283
518
  # Linting and formatting
284
519
  uv run ruff check
285
520
  uv run ruff format
286
- ```
521
+ ````
287
522
 
288
523
  ### Project Structure
289
524
 
@@ -317,6 +552,9 @@ This package includes a `py.typed` file to enable type checking. Reference: [Don
317
552
 
318
553
  - Import: `from bitvavo_api_upgraded import Bitvavo` (instead of `from python_bitvavo_api.bitvavo import Bitvavo`)
319
554
  - **Breaking Change**: Trading operations require `operatorId` parameter
555
+ - **New**: Multiple API key support for better rate limiting
556
+ - **New**: Keyless access for public endpoints
557
+ - **New**: Comprehensive dataframe support
320
558
  - Enhanced error handling and type safety
321
559
  - Better configuration management with `.env` support
322
560
 
@@ -325,7 +563,30 @@ This package includes a `py.typed` file to enable type checking. Reference: [Don
325
563
  1. Update import statements
326
564
  2. Add `operatorId` to trading method calls
327
565
  3. Optional: Migrate to `.env` configuration
328
- 4. Enjoy improved type hints and error handling!
566
+ 4. Optional: Configure multiple API keys for better rate limits
567
+ 5. Optional: Enable keyless mode for public endpoint efficiency
568
+ 6. Enjoy improved type hints and error handling!
569
+
570
+ ### Enhanced Features (Optional)
571
+
572
+ ```python
573
+ # Traditional single key (works as before)
574
+ bitvavo = Bitvavo({'APIKEY': 'key', 'APISECRET': 'secret'})
575
+
576
+ # New: Multiple keys for rate limiting
577
+ bitvavo = Bitvavo({
578
+ 'APIKEYS': [
579
+ {'key': 'key1', 'secret': 'secret1'},
580
+ {'key': 'key2', 'secret': 'secret2'}
581
+ ]
582
+ })
583
+
584
+ # New: Keyless for public endpoints
585
+ bitvavo = Bitvavo({'PREFER_KEYLESS': True})
586
+
587
+ # New: Dataframe support
588
+ markets_df = bitvavo.markets({}, output_format='pandas')
589
+ ```
329
590
 
330
591
  ---
331
592
 
@@ -388,105 +649,105 @@ Want to quickly make a trading app? Here you go:
388
649
 
389
650
  1. **Install Bitvavo SDK for Python**
390
651
 
391
- In your Python app, add [Bitvavo SDK for
392
- Python](https://github.com/bitvavo/python-bitvavo-api) from
393
- [pypi.org](https://pypi.org/project/python-bitvavo-api/):
652
+ In your Python app, add [Bitvavo SDK for
653
+ Python](https://github.com/bitvavo/python-bitvavo-api) from
654
+ [pypi.org](https://pypi.org/project/python-bitvavo-api/):
394
655
 
395
- ```shell
396
- python -m pip install python_bitvavo_api
397
- ```
656
+ ```shell
657
+ python -m pip install python_bitvavo_api
658
+ ```
398
659
 
399
- If you installed from `test.pypi.com`, update the requests library: `pip
400
- install --upgrade requests`.
660
+ If you installed from `test.pypi.com`, update the requests library: `pip
661
+ install --upgrade requests`.
401
662
 
402
663
  1. **Create a simple Bitvavo implementation**
403
664
 
404
- Add the following code to a new file in your app:
405
-
406
- ```python
407
- from python_bitvavo_api.bitvavo import Bitvavo
408
- import json
409
- import time
410
-
411
- # Use this class to connect to Bitvavo and make your first calls.
412
- # Add trading strategies to implement your business logic.
413
- class BitvavoImplementation:
414
- api_key = "<Replace with your your API key from Bitvavo Dashboard>"
415
- api_secret = "<Replace with your API secret from Bitvavo Dashboard>"
416
- bitvavo_engine = None
417
- bitvavo_socket = None
418
-
419
- # Connect securely to Bitvavo, create the WebSocket and error callbacks.
420
- def __init__(self):
421
- self.bitvavo_engine = Bitvavo({
422
- 'APIKEY': self.api_key,
423
- 'APISECRET': self.api_secret
424
- })
425
- self.bitvavo_socket = self.bitvavo_engine.newWebsocket()
426
- self.bitvavo_socket.setErrorCallback(self.error_callback)
427
-
428
- # Handle errors.
429
- def error_callback(self, error):
430
- print("Add your error message.")
431
- #print("Errors:", json.dumps(error, indent=2))
432
-
433
- # Retrieve the data you need from Bitvavo in order to implement your
434
- # trading logic. Use multiple workflows to return data to your
435
- # callbacks.
436
- def a_trading_strategy(self):
437
- self.bitvavo_socket.ticker24h({}, self.a_trading_strategy_callback)
438
-
439
- # In your app you analyse data returned by the trading strategy, then make
440
- # calls to Bitvavo to respond to market conditions.
441
- def a_trading_strategy_callback(self, response):
442
- # Iterate through the markets
443
- for market in response:
444
-
445
- match market["market"]:
446
- case "ZRX-EUR":
447
- print("Eureka, the latest bid for ZRX-EUR is: ", market["bid"] )
448
- # Implement calculations for your trading logic.
449
- # If they are positive, place an order: For example:
450
- # self.bitvavo_socket.placeOrder("ZRX-EUR",
451
- # 'buy',
452
- # 'limit',
453
- # { 'amount': '1', 'price': '00001' },
454
- # self.order_placed_callback)
455
- case "a different market":
456
- print("do something else")
457
- case _:
458
- print("Not this one: ", market["market"])
459
-
460
-
461
-
462
- def order_placed_callback(self, response):
463
- # The order return parameters explain the quote and the fees for this trade.
464
- print("Order placed:", json.dumps(response, indent=2))
465
- # Add your business logic.
466
-
467
-
468
- # Sockets are fast, but asynchronous. Keep the socket open while you are
469
- # trading.
470
- def wait_and_close(self):
471
- # Bitvavo uses a weight based rate limiting system. Your app is limited to 1000 weight points per IP or
472
- # API key per minute. The rate weighting for each endpoint is supplied in Bitvavo API documentation.
473
- # This call returns the amount of points left. If you make more requests than permitted by the weight limit,
474
- # your IP or API key is banned.
475
- limit = self.bitvavo_engine.getRemainingLimit()
476
- try:
477
- while (limit > 0):
478
- time.sleep(0.5)
479
- limit = self.bitvavo_engine.getRemainingLimit()
480
- except KeyboardInterrupt:
481
- self.bitvavo_socket.closeSocket()
482
-
483
-
484
- # Shall I re-explain main? Naaaaaaaaaa.
485
- if __name__ == '__main__':
486
- bvavo = BitvavoImplementation()
487
- bvavo.a_trading_strategy()
488
- bvavo.wait_and_close()
489
- ```
665
+ Add the following code to a new file in your app:
666
+
667
+ ```python
668
+ from python_bitvavo_api.bitvavo import Bitvavo
669
+ import json
670
+ import time
671
+
672
+ # Use this class to connect to Bitvavo and make your first calls.
673
+ # Add trading strategies to implement your business logic.
674
+ class BitvavoImplementation:
675
+ api_key = "<Replace with your your API key from Bitvavo Dashboard>"
676
+ api_secret = "<Replace with your API secret from Bitvavo Dashboard>"
677
+ bitvavo_engine = None
678
+ bitvavo_socket = None
679
+
680
+ # Connect securely to Bitvavo, create the WebSocket and error callbacks.
681
+ def __init__(self):
682
+ self.bitvavo_engine = Bitvavo({
683
+ 'APIKEY': self.api_key,
684
+ 'APISECRET': self.api_secret
685
+ })
686
+ self.bitvavo_socket = self.bitvavo_engine.newWebsocket()
687
+ self.bitvavo_socket.setErrorCallback(self.error_callback)
688
+
689
+ # Handle errors.
690
+ def error_callback(self, error):
691
+ print("Add your error message.")
692
+ #print("Errors:", json.dumps(error, indent=2))
693
+
694
+ # Retrieve the data you need from Bitvavo in order to implement your
695
+ # trading logic. Use multiple workflows to return data to your
696
+ # callbacks.
697
+ def a_trading_strategy(self):
698
+ self.bitvavo_socket.ticker24h({}, self.a_trading_strategy_callback)
699
+
700
+ # In your app you analyse data returned by the trading strategy, then make
701
+ # calls to Bitvavo to respond to market conditions.
702
+ def a_trading_strategy_callback(self, response):
703
+ # Iterate through the markets
704
+ for market in response:
705
+
706
+ match market["market"]:
707
+ case "ZRX-EUR":
708
+ print("Eureka, the latest bid for ZRX-EUR is: ", market["bid"] )
709
+ # Implement calculations for your trading logic.
710
+ # If they are positive, place an order: For example:
711
+ # self.bitvavo_socket.placeOrder("ZRX-EUR",
712
+ # 'buy',
713
+ # 'limit',
714
+ # { 'amount': '1', 'price': '00001' },
715
+ # self.order_placed_callback)
716
+ case "a different market":
717
+ print("do something else")
718
+ case _:
719
+ print("Not this one: ", market["market"])
720
+
721
+
722
+
723
+ def order_placed_callback(self, response):
724
+ # The order return parameters explain the quote and the fees for this trade.
725
+ print("Order placed:", json.dumps(response, indent=2))
726
+ # Add your business logic.
727
+
728
+
729
+ # Sockets are fast, but asynchronous. Keep the socket open while you are
730
+ # trading.
731
+ def wait_and_close(self):
732
+ # Bitvavo uses a weight based rate limiting system. Your app is limited to 1000 weight points per IP or
733
+ # API key per minute. The rate weighting for each endpoint is supplied in Bitvavo API documentation.
734
+ # This call returns the amount of points left. If you make more requests than permitted by the weight limit,
735
+ # your IP or API key is banned.
736
+ limit = self.bitvavo_engine.getRemainingLimit()
737
+ try:
738
+ while (limit > 0):
739
+ time.sleep(0.5)
740
+ limit = self.bitvavo_engine.getRemainingLimit()
741
+ except KeyboardInterrupt:
742
+ self.bitvavo_socket.closeSocket()
743
+
744
+
745
+ # Shall I re-explain main? Naaaaaaaaaa.
746
+ if __name__ == '__main__':
747
+ bvavo = BitvavoImplementation()
748
+ bvavo.a_trading_strategy()
749
+ bvavo.wait_and_close()
750
+ ```
490
751
 
491
752
  1. **Add security information**
492
753
 
@@ -502,8 +763,8 @@ Want to quickly make a trading app? Here you go:
502
763
 
503
764
  1. **Run your app**
504
765
 
505
- - Command line warriors: `python3 <filename>`.
506
- - IDE heroes: press the big green button.
766
+ - Command line warriors: `python3 <filename>`.
767
+ - IDE heroes: press the big green button.
507
768
 
508
769
  Your app connects to Bitvavo and returns a list the latest trade price for each
509
770
  market. You use this data to implement your trading logic.
@@ -0,0 +1,10 @@
1
+ bitvavo_api_upgraded/__init__.py,sha256=27f1dd18199939f6f578ec9d6b1b0f9977ce219e7c8556b5a807c4e9012b507b,301
2
+ bitvavo_api_upgraded/bitvavo.py,sha256=b2b8b1cc2c98c4f47eacdbf93cd1ee0d36291c8df68d152c1feb3712b06b49df,164775
3
+ bitvavo_api_upgraded/dataframe_utils.py,sha256=25ffb6ce462e2b966cf6488c14994298ef8eca48d9c8522f5b669a30960f529a,5792
4
+ bitvavo_api_upgraded/helper_funcs.py,sha256=e2805d435c41f82d979104e637eade7f323359f3be214a300d25a139215d0915,3212
5
+ bitvavo_api_upgraded/py.typed,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
6
+ bitvavo_api_upgraded/settings.py,sha256=6ebd68a8ddcaf0ea229a629ad4996fccc82960d1dfaf690ad9fd78b42ef6765f,5311
7
+ bitvavo_api_upgraded/type_aliases.py,sha256=10e7772e1aeec8cd5a6589f8c7229885da12aa5f26647f3c69c374a86ccc31c9,1992
8
+ bitvavo_api_upgraded-2.2.0.dist-info/WHEEL,sha256=76443c98c0efcfdd1191eac5fa1d8223dba1c474dbd47676674a255e7ca48770,79
9
+ bitvavo_api_upgraded-2.2.0.dist-info/METADATA,sha256=900cbf71d10dc4813bc0e1e9d169ba7a0059e1839e05db8821a98770f691cc8c,25478
10
+ bitvavo_api_upgraded-2.2.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.8.9
2
+ Generator: uv 0.8.12
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,9 +0,0 @@
1
- bitvavo_api_upgraded/__init__.py,sha256=0922b82678a737a9f1314aa84fe4bf565f5425ce0d3aac1f6db65ff909efa68e,222
2
- bitvavo_api_upgraded/bitvavo.py,sha256=e4d986ae3529b082d329f1da51027e7400f7a342faa023e037181dceb439d481,134183
3
- bitvavo_api_upgraded/helper_funcs.py,sha256=e2805d435c41f82d979104e637eade7f323359f3be214a300d25a139215d0915,3212
4
- bitvavo_api_upgraded/py.typed,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
5
- bitvavo_api_upgraded/settings.py,sha256=647dac47d894c8e0bf9526aa993e74c04467814ba86efbbc7744cb8983799d38,2266
6
- bitvavo_api_upgraded/type_aliases.py,sha256=3409cc4a4e67e9268422f1c579230a9d73b17cec276c5b849d129a01795c998c,932
7
- bitvavo_api_upgraded-2.0.0.dist-info/WHEEL,sha256=2b400f346628f0064eb5bbf656b39df8dfcb092437ab08244409d295749b81a3,78
8
- bitvavo_api_upgraded-2.0.0.dist-info/METADATA,sha256=e7e9d2261c0af757cfe323dc911012b2f834a030848684ac6d18585911eb6691,17102
9
- bitvavo_api_upgraded-2.0.0.dist-info/RECORD,,