-
Notifications
You must be signed in to change notification settings - Fork 4
/
middecsushi.py
157 lines (113 loc) · 3.02 KB
/
middecsushi.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import streamlit as st
import plotly
import plotly.express as px
import pandas as pd
import json
st.title("SUSHI ETH mid december")
query_id = "6b94a94d-f8f3-4856-a3a7-fc655cb9ac6c"
df = pd.read_json(
f"https://api.flipsidecrypto.com/api/v2/queries/{query_id}/data/latest",
convert_dates=["TIMESTAMP_NTZ"],
)
t_f = False
st.sidebar.write("Choose y-axis scale")
check = st.sidebar.checkbox("Linear/Log")
if check:
t_f = True
#-------------------------------------------------------
st.markdown("""
What Pool is Hot right now? On ethereum lets look at LP actions, by count.
""")
df = px.bar(
df, #this is the dataframe you are trying to plot
x = "DAYZ",
y = "COUNT(TO_ADDRESS_NAME)",
orientation = "v",
color = "TO_ADDRESS_NAME",
template = "plotly_white",
width = 1000,
height = 600,
log_y = t_f
)
st.plotly_chart(df)
query_id = "712872e7-ca98-4504-8afd-5ddf5c3e41d0"
df = pd.read_json(
f"https://api.flipsidecrypto.com/api/v2/queries/{query_id}/data/latest",
convert_dates=["TIMESTAMP_NTZ"],
)
st.dataframe(df)
st.markdown("""
and the same thing for polygon
""")
df = px.bar(
df, #this is the dataframe you are trying to plot
x = "DAYZ",
y = "COUNT(TO_ADDRESS_NAME)",
orientation = "v",
color = "TO_ADDRESS_NAME",
template = "plotly_white",
width = 1000,
height = 600,
log_y = t_f
)
st.plotly_chart(df)
query_id = "2ca64776-431b-42ff-b0e6-7f324b4aed35"
df = pd.read_json(
f"https://api.flipsidecrypto.com/api/v2/queries/{query_id}/data/latest",
convert_dates=["TIMESTAMP_NTZ"],
)
st.markdown("""
When sushi and ETH were both in freefall in december 8th, sushi breifly jumped against ETH. The price here is how many SUSHI in 1 ETH
""")
df = px.scatter(
df, #this is the dataframe you are trying to plot
x = "HOURZ",
y = "P",
orientation = "v",
# color = "TO_ADDRESS_NAME",
template = "plotly_white",
width = 1000,
height = 600,
log_y = t_f
)
st.plotly_chart(df)
query_id = "2ca64776-431b-42ff-b0e6-7f324b4aed35"
df = pd.read_json(
f"https://api.flipsidecrypto.com/api/v2/queries/{query_id}/data/latest",
convert_dates=["TIMESTAMP_NTZ"],
)
st.markdown("""
in the SUSHI-WETH pool, lets look at inflow and outflow for sushi
""")
df = px.bar(
df, #this is the dataframe you are trying to plot
x = "HOURZ",
y = "SUSHI",
orientation = "v",
# color = "TO_ADDRESS_NAME",
template = "plotly_white",
width = 1000,
height = 600,
log_y = t_f
)
st.plotly_chart(df)
query_id = "2ca64776-431b-42ff-b0e6-7f324b4aed35"
df = pd.read_json(
f"https://api.flipsidecrypto.com/api/v2/queries/{query_id}/data/latest",
convert_dates=["TIMESTAMP_NTZ"],
)
st.markdown("""
in the SUSHI-WETH pool, lets look at inflow and outflow for WETH
""")
df = px.bar(
df, #this is the dataframe you are trying to plot
x = "HOURZ",
y = "WETH",
orientation = "v",
# color = "TO_ADDRESS_NAME",
template = "plotly_white",
width = 1000,
height = 600,
log_y = t_f
)
st.plotly_chart(df)