solagent_plugin_birdeye/
primitive.rs

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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
use serde::{Deserialize, Serialize};

pub const BIRDEYE_URL: &str = "https://public-api.birdeye.so";

#[derive(Debug, Serialize, Deserialize)]
pub struct TokenOverviewResponse {
    pub data: TokenData,
    pub success: bool,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TokenData {
    pub address: String,
    pub decimals: u8,
    pub symbol: String,
    pub name: String,
    pub extensions: Extensions,
    pub logo_uri: String,
    pub liquidity: f64,
    pub last_trade_unix_time: u64,
    pub last_trade_human_time: String,
    pub price: f64,
    pub history_30m_price: f64,
    pub price_change_30m_percent: f64,
    pub history_1h_price: f64,
    pub price_change_1h_percent: f64,
    pub history_2h_price: f64,
    pub price_change_2h_percent: f64,
    pub history_4h_price: f64,
    pub price_change_4h_percent: f64,
    pub history_6h_price: f64,
    pub price_change_6h_percent: f64,
    pub history_8h_price: f64,
    pub price_change_8h_percent: f64,
    pub history_12h_price: f64,
    pub price_change_12h_percent: f64,
    pub history_24h_price: f64,
    pub price_change_24h_percent: f64,
    pub unique_wallet_30m: u64,
    pub unique_wallet_history_30m: u64,
    pub unique_wallet_30m_change_percent: f64,
    pub unique_wallet_1h: u64,
    pub unique_wallet_history_1h: u64,
    pub unique_wallet_1h_change_percent: f64,
    pub unique_wallet_2h: u64,
    pub unique_wallet_history_2h: u64,
    pub unique_wallet_2h_change_percent: f64,
    pub unique_wallet_4h: u64,
    pub unique_wallet_history_4h: u64,
    pub unique_wallet_4h_change_percent: f64,
    pub unique_wallet_8h: u64,
    pub unique_wallet_history_8h: u64,
    pub unique_wallet_8h_change_percent: f64,
    pub unique_wallet_24h: u64,
    pub unique_wallet_history_24h: u64,
    pub unique_wallet_24h_change_percent: f64,
    pub supply: f64,
    pub mc: f64,
    pub circulating_supply: f64,
    pub real_mc: f64,
    pub holder: u64,
    pub trade_30m: u64,
    pub trade_history_30m: u64,
    pub trade_30m_change_percent: f64,
    pub sell_30m: u64,
    pub sell_history_30m: u64,
    pub sell_30m_change_percent: f64,
    pub buy_30m: u64,
    pub buy_history_30m: u64,
    pub buy_30m_change_percent: f64,
    pub v_30m: f64,
    pub v_30m_usd: f64,
    pub v_history_30m: f64,
    pub v_history_30m_usd: f64,
    pub v_30m_change_percent: f64,
    pub v_buy_30m: f64,
    pub v_buy_30m_usd: f64,
    pub v_buy_history_30m: f64,
    pub v_buy_history_30m_usd: f64,
    pub v_buy_30m_change_percent: f64,
    pub v_sell_30m: f64,
    pub v_sell_30m_usd: f64,
    pub v_sell_history_30m: f64,
    pub v_sell_history_30m_usd: f64,
    pub v_sell_30m_change_percent: f64,
    pub trade_1h: u64,
    pub trade_history_1h: u64,
    pub trade_1h_change_percent: f64,
    pub sell_1h: u64,
    pub sell_history_1h: u64,
    pub sell_1h_change_percent: f64,
    pub buy_1h: u64,
    pub buy_history_1h: u64,
    pub buy_1h_change_percent: f64,
    pub v_1h: f64,
    pub v_1h_usd: f64,
    pub v_history_1h: f64,
    pub v_history_1h_usd: f64,
    pub v_1h_change_percent: f64,
    pub v_buy_1h: f64,
    pub v_buy_1h_usd: f64,
    pub v_buy_history_1h: f64,
    pub v_buy_history_1h_usd: f64,
    pub v_buy_1h_change_percent: f64,
    pub v_sell_1h: f64,
    pub v_sell_1h_usd: f64,
    pub v_sell_history_1h: f64,
    pub v_sell_history_1h_usd: f64,
    pub v_sell_1h_change_percent: f64,
    pub trade_2h: u64,
    pub trade_history_2h: u64,
    pub trade_2h_change_percent: f64,
    pub sell_2h: u64,
    pub sell_history_2h: u64,
    pub sell_2h_change_percent: f64,
    pub buy_2h: u64,
    pub buy_history_2h: u64,
    pub buy_2h_change_percent: f64,
    pub v_2h: f64,
    pub v_2h_usd: f64,
    pub v_history_2h: f64,
    pub v_history_2h_usd: f64,
    pub v_2h_change_percent: f64,
    pub v_buy_2h: f64,
    pub v_buy_2h_usd: f64,
    pub v_buy_history_2h: f64,
    pub v_buy_history_2h_usd: f64,
    pub v_buy_2h_change_percent: f64,
    pub v_sell_2h: f64,
    pub v_sell_2h_usd: f64,
    pub v_sell_history_2h: f64,
    pub v_sell_history_2h_usd: f64,
    pub v_sell_2h_change_percent: f64,
    pub trade_4h: u64,
    pub trade_history_4h: u64,
    pub trade_4h_change_percent: f64,
    pub sell_4h: u64,
    pub sell_history_4h: u64,
    pub sell_4h_change_percent: f64,
    pub buy_4h: u64,
    pub buy_history_4h: u64,
    pub buy_4h_change_percent: f64,
    pub v_4h: f64,
    pub v_4h_usd: f64,
    pub v_history_4h: f64,
    pub v_history_4h_usd: f64,
    pub v_4h_change_percent: f64,
    pub v_buy_4h: f64,
    pub v_buy_4h_usd: f64,
    pub v_buy_history_4h: f64,
    pub v_buy_history_4h_usd: f64,
    pub v_buy_4h_change_percent: f64,
    pub v_sell_4h: f64,
    pub v_sell_4h_usd: f64,
    pub v_sell_history_4h: f64,
    pub v_sell_history_4h_usd: f64,
    pub v_sell_4h_change_percent: f64,
    pub trade_8h: u64,
    pub trade_history_8h: u64,
    pub trade_8h_change_percent: f64,
    pub sell_8h: u64,
    pub sell_history_8h: u64,
    pub sell_8h_change_percent: f64,
    pub buy_8h: u64,
    pub buy_history_8h: u64,
    pub buy_8h_change_percent: f64,
    pub v_8h: f64,
    pub v_8h_usd: f64,
    pub v_history_8h: f64,
    pub v_history_8h_usd: f64,
    pub v_8h_change_percent: f64,
    pub v_buy_8h: f64,
    pub v_buy_8h_usd: f64,
    pub v_buy_history_8h: f64,
    pub v_buy_history_8h_usd: f64,
    pub v_buy_8h_change_percent: f64,
    pub v_sell_8h: f64,
    pub v_sell_8h_usd: f64,
    pub v_sell_history_8h: f64,
    pub v_sell_history_8h_usd: f64,
    pub v_sell_8h_change_percent: f64,
    pub trade_24h: u64,
    pub trade_history_24h: u64,
    pub trade_24h_change_percent: f64,
    pub sell_24h: u64,
    pub sell_history_24h: u64,
    pub sell_24h_change_percent: f64,
    pub buy_24h: u64,
    pub buy_history_24h: u64,
    pub buy_24h_change_percent: f64,
    pub v_24h: f64,
    pub v_24h_usd: f64,
    pub v_history_24h: f64,
    pub v_history_24h_usd: f64,
    pub v_24h_change_percent: f64,
    pub v_buy_24h: f64,
    pub v_buy_24h_usd: f64,
    pub v_buy_history_24h: f64,
    pub v_buy_history_24h_usd: f64,
    pub v_buy_24h_change_percent: f64,
    pub v_sell_24h: f64,
    pub v_sell_24h_usd: f64,
    pub v_sell_history_24h: f64,
    pub v_sell_history_24h_usd: f64,
    pub v_sell_24h_change_percent: f64,
    pub watch: Option<String>,
    pub number_markets: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Extensions {
    pub coingecko_id: String,
    pub serum_v3_usdc: String,
    pub serum_v3_usdt: String,
    pub website: String,
    pub telegram: Option<String>,
    pub twitter: String,
    pub description: String,
    pub discord: String,
    pub medium: String,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarketData {
    pub address: String,
    pub price: f64,
    pub liquidity: f64,
    pub supply: f64,
    pub marketcap: f64,
    pub circulating_supply: f64,
    pub circulating_marketcap: f64,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct MarketDataResponse {
    pub data: MarketData,
    pub success: bool,
}