13
13
// limitations under the License.
14
14
// -------------------------------------------------------------------------------------------------
15
15
16
+ // Under development
17
+ #![ allow( dead_code) ]
18
+ #![ allow( unused_variables) ]
19
+
16
20
use std:: env;
17
21
18
- use nautilus_bitmex:: http:: {
19
- client:: BitmexHttpClient ,
20
- parse:: parse_instrument_any,
21
- query:: {
22
- GetExecutionParamsBuilder , GetOrderParamsBuilder , GetPositionParamsBuilder ,
23
- GetTradeParamsBuilder ,
24
- } ,
25
- } ;
26
- use nautilus_core:: time:: get_atomic_clock_realtime;
27
- use nautilus_model:: { identifiers:: InstrumentId , instruments:: any:: InstrumentAny } ;
22
+ use nautilus_bitmex:: http:: client:: BitmexHttpClient ;
28
23
use tracing:: level_filters:: LevelFilter ;
29
24
30
25
#[ tokio:: main]
@@ -37,69 +32,5 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
37
32
let api_secret = env:: var ( "BITMEX_API_SECRET" ) . expect ( "environment variable should be set" ) ;
38
33
let client = BitmexHttpClient :: new ( None , Some ( api_key) , Some ( api_secret) , false , None ) ;
39
34
40
- match client. get_instruments ( false ) . await {
41
- Ok ( resp) => {
42
- tracing:: debug!( "{:?}" , resp) ;
43
- let ts_init = get_atomic_clock_realtime ( ) . get_time_ns ( ) ;
44
- let mut instruments: Vec < InstrumentAny > = Vec :: new ( ) ;
45
- for def in resp {
46
- tracing:: debug!( "Parsing {def:?}" ) ;
47
- if let Some ( inst) = parse_instrument_any ( & def, ts_init) {
48
- instruments. push ( inst) ;
49
- } else {
50
- tracing:: warn!(
51
- "Did not parse: symbol={}, type={}" ,
52
- def. symbol,
53
- def. instrument_type,
54
- ) ;
55
- }
56
- }
57
- }
58
- Err ( e) => tracing:: error!( "{e:?}" ) ,
59
- }
60
-
61
- let instrument_id = InstrumentId :: from ( "XBTUSD.BITMEX" ) ;
62
-
63
- match client. get_instrument ( & instrument_id. symbol ) . await {
64
- Ok ( resp) => tracing:: debug!( "{:?}" , resp) ,
65
- Err ( e) => tracing:: error!( "{e:?}" ) ,
66
- }
67
-
68
- let resp = client. get_wallet ( ) . await ;
69
- match resp {
70
- Ok ( instrument) => tracing:: debug!( "{:?}" , instrument) ,
71
- Err ( e) => tracing:: error!( "{e:?}" ) ,
72
- }
73
-
74
- let params = GetOrderParamsBuilder :: default ( )
75
- . symbol ( "XBTUSD" . to_string ( ) )
76
- . build ( ) ?;
77
- match client. get_orders ( params) . await {
78
- Ok ( resp) => tracing:: debug!( "{:?}" , resp) ,
79
- Err ( e) => tracing:: error!( "{e:?}" ) ,
80
- }
81
-
82
- let params = GetTradeParamsBuilder :: default ( )
83
- . symbol ( "XBTUSD" . to_string ( ) )
84
- . build ( ) ?;
85
- match client. get_trades ( params) . await {
86
- Ok ( resp) => tracing:: debug!( "{:?}" , resp) ,
87
- Err ( e) => tracing:: error!( "{e:?}" ) ,
88
- }
89
-
90
- let params = GetExecutionParamsBuilder :: default ( )
91
- . symbol ( "XBTUSD" . to_string ( ) )
92
- . build ( ) ?;
93
- match client. get_executions ( params) . await {
94
- Ok ( resp) => tracing:: debug!( "{:?}" , resp) ,
95
- Err ( e) => tracing:: error!( "{e:?}" ) ,
96
- }
97
-
98
- let params = GetPositionParamsBuilder :: default ( ) . build ( ) ?;
99
- match client. get_positions ( params) . await {
100
- Ok ( resp) => tracing:: debug!( "{:?}" , resp) ,
101
- Err ( e) => tracing:: error!( "{e:?}" ) ,
102
- }
103
-
104
35
Ok ( ( ) )
105
36
}
0 commit comments