-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmessages.py
100 lines (78 loc) · 2.2 KB
/
messages.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import json
from functions import get_trading_pair, token_detail
f = open("config.json")
config = json.load(f)
def menu_msg():
return f"""
COMMANDS
--------------------
/menu : List of commands
--------------------
/start - Start the Vite X Trader
/stop - Stop the bot
--------------------
/balance - get account balances
/open - get open orders
/active - get active positions
/pnl - get Profit and Loss for active positions
/whitelist : List of current trading pairs
/timeframes : List of time intervals
---------------------
$ detail <TRADING_PAIR> : detail for a specific trading pair on ViteX
$ detail <SYMBOL> : detail for a specific currency on ViteX
"""
def startup_msg():
return f"""
---------------
Vite X Trader
---------------
/menu - view commands
/start - start bot
Live Mode: {config['live']}
Interval: {config['interval']}
Quote Currency: {config['quote_currency']}
Ready...
"""
def pair_info_msg(symbol, net=config['mainnet']):
info = get_trading_pair(net, symbol)
return f"""
{symbol} DETAILS
----------------
{info['tradingCurrencyName']} - {info['quoteCurrencyName']}
Trading Currency ID : {info['tradingCurrencyId']}
Quote Currency ID : {info['quoteCurrencyId']}
Ask : {info['askPrice']}
Bid : {info['bidPrice']}
Last : {info['lastPrice']}
High : {info['highPrice']}
Low : {info['lowPrice']}
Min Order Size: {info['minOrderSize']}
open Buy Orders: {info['openBuyOrders']}
open Sell Orders: {info['openSellOrders']}
"""
def get_token_detail(symbol):
info = token_detail(symbol)
data= info['data']
links = []
for i in info['data']['links']:
new_str = f"{i} : {data['links'][i][0]}"
links.append(new_str)
links = "\n".join(links)
return f"""
{symbol} DETAIL
----------------
{data['name']} - {data['originalSymbol']}
TokenID: {data['tokenId']}
Total Supply: {data['totalSupply']}
OVERVIEW
----------------
{data['overview']['en']}
LINKS
-----------------
{links}
"""
def timeframe_msg():
timeframes = list({'5m': '5m', '15m': '15m', '30m': '30m', '1h': '1h', '2h': '2h', '4h': '4h', '6h': '6h', '8h': '8h', '12h': '12h', '1d': '1d', '3d': '3d', '1w': '1w'})
return " ".join(timeframes)
def get_whitelist():
return '\n'.join(config['whitelist'])