Skip to main content

cielo_rs_sdk/models/
feed.rs

1//! This module contains the data structures for the Cielo feed endpoint response.
2
3use serde::{Deserialize, Serialize};
4
5/// Represents an item in the feed.
6#[derive(Debug, Serialize, Deserialize, Clone)]
7#[serde(untagged)]
8pub enum Item {
9    /// A swap transaction.
10    Swap(Swap),
11    /// A liquidity pool (LP) transaction.
12    Lp(Lp),
13    /// A transfer transaction.
14    Transfer(Transfer),
15    /// A lending transaction.
16    Lending(Lending),
17    /// An NFT minting transaction.
18    NftMint(NftMint),
19    /// An NFT trading transaction.
20    NftTrade(NftTrade),
21    /// An NFT transfer transaction.
22    NftTransfer(NftTransfer),
23    /// An NFT lending transaction.
24    NftLending(NftLending),
25    /// A bridge transaction.
26    Bridge(Bridge),
27    /// A contract interaction.
28    ContractInteraction(ContractInteraction),
29    /// A wrap transaction.
30    Wrap(Wrap),
31    /// A Sudo Pool transaction.
32    SudoPool(SudoPool),
33    /// A reward transaction.
34    Reward(Reward),
35    /// A staking transaction.
36    Staking(Staking),
37    /// A perpetual transaction.
38    Perp(Perp),
39    /// A flashloan transaction.
40    Flashloan(Flashloan),
41    /// A contract creation transaction.
42    ContractCreation(ContractCreation),
43    /// An NFT liquidation transaction.
44    NftLiquidation(NftLiquidation),
45    /// An option event transaction.
46    Option(OptionType),
47    /// An NFT sweep transaction.
48    NftSweep(NftSweep),
49}
50
51/// Represents a swap transaction.
52#[derive(Debug, Serialize, Deserialize, Clone)]
53pub struct Swap {
54    /// The wallet address that initiated the swap transaction.
55    pub wallet: String,
56    /// A readable label for the wallet address.
57    pub wallet_label: String,
58    /// The unique hash identifier of the swap transaction.
59    pub tx_hash: String,
60    /// Specifies the type of transaction (e.g., token swap).
61    pub tx_type: String,
62    /// The blockchain network where the swap transaction occurred.
63    pub chain: String,
64    /// A numerical index or identifier for the transaction.
65    pub index: u32,
66    /// The timestamp marking when the transaction was executed.
67    pub timestamp: u64,
68    /// The block number on the blockchain where this transaction is recorded.
69    pub block: u64,
70    /// The decentralized exchange where the swap transaction took place.
71    pub dex: String,
72    /// The originating wallet address of the transaction.
73    pub from: String,
74    /// The destination wallet address of the transaction.
75    pub to: String,
76    /// The address of the first token involved in the swap.
77    pub token0_address: String,
78    /// The amount of the first token involved in the swap.
79    pub token0_amount: f64,
80    /// The USD value of the first token amount at the time of the swap.
81    pub token0_amount_usd: f64,
82    /// The name of the first token involved in the swap.
83    pub token0_name: String,
84    /// The price of the first token in USD.
85    pub token0_price_usd: f64,
86    /// The symbol of the first token involved in the swap.
87    pub token0_symbol: String,
88    /// A link to the icon of the token involved in the transaction.
89    pub token0_icon_link: String,
90    /// The address of the second token involved in the swap.
91    pub token1_address: String,
92    /// The amount of the second token involved in the swap.
93    pub token1_amount: f64,
94    /// The USD value of the second token amount at the time of the swap.
95    pub token1_amount_usd: f64,
96    /// The name of the second token involved in the swap.
97    pub token1_name: String,
98    /// The price of the second token in USD.
99    pub token1_price_usd: f64,
100    /// The symbol of the second token involved in the swap.
101    pub token1_symbol: String,
102    /// A link to the icon of the second token involved in the transaction.
103    pub token1_icon_link: String,
104    /// Indicates if this was the first interaction between involved wallet addresses.
105    pub first_interaction: bool,
106    /// Market cap and liquidity details of the tokens involved.
107    pub token_market_cap: Option<TokenMarketCap>,
108}
109
110/// Represents the market cap and liquidity details of a token.
111#[derive(Debug, Serialize, Deserialize, Clone)]
112pub struct TokenMarketCap {
113    /// The address of the token.
114    pub token_address: String,
115    /// The market capitalization of the token.
116    pub market_cap: f64,
117    /// The liquidity of the token.
118    pub liquidity: f64,
119}
120
121/// Represents a liquidity pool (LP) transaction.
122#[derive(Debug, Serialize, Deserialize, Clone)]
123pub struct Lp {
124    /// The wallet address participating in the LP transaction.
125    pub wallet: String,
126    /// A human-readable label or name associated with the wallet, such as an ENS name.
127    pub wallet_label: String,
128    /// The unique transaction hash identifying this specific LP transaction.
129    pub tx_hash: String,
130    /// Indicates the type of transaction, in this case, liquidity pool (LP) related.
131    pub tx_type: String,
132    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
133    pub chain: String,
134    /// A numerical index or identifier for the transaction.
135    pub index: u32,
136    /// The timestamp marking when the transaction was executed.
137    pub timestamp: u64,
138    /// The block number on the blockchain where this transaction is recorded.
139    pub block: u64,
140    /// The name of the decentralized exchange where the LP transaction occurred.
141    pub dex: String,
142    /// The originating wallet address for the transaction.
143    pub from: String,
144    /// Specifies the nature of the LP transaction, such as 'add' or 'remove'.
145    pub r#type: String,
146    /// The address of the first token involved in the LP transaction.
147    pub token0_address: String,
148    /// The amount of the first token involved in the transaction.
149    pub token0_amount: f64,
150    /// The USD value of the first token amount at the time of the transaction.
151    pub token0_amount_usd: f64,
152    /// The name of the first token involved in the transaction.
153    pub token0_name: String,
154    /// The price of the first token in USD.
155    pub token0_price_usd: f64,
156    /// The symbol of the first token involved in the transaction.
157    pub token0_symbol: String,
158    /// A link to the icon of the token involved in the transaction.
159    pub token0_icon_link: String,
160    /// The address of the second token involved in the LP transaction.
161    pub token1_address: String,
162    /// The amount of the second token involved in the transaction.
163    pub token1_amount: f64,
164    /// The USD value of the second token amount at the time of the transaction.
165    pub token1_amount_usd: f64,
166    /// The name of the second token involved in the transaction.
167    pub token1_name: String,
168    /// The price of the second token in USD.
169    pub token1_price_usd: f64,
170    /// The symbol of the second token involved in the transaction.
171    pub token1_symbol: String,
172    /// A link to the icon of the second token involved in the transaction.
173    pub token1_icon_link: String,
174    /// Indicates the lower bound of the price range for the LP position, relevant in certain types of liquidity pools.
175    pub lower_bound: f64,
176    /// Indicates the upper bound of the price range for the LP position, relevant in certain types of liquidity pools.
177    pub upper_bound: f64,
178}
179
180/// Represents a transfer transaction.
181#[derive(Debug, Serialize, Deserialize, Clone)]
182pub struct Transfer {
183    /// The wallet address involved in the transfer transaction.
184    pub wallet: String,
185    /// A readable label for the wallet address.
186    pub wallet_label: String,
187    /// The unique hash identifier of the transfer transaction.
188    pub tx_hash: String,
189    /// Specifies the type of transaction, in this case, a token transfer.
190    pub tx_type: String,
191    /// The blockchain network where the transfer transaction occurred.
192    pub chain: String,
193    /// A numerical index or identifier for the transaction.
194    pub index: u32,
195    /// The timestamp marking when the transaction was executed.
196    pub timestamp: u64,
197    /// The block number on the blockchain where this transaction is recorded.
198    pub block: u64,
199    /// The originating wallet address of the transaction.
200    pub from: String,
201    /// The destination wallet address of the transaction.
202    pub to: String,
203    /// A readable version of the 'from' wallet address.
204    pub from_label: String,
205    /// A readable version of the 'to' wallet address.
206    pub to_label: String,
207    /// The USD value of the amount transferred in the transaction.
208    pub amount_usd: f64,
209    /// The blockchain address of the contract under which the token is registered.
210    pub contract_address: String,
211    /// The name of the token being transferred.
212    pub name: String,
213    /// The symbol of the token being transferred.
214    pub symbol: String,
215    /// The price of the token in USD at the time of the transaction.
216    pub token_price_usd: f64,
217    /// Indicates the contract standard of the token, such as ERC20.
218    pub r#type: String,
219    /// A URL link to the token's icon image.
220    pub token_icon_link: String,
221    /// Contains the market capitalization and liquidity details of the tokens involved in the swap transaction.
222    pub token_market_cap: Option<TokenMarketCap>,
223}
224
225/// Represents a lending transaction.
226#[derive(Debug, Serialize, Deserialize, Clone)]
227pub struct Lending {
228    /// The wallet address associated with the transaction.
229    pub wallet: String,
230    /// A more readable, shortened version of the wallet address.
231    pub wallet_label: String,
232    /// The unique identifier of the transaction, represented as a hash.
233    pub tx_hash: String,
234    /// Specifies the type of DeFi transaction, such as lending, borrowing, etc.
235    pub tx_type: String,
236    /// Indicates the blockchain network on which the transaction occurred.
237    pub chain: String,
238    /// A sequential index or identifier for the transaction within a particular dataset or list.
239    pub index: u32,
240    /// The timestamp marking when the transaction was executed.
241    pub timestamp: u64,
242    /// The block number in the blockchain where this transaction is recorded.
243    pub block: u64,
244    /// The originating wallet address for the transaction.
245    pub from: String,
246    /// A readable, abbreviated form of the 'from' wallet address.
247    pub from_label: String,
248    /// Describes the action taken in the transaction, such as 'Repaid' in a lending scenario.
249    pub action: String,
250    /// The smart contract address involved in the transaction.
251    pub address: String,
252    /// The amount of the asset involved in the transaction.
253    pub amount: f64,
254    /// The equivalent value of the transaction amount in USD.
255    pub amount_usd: f64,
256    /// The decentralized exchange or platform where the transaction occurred, such as AaveV2.
257    pub dex: String,
258    /// A metric specific to lending platforms, indicating the health of the loan or position.
259    pub health_factor: f64,
260    /// The name of the asset involved in the transaction.
261    pub name: String,
262    /// The DeFi platform associated with the transaction, like AaveV3.
263    pub platform: String,
264    /// The price of the asset in USD at the time of the transaction.
265    pub price_usd: f64,
266    /// The symbol of the asset involved in the transaction.
267    pub symbol: String,
268    /// A URL link to the icon image of the token involved in the transaction.
269    pub token_icon_link: String,
270}
271
272/// Represents an NFT minting transaction.
273#[derive(Debug, Serialize, Deserialize, Clone)]
274pub struct NftMint {
275    /// The wallet address involved in the NFT minting transaction.
276    pub wallet: String,
277    /// A more readable label or identifier for the wallet address.
278    pub wallet_label: String,
279    /// The unique hash identifier of the NFT minting transaction.
280    pub tx_hash: String,
281    /// Specifies the type of transaction, in this case, NFT minting.
282    pub tx_type: String,
283    /// The blockchain network on which the minting transaction was conducted.
284    pub chain: String,
285    /// A numerical index or identifier for the transaction.
286    pub index: u32,
287    /// The timestamp marking when the transaction was executed.
288    pub timestamp: u64,
289    /// The block number on the blockchain where this transaction is recorded.
290    pub block: u64,
291    /// The originating wallet address of the transaction.
292    pub from: String,
293    /// The destination wallet address of the transaction.
294    pub to: String,
295    /// A readable version of the 'from' wallet address.
296    pub from_label: String,
297    /// A readable version of the 'to' wallet address.
298    pub to_label: String,
299    /// A thumbnail image URL of the NFT involved in the transaction.
300    pub thumbnail: String,
301    /// A full image URL of the NFT.
302    pub image: String,
303    /// The number of items of the NFT minted in the transaction.
304    pub amount: f64,
305    /// The blockchain address of the contract under which the NFT is minted.
306    pub contract_address: String,
307    /// The type of contract used for the NFT, such as ERC721.
308    pub contract_type: String,
309    /// The transaction fee incurred for minting the NFT.
310    pub fee: f64,
311    /// The name of the NFT minted.
312    pub nft_name: String,
313    /// The symbol associated with the NFT.
314    pub nft_symbol: String,
315    /// The unique token ID of the minted NFT.
316    pub nft_token_id: String,
317    /// The symbol of the currency used in the transaction (e.g., ETH, MATIC).
318    pub currency_symbol: String,
319    /// Indicates the contract standard of the NFT, such as ERC721.
320    pub r#type: String,
321    /// The value of the transaction. For minting, this is often zero since the NFT is being created.
322    pub value: f64,
323    /// The equivalent USD value of the transaction.
324    pub value_usd: f64,
325}
326
327/// Represents an NFT trading transaction.
328#[derive(Debug, Serialize, Deserialize, Clone)]
329pub struct NftTrade {
330    /// The wallet address involved in the NFT trading transaction.
331    pub wallet: String,
332    /// A readable label for the wallet address.
333    pub wallet_label: String,
334    /// The unique hash identifier of the NFT trading transaction.
335    pub tx_hash: String,
336    /// Specifies the type of transaction, in this case, NFT trading.
337    pub tx_type: String,
338    /// The blockchain network where the trading transaction occurred.
339    pub chain: String,
340    /// A numerical index or identifier for the transaction.
341    pub index: u32,
342    /// The timestamp marking when the transaction was executed.
343    pub timestamp: u64,
344    /// The block number on the blockchain where this transaction is recorded.
345    pub block: u64,
346    /// The originating wallet address of the transaction.
347    pub from: String,
348    /// The destination wallet address of the transaction.
349    pub to: String,
350    /// A thumbnail image URL of the NFT involved in the transaction.
351    pub thumbnail: String,
352    /// A full image URL of the NFT.
353    pub image: String,
354    /// Describes the action taken in the NFT trade, such as 'buy' or 'sell'.
355    pub action: String,
356    /// The blockchain contract address associated with the NFT.
357    pub contract: String,
358    /// The marketplace where the NFT trade occurred, such as OpenSea.
359    pub marketplace: String,
360    /// The blockchain address of the NFT involved in the trade.
361    pub nft_address: String,
362    /// The name of the NFT traded.
363    pub nft_name: String,
364    /// The symbol associated with the NFT.
365    pub nft_symbol: String,
366    /// The unique token ID of the NFT involved in the trade.
367    pub nft_token_id: String,
368    /// The price at which the NFT was traded.
369    pub price: f64,
370    /// The equivalent USD value of the NFT trade.
371    pub price_usd: f64,
372    /// The profit earned from the trade. This may be zero in some transactions.
373    pub profit: f64,
374    /// The symbol of the currency used in the trade, such as WETH or ETH.
375    pub currency_symbol: String,
376    /// The wallet address of the buyer in the trade.
377    pub buyer: String,
378    /// The wallet address of the seller in the trade.
379    pub seller: String,
380    /// The token type used in the transaction.
381    pub token: String,
382    /// Indicates whether this was the first interaction between the buyer and seller.
383    pub first_interaction: bool,
384    /// Specifies if the transaction involved a bid being accepted.
385    pub bid_accepted: bool,
386}
387
388/// Represents an NFT transfer transaction.
389#[derive(Debug, Serialize, Deserialize, Clone)]
390pub struct NftTransfer {
391    /// The wallet address involved in the NFT transfer transaction.
392    pub wallet: String,
393    /// A readable label for the wallet address.
394    pub wallet_label: String,
395    /// The unique hash identifier of the NFT transfer transaction.
396    pub tx_hash: String,
397    /// Specifies the type of transaction, in this case, NFT transfer.
398    pub tx_type: String,
399    /// The blockchain network where the transfer transaction occurred.
400    pub chain: String,
401    /// A numerical index or identifier for the transaction.
402    pub index: u32,
403    /// The timestamp marking when the transaction was executed.
404    pub timestamp: u64,
405    /// The block number on the blockchain where this transaction is recorded.
406    pub block: u64,
407    /// The originating wallet address of the transaction.
408    pub from: String,
409    /// The destination wallet address of the transaction.
410    pub to: String,
411    /// A readable version of the 'from' wallet address.
412    pub from_label: String,
413    /// A readable version of the 'to' wallet address.
414    pub to_label: String,
415    /// A thumbnail image URL of the NFT involved in the transaction.
416    pub thumbnail: String,
417    /// A full image URL of the NFT.
418    pub image: String,
419    /// The blockchain address of the contract under which the NFT is registered.
420    pub contract_address: String,
421    /// The type of contract used for the NFT, such as ERC721.
422    pub contract_type: String,
423    /// The transaction fee incurred for the transfer of the NFT.
424    pub fee: f64,
425    /// The name of the NFT being transferred.
426    pub nft_name: String,
427    /// The symbol associated with the NFT.
428    pub nft_symbol: String,
429    /// The unique token ID of the NFT involved in the transfer.
430    pub nft_token_id: String,
431    /// Indicates the contract standard of the NFT, such as ERC721.
432    pub r#type: String,
433    /// The value of the NFT at the time of the transfer, typically in the native cryptocurrency of the blockchain.
434    pub value: f64,
435}
436
437/// Represents an NFT lending transaction.
438#[derive(Debug, Serialize, Deserialize, Clone)]
439pub struct NftLending {
440    /// The wallet address involved in the NFT lending transaction.
441    pub wallet: String,
442    /// A more readable label or identifier for the wallet address.
443    pub wallet_label: String,
444    /// The unique hash identifier of the NFT lending transaction.
445    pub tx_hash: String,
446    /// Specifies the type of transaction, in this case, NFT lending.
447    pub tx_type: String,
448    /// The blockchain network on which the transaction was conducted.
449    pub chain: String,
450    /// A numerical index or identifier for the transaction.
451    pub index: u32,
452    /// The timestamp marking when the transaction was executed.
453    pub timestamp: u64,
454    /// The block number on the blockchain where this transaction is recorded.
455    pub block: u64,
456    /// The originating wallet address of the transaction.
457    pub from: String,
458    /// The destination wallet address of the transaction.
459    pub to: String,
460    /// A readable version of the 'from' wallet address.
461    pub from_label: String,
462    /// A readable version of the 'to' wallet address.
463    pub to_label: String,
464    /// A thumbnail image URL of the NFT involved in the transaction.
465    pub thumbnail: String,
466    /// A full image URL of the NFT.
467    pub image: String,
468    /// Describes the action taken in the NFT lending transaction, such as 'lend'.
469    pub action: String,
470    /// The blockchain address of the currency used in the transaction.
471    pub currency_address: String,
472    /// The symbol of the currency used in the transaction.
473    pub currency_symbol: String,
474    /// The interest rate applied in the NFT lending transaction.
475    pub interest: f64,
476    /// The blockchain address of the NFT involved in the transaction.
477    pub nft_address: String,
478    /// The name of the NFT.
479    pub nft_name: String,
480    /// The symbol of the NFT.
481    pub nft_symbol: String,
482    /// The platform or service through which the NFT lending transaction was conducted.
483    pub platform: String,
484    /// The unique identifier for the specific NFT within its collection.
485    pub nft_token_id: String,
486    /// The price at which the NFT was lent or transacted.
487    pub price: f64,
488    /// The equivalent USD value of the transaction price.
489    pub price_usd: f64,
490    /// Specifies the terms of the NFT lending agreement.
491    pub terms: f64,
492    /// Indicates whether the transaction involved refinancing of the NFT.
493    pub refinance: bool,
494}
495
496/// Represents a bridge transaction.
497#[derive(Debug, Serialize, Deserialize, Clone)]
498pub struct Bridge {
499    /// The wallet address involved in the transaction.
500    pub wallet: String,
501    /// A shortened, more readable version of the wallet address.
502    pub wallet_label: String,
503    /// The unique hash identifier of the transaction.
504    pub tx_hash: String,
505    /// The type of transaction.
506    pub tx_type: String,
507    /// The blockchain on which the transaction occurred, like 'ethereum'.
508    pub chain: String,
509    /// A numeric index or identifier for the transaction.
510    pub index: u32,
511    /// The timestamp when the transaction occurred.
512    pub timestamp: u64,
513    /// The block number on the blockchain in which the transaction is included.
514    pub block: u64,
515    /// The originating wallet address of the transaction.
516    pub from: String,
517    /// The destination wallet address of the transaction.
518    pub to: String,
519    /// A shortened, more readable version of the originating wallet address.
520    pub from_label: String,
521    /// A shortened, more readable version of the destination wallet address.
522    pub to_label: String,
523    /// The address of the token involved in the transaction.
524    pub token_address: String,
525    /// The name of the token involved in the transaction.
526    pub token_name: String,
527    /// The symbol of the token involved in the transaction.
528    pub token_symbol: String,
529    /// A link to the icon of the token involved in the transaction.
530    pub token_icon_link: String,
531    /// The amount of the token involved in the transaction.
532    pub amount: f64,
533    /// The equivalent amount in USD of the tokens involved in the transaction.
534    pub amount_usd: f64,
535    /// The originating chain of the transaction, in cases of cross-chain activities.
536    pub from_chain: String,
537    /// The destination chain of the transaction, in cases of cross-chain activities.
538    pub to_chain: String,
539    /// The platform or service used for the transaction.
540    pub platform: String,
541    /// The price of the token at the time of the transaction.
542    pub price: f64,
543    /// Specifies the nature of the transaction, like 'withdraw', 'deposit', etc.
544    pub r#type: String,
545}
546
547/// Represents a contract interaction.
548#[derive(Debug, Serialize, Deserialize, Clone)]
549pub struct ContractInteraction {
550    /// The wallet address participating in the contract interaction.
551    pub wallet: String,
552    /// A human-readable label or name associated with the wallet, such as an ENS name.
553    pub wallet_label: String,
554    /// The unique transaction hash identifying this specific contract interaction.
555    pub tx_hash: String,
556    /// Indicates the type of transaction.
557    pub tx_type: String,
558    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
559    pub chain: String,
560    /// A numerical index or identifier for the transaction.
561    pub index: u32,
562    /// The timestamp marking when the transaction was executed.
563    pub timestamp: u64,
564    /// The block number on the blockchain where this transaction is recorded.
565    pub block: u64,
566    /// The originating wallet address for the transaction.
567    pub from: String,
568    /// The destination wallet address for the transaction.
569    pub to: String,
570    /// The address of the smart contract involved in the interaction.
571    pub contract_address: String,
572    /// A human-readable label or name associated with the smart contract.
573    pub contract_label: String,
574}
575
576/// Represents a wrap transaction.
577#[derive(Debug, Serialize, Deserialize, Clone)]
578pub struct Wrap {
579    /// The wallet address participating in the wrap transaction.
580    pub wallet: String,
581    /// A human-readable label or name associated with the wallet, such as an ENS name.
582    pub wallet_label: String,
583    /// The unique transaction hash identifying this specific wrap transaction.
584    pub tx_hash: String,
585    /// Indicates the type of transaction, in this case, wrap related.
586    pub tx_type: String,
587    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
588    pub chain: String,
589    /// A numerical index or identifier for the transaction.
590    pub index: u32,
591    /// The timestamp marking when the transaction was executed.
592    pub timestamp: u64,
593    /// The block number on the blockchain where this transaction is recorded.
594    pub block: u64,
595    /// The decentralized exchange where the wrap transaction occurred.
596    pub dex: String,
597    /// The originating wallet address for the transaction.
598    pub from: String,
599    /// The destination wallet address for the transaction.
600    pub to: String,
601    /// The action describing the wrap process (e.g., wrap or unwrap).
602    pub action: String,
603    /// The amount of tokens wrapped in the transaction.
604    pub amount: f64,
605    /// The equivalent amount in USD of the wrapped tokens.
606    pub amount_usd: f64,
607    /// The address of the smart contract involved in the interaction.
608    pub contract_address: String,
609    /// The name of the token wrapped in the transaction.
610    pub name: String,
611    /// The symbol of the token wrapped in the transaction.
612    pub symbol: String,
613    /// The price of the token in USD at the time of the transaction.
614    pub token_price_usd: f64,
615    /// The type of token wrapped in the transaction.
616    pub token_type: String,
617    /// A link to the icon of the token involved in the transaction.
618    pub token_icon_link: String,
619}
620
621/// Represents a Sudo Pool transaction.
622#[derive(Debug, Serialize, Deserialize, Clone)]
623pub struct SudoPool {
624    /// The wallet address participating in the Sudo Pool transaction.
625    pub wallet: String,
626    /// A human-readable label or name associated with the wallet, such as an ENS name.
627    pub wallet_label: String,
628    /// The unique transaction hash identifying this specific Sudo Pool transaction.
629    pub tx_hash: String,
630    /// Indicates the type of transaction, in this case, liquidity pool (LP) related.
631    pub tx_type: String,
632    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
633    pub chain: String,
634    /// A numerical index or identifier for the transaction.
635    pub index: u32,
636    /// The timestamp marking when the transaction was executed.
637    pub timestamp: u64,
638    /// The block number on the blockchain where this transaction is recorded.
639    pub block: Option<u64>,
640    /// The decentralized exchange where the Sudo Pool transaction occurred.
641    pub dex: Option<String>,
642    /// The originating wallet address for the transaction.
643    pub from: String,
644    /// The address of the NFT contract involved in the interaction.
645    pub nft_address: String,
646    /// The amount of NFTs involved in the transaction.
647    pub nft_amount: u32,
648    /// The price of the NFT in the transaction.
649    pub nft_price: f64,
650    /// The symbol of the NFT in the transaction.
651    pub nft_symbol: String,
652    /// The destination wallet address for the transaction.
653    pub to: String,
654    /// The address of the first token in the LP pair.
655    pub token0_address: String,
656    /// The amount of the first token in the LP pair.
657    pub token0_amount: f64,
658    /// The equivalent amount in USD of the first token in the LP pair.
659    pub token0_amount_usd: f64,
660    /// The name of the first token in the LP pair.
661    pub token0_name: String,
662    /// The price of the first token in the LP pair in USD.
663    pub token0_price_usd: f64,
664    /// The symbol of the first token in the LP pair.
665    pub token0_symbol: String,
666    /// A link to the icon of the first token involved in the transaction.
667    pub token0_icon_link: String,
668}
669
670/// Represents a reward transaction.
671#[derive(Debug, Serialize, Deserialize, Clone)]
672pub struct Reward {
673    /// The wallet address participating in the reward transaction.
674    pub wallet: String,
675    /// A human-readable label or name associated with the wallet, such as an ENS name.
676    pub wallet_label: String,
677    /// The unique transaction hash identifying this specific reward transaction.
678    pub tx_hash: String,
679    /// Indicates the type of transaction, in this case, reward related.
680    pub tx_type: String,
681    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
682    pub chain: String,
683    /// A numerical index or identifier for the transaction.
684    pub index: u32,
685    /// The timestamp marking when the transaction was executed.
686    pub timestamp: u64,
687    /// The block number on the blockchain where this transaction is recorded.
688    pub block: u64,
689    /// The address of the token involved in the transaction.
690    pub address: String,
691    /// The amount of tokens involved in the transaction.
692    pub amount: f64,
693    /// The equivalent amount in USD of the tokens involved in the transaction.
694    pub amount_usd: f64,
695    /// The originating wallet address for the transaction.
696    pub from: String,
697    /// The name of the token involved in the transaction.
698    pub name: String,
699    /// The price of the token in USD.
700    pub price_usd: f64,
701    /// The symbol of the token involved in the transaction.
702    pub symbol: String,
703}
704
705/// Represents a staking transaction.
706#[derive(Debug, Serialize, Deserialize, Clone)]
707pub struct Staking {
708    /// The wallet address participating in the staking transaction.
709    pub wallet: String,
710    /// A human-readable label or name associated with the wallet, such as an ENS name.
711    pub wallet_label: String,
712    /// The unique transaction hash identifying this specific staking transaction.
713    pub tx_hash: String,
714    /// Indicates the type of transaction, in this case, staking related.
715    pub tx_type: String,
716    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
717    pub chain: String,
718    /// A numerical index or identifier for the transaction.
719    pub index: u32,
720    /// The timestamp marking when the transaction was executed.
721    pub timestamp: u64,
722    /// The block number on the blockchain where this transaction is recorded.
723    pub block: u64,
724    /// The originating wallet address for the transaction.
725    pub from: String,
726    /// The destination wallet address for the transaction.
727    pub to: String,
728    /// A human-readable label or name associated with the originating wallet.
729    pub from_label: String,
730    /// A human-readable label or name associated with the destination wallet.
731    pub to_label: String,
732    /// The amount of tokens staked in the transaction.
733    pub amount: f64,
734    /// The equivalent amount in USD of the staked tokens.
735    pub amount_usd: f64,
736    /// The price of the token in USD.
737    pub token_price_usd: f64,
738    /// The address of the smart contract involved in the interaction.
739    pub contract_address: String,
740    /// The symbol of the token staked in the transaction.
741    pub symbol: String,
742    /// The name of the token staked in the transaction.
743    pub name: String,
744    /// The action taken in the staking transaction (e.g., 'stake', 'unstake').
745    pub action: String,
746}
747
748/// Represents a Perpetual transaction.
749#[derive(Debug, Serialize, Deserialize, Clone)]
750pub struct Perp {
751    /// The wallet address participating in the Perpetual transaction.
752    pub wallet: String,
753    /// A human-readable label or name associated with the wallet, such as an ENS name.
754    pub wallet_label: String,
755    /// The unique transaction hash identifying this specific Perpetual transaction.
756    pub tx_hash: String,
757    /// Indicates the type of transaction, in this case, Perpetual related.
758    pub tx_type: String,
759    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
760    pub chain: String,
761    /// A numerical index or identifier for the transaction.
762    pub index: u32,
763    /// The timestamp marking when the transaction was executed.
764    pub timestamp: u64,
765    /// The block number on the blockchain where this transaction is recorded.
766    pub block: u64,
767    /// The action taken in the Perpetual event.
768    pub action: String,
769    /// The equivalent amount in USD of the tokens involved in the transaction.
770    pub amount_usd: f64,
771    /// The average price of the tokens involved in the transaction.
772    pub average_price: f64,
773    /// The address of the base token involved in the transaction.
774    pub base_token_address: String,
775    /// The amount of base tokens involved in the transaction.
776    pub base_token_amount: f64,
777    /// The symbol of the base token involved in the transaction.
778    pub base_token_symbol: String,
779    /// The decentralized exchange where the Perpetual transaction occurred.
780    pub dex: String,
781    /// The originating wallet address for the transaction.
782    pub from: String,
783    /// Indicates whether the transaction was a liquidation.
784    pub liquidation: bool,
785    /// The price at which the liquidation occurred.
786    pub liquidation_price: f64,
787    /// The destination wallet address for the transaction.
788    pub to: String,
789    /// The direction of the trade in the Perpetual transaction (e.g., 'long', 'short').
790    pub trade_direction: String,
791    /// Additional details about the Perpetual transaction.
792    pub perp_details: String,
793    /// The address of the first token in the LP pair.
794    pub token0_address: String,
795    /// The amount of the first token in the LP pair.
796    pub token0_amount: f64,
797    /// The equivalent amount in USD of the first token in the LP pair.
798    pub token0_amount_usd: f64,
799    /// The name of the first token in the LP pair.
800    pub token0_name: String,
801    /// The price of the first token in the LP pair in USD.
802    pub token0_price_usd: f64,
803    /// The symbol of the first token in the LP pair.
804    pub token0_symbol: String,
805    /// A link to the icon of the first token involved in the transaction.
806    pub token0_icon_link: String,
807    /// The address of the second token in the LP pair.
808    pub token1_address: String,
809    /// The amount of the second token in the LP pair.
810    pub token1_amount: f64,
811    /// The equivalent amount in USD of the second token in the LP pair.
812    pub token1_amount_usd: f64,
813    /// The name of the second token in the LP pair.
814    pub token1_name: String,
815    /// The price of the second token in the LP pair in USD.
816    pub token1_price_usd: f64,
817    /// The symbol of the second token in the LP pair.
818    pub token1_symbol: String,
819    /// A link to the icon of the second token involved in the transaction.
820    pub token1_icon_link: String,
821    /// The realized profit and loss of the Perpetual transaction.
822    pub realized_pnl: f64,
823    /// Indicates whether the Perpetual transaction involves an NFT.
824    pub is_nft_perp: bool,
825    /// The size of the position in the Perpetual transaction.
826    pub position_size: Option<f64>,
827    /// The equivalent amount in USD of the position size.
828    pub position_size_usd: Option<f64>,
829    /// The leverage used in the Perpetual transaction.
830    pub leverage: Option<f64>,
831    /// The unrealized profit and loss of the Perpetual transaction.
832    pub unrealized_pnl: Option<f64>,
833}
834
835/// Represents a flashloan transaction.
836#[derive(Debug, Serialize, Deserialize, Clone)]
837pub struct Flashloan {
838    /// The wallet address participating in the flashloan transaction.
839    pub wallet: String,
840    /// A human-readable label or name associated with the wallet, such as an ENS name.
841    pub wallet_label: String,
842    /// The unique transaction hash identifying this specific flashloan transaction.
843    pub tx_hash: String,
844    /// Indicates the type of transaction, in this case, flashloan related.
845    pub tx_type: String,
846    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
847    pub chain: String,
848    /// A numerical index or identifier for the transaction.
849    pub index: u32,
850    /// The timestamp marking when the transaction was executed.
851    pub timestamp: u64,
852    /// The block number on the blockchain where this transaction is recorded.
853    pub block: u64,
854    /// The address of the token involved in the transaction.
855    pub address: String,
856    /// The amount of tokens involved in the transaction.
857    pub amount: f64,
858    /// The equivalent amount in USD of the tokens involved in the transaction.
859    pub amount_usd: f64,
860    /// The decentralized exchange (DEX) where the flashloan transaction took place.
861    pub dex: String,
862    /// The originating wallet address for the transaction.
863    pub from: String,
864    /// The health factor of the wallet after the flashloan transaction.
865    pub health_factor: f64,
866    /// The name of the token involved in the transaction.
867    pub name: String,
868    /// The platform where the flashloan transaction took place.
869    pub platform: String,
870    /// The price of the token in USD.
871    pub price_usd: f64,
872    /// The symbol of the token involved in the transaction.
873    pub symbol: String,
874    /// A link to the icon of the token involved in the transaction.
875    pub token_icon_link: String,
876}
877
878/// Represents a contract creation transaction.
879#[derive(Debug, Serialize, Deserialize, Clone)]
880pub struct ContractCreation {
881    /// The wallet address participating in the contract creation transaction.
882    pub wallet: String,
883    /// A human-readable label or name associated with the wallet, such as an ENS name.
884    pub wallet_label: String,
885    /// The unique transaction hash identifying this specific contract creation transaction.
886    pub tx_hash: String,
887    /// Indicates the type of transaction, in this case, contract creation.
888    pub tx_type: String,
889    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
890    pub chain: String,
891    /// A numerical index or identifier for the transaction.
892    pub index: u32,
893    /// The timestamp marking when the transaction was executed.
894    pub timestamp: u64,
895    /// The block number on the blockchain where this transaction is recorded.
896    pub block: u64,
897    /// The equivalent amount in USD of the wrapped tokens.
898    pub amount_usd: f64,
899    /// The address of the smart contract involved in the interaction.
900    pub contract_address: String,
901    /// The originating wallet address for the transaction.
902    pub from: String,
903    /// A human-readable label or name associated with the originating wallet.
904    pub from_label: String,
905}
906
907/// Represents an NFT liquidation transaction.
908#[derive(Debug, Serialize, Deserialize, Clone)]
909pub struct NftLiquidation {
910    /// The wallet address participating in the NFT liquidation transaction.
911    pub wallet: String,
912    /// A human-readable label or name associated with the wallet, such as an ENS name.
913    pub wallet_label: String,
914    /// The unique transaction hash identifying this specific NFT liquidation transaction.
915    pub tx_hash: String,
916    /// Indicates the type of transaction, in this case, NFT liquidation related.
917    pub tx_type: String,
918    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
919    pub chain: String,
920    /// A numerical index or identifier for the transaction.
921    pub index: u32,
922    /// The timestamp marking when the transaction was executed.
923    pub timestamp: u64,
924    /// The block number on the blockchain where this transaction is recorded.
925    pub block: u64,
926    /// The address of the NFT contract involved in the interaction.
927    pub contract_address: String,
928    /// The address of the currency involved in the transaction.
929    pub currency_address: String,
930    /// The symbol of the currency involved in the transaction.
931    pub currency_symbol: String,
932    /// The decentralized exchange where the NFT liquidation transaction occurred.
933    pub dex: String,
934    /// The originating wallet address for the transaction.
935    pub from: String,
936    /// The address of the NFT contract involved in the interaction.
937    pub nft_address: String,
938    /// The name of the NFT in the transaction.
939    pub nft_name: String,
940    /// The symbol of the NFT in the transaction.
941    pub nft_symbol: String,
942    /// The platform where the NFT liquidation transaction took place.
943    pub platform: String,
944    /// The price of the NFT in the transaction.
945    pub price: f64,
946    /// The price of the NFT in USD.
947    pub price_usd: f64,
948    /// The destination wallet address for the transaction.
949    pub to: String,
950    /// The unique identifier of the NFT in the transaction.
951    pub token_id: String,
952}
953
954/// Represents an option event transaction.
955#[derive(Debug, Serialize, Deserialize, Clone)]
956pub struct OptionType {
957    /// The wallet address participating in the option event.
958    pub wallet: String,
959    /// A human-readable label or name associated with the wallet, such as an ENS name.
960    pub wallet_label: String,
961    /// The unique transaction hash identifying this specific option event.
962    pub tx_hash: String,
963    /// Indicates the type of transaction, in this case, option-related.
964    pub tx_type: String,
965    /// The blockchain network (e.g., Ethereum, Optimism) where this transaction takes place.
966    pub chain: String,
967    /// A numerical index or identifier for the transaction.
968    pub index: u32,
969    /// The timestamp marking when the transaction was executed.
970    pub timestamp: u64,
971    /// The block number on the blockchain where this transaction is recorded.
972    pub block: u64,
973    /// The action taken in the option event.
974    pub action: String,
975    /// The amount of tokens involved in the transaction.
976    pub amount: f64,
977    /// The asset involved in the option event.
978    pub asset: String,
979    /// The decentralized exchange (DEX) where the option event took place.
980    pub dex: String,
981    /// The direction of the option event (e.g., call or put).
982    pub direction: String,
983    /// The expiry date of the option.
984    pub expiry: String,
985    /// The originating wallet address for the transaction.
986    pub from: String,
987    /// The price of the option in USD.
988    pub option_price_usd: f64,
989    /// The status of the option position.
990    pub position_status: String,
991    /// The spot price of the asset in USD.
992    pub spot_price_usd: f64,
993    /// The status of the option event.
994    pub status: String,
995    /// The strike price of the option in USD.
996    pub strike_price_usd: f64,
997    /// The destination wallet address for the transaction.
998    pub to: String,
999    /// The type of option event (e.g., exercise, sell).
1000    pub r#type: String,
1001}
1002
1003/// Represents an NFT sweep transaction.
1004#[derive(Debug, Serialize, Deserialize, Clone)]
1005pub struct NftSweep {
1006    /// The wallet address involved in the NFT sweep transaction.
1007    pub wallet: String,
1008    /// A readable label for the wallet address.
1009    pub wallet_label: String,
1010    /// The unique hash identifier of the NFT sweep transaction.
1011    pub tx_hash: String,
1012    /// Specifies the type of transaction, in this case, NFT sweep related.
1013    pub tx_type: String,
1014    /// The blockchain network where the sweep transaction occurred.
1015    pub chain: String,
1016    /// A numerical index or identifier for the transaction.
1017    pub index: u32,
1018    /// The timestamp marking when the transaction was executed.
1019    pub timestamp: u64,
1020    /// The block number on the blockchain where this transaction is recorded.
1021    pub block: u64,
1022    /// The originating wallet address of the transaction.
1023    pub from: String,
1024    /// The destination wallet address of the transaction.
1025    pub to: String,
1026    /// A thumbnail image URL of the NFT involved in the transaction.
1027    pub thumbnail: String,
1028    /// A full image URL of the NFT.
1029    pub image: String,
1030    /// Describes the action taken in the NFT sweep, such as 'buy' or 'sell'.
1031    pub action: String,
1032    /// The blockchain contract address associated with the NFT.
1033    pub contract: String,
1034    /// The marketplace where the NFT sweep occurred, such as OpenSea.
1035    pub marketplace: String,
1036    /// The blockchain address of the NFT involved in the sweep.
1037    pub nft_address: String,
1038    /// The name of the NFT swept.
1039    pub nft_name: String,
1040    /// The symbol associated with the NFT.
1041    pub nft_symbol: String,
1042    /// The unique token ID of the NFT involved in the sweep.
1043    pub nft_token_id: String,
1044    /// The price at which the NFT was traded.
1045    pub price: f64,
1046    /// The equivalent USD value of the NFT sweep.
1047    pub price_usd: f64,
1048    /// The profit earned from the trade. This may be zero in some transactions.
1049    pub profit: f64,
1050    /// The symbol of the currency used in the trade, such as WETH or ETH.
1051    pub currency_symbol: String,
1052    /// The wallet address of the buyer in the trade.
1053    pub buyer: String,
1054    /// The wallet address of the seller in the trade.
1055    pub seller: String,
1056    /// The token type used in the transaction.
1057    pub token: String,
1058    /// Indicates whether this was the first interaction between the buyer and seller.
1059    pub first_interaction: bool,
1060    /// Specifies if the transaction involved a bid being accepted.
1061    pub bid_accepted: bool,
1062}