-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
55 lines (37 loc) · 1.14 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from APIWoorton import APIWoorton
def main():
"""
Example of Woorton API use
You need a token provided by Woorton team to use the API
"""
# Create object
woorton = APIWoorton(token='TOKEN_HERE', environment='sandbox')
# Help on functions
# woorton.help()
""" Account details """
# List of instruments
# print woorton.instrument_list
# List of balances
# print woorton.balances()
# List of trades
# print woorton.trades()
# List of operations
# print woorton.ledger()
# List of exposures
# print woorton.exposures()
# List of remaining exposures
# print woorton.remaining_exposures()
""" Trading """
# 1) Request For Quote
# rfq = woorton.request_for_quote(amount=1.0, instrument='BTCEUR.SPOT', direction='buy')
# print rfq
# 2) Execute RFQ
# execution = woorton.execute(rfq)
# print execution
# 3) State of execution
# state = woorton.state(execution)
# print state
# Or alternatively:
# print woorton.market_order(amount=1.0, instrument='BTCEUR.SPOT', direction='buy')
if __name__ == '__main__':
main()