-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
72 lines (50 loc) · 1.97 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# This is a sample Python script.
import sys
from pylonPlotter import show_stats, plot_pylon
from pylonsim import controller
from pylonsim.pylon import Pylon
from pylonsim.pylontoken import PylonToken
from pylonsim.uniswapv2 import Uniswap
# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
def start():
debug = True
# Use a breakpoint in the code line below to debug your script.
float_token = PylonToken("ETH", 1000)
anchor_token = PylonToken("USDC", 1)
uniswap = Uniswap(float_token, anchor_token)
pylon = Pylon(uniswap, float_token, anchor_token)
float_token.mint("self", 1000)
anchor_token.mint("self", 10000000)
pylon.init_pylon("self", 10, 10000)
pylon.mint_pool_tokens("self", 1, False)
pylon.burn("self", 1, False)
pylon.mint_async("self", 0.5, 500, False)
pylon.burn_async("self", 1, False)
pylon.mint_pool_tokens("self", 1, False)
while True:
if not debug:
try:
command = controller.parse_command()
if command == "exit":
break
if command == "debug":
debug = not debug
eval(command)
print("posteval", command)
except Exception as e:
print("Error executing command: ", e)
else:
command = controller.parse_command()
if command == "exit":
break
if command == "debug":
debug = not debug
eval(command)
print("posteval ", command)
show_stats(38897447*0.995, 10915*0.995, 29417-2488, 1.055) # Press ⌘F8 to toggle the breakpoint.
plot_pylon(38897447*0.995, 10915*0.995, 29417-2488, 1.055)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
start()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/