1use chrono::{DateTime, Utc};
2use rust_decimal::Decimal;
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct Vault {
9 pub id: u32,
11 pub vault_token: String,
13 pub symbol: String,
15 pub mints_enabled: bool,
17 pub redeems_enabled: bool,
19 pub min_mint_quantity: Decimal,
21 pub min_redeem_tokens: Decimal,
23 pub redeem_delay_ms: i64,
25 pub token_step_size: Decimal,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
31#[serde(rename_all = "camelCase")]
32pub struct VaultMintRequest {
33 pub vault_id: u32,
35 pub symbol: String,
37 pub quantity: Decimal,
39 pub auto_borrow: Option<bool>,
41 pub auto_lend_redeem: Option<bool>,
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(rename_all = "camelCase")]
48pub struct VaultRedeemRequest {
49 pub vault_id: u32,
51 pub vault_token_quantity: Option<Decimal>,
54}
55
56#[derive(Debug, Clone, Serialize, Deserialize)]
58#[serde(rename_all = "camelCase")]
59pub struct VaultRedeemCancelRequest {
60 pub vault_id: u32,
62}
63
64#[derive(Debug, Clone, Serialize, Deserialize)]
66#[serde(rename_all = "camelCase")]
67pub struct VaultHistory {
68 pub vault_id: u32,
70 pub timestamp: DateTime<Utc>,
72 pub nav: Option<Decimal>,
74 pub vault_equity: Option<Decimal>,
76 pub token_circulating_supply: Option<Decimal>,
78}
79
80#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
82#[serde(rename_all = "camelCase")]
83pub enum VaultHistoryInterval {
84 #[serde(rename = "1d")]
85 OneDay,
86 #[serde(rename = "1w")]
87 OneWeek,
88 #[serde(rename = "1month")]
89 OneMonth,
90 #[serde(rename = "1year")]
91 OneYear,
92}
93
94#[derive(Debug, Clone, Serialize, Deserialize)]
96#[serde(rename_all = "camelCase")]
97pub struct VaultHistoryParams {
98 pub interval: VaultHistoryInterval,
100 #[serde(skip_serializing_if = "Option::is_none")]
102 pub vault_id: Option<u32>,
103}
104
105#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
106pub enum VaultRedeemStatus {
107 Requested,
108 Redeemed,
109 Cancelled,
110}
111
112#[derive(Debug, Clone, Serialize, Deserialize)]
113#[serde(rename_all = "camelCase")]
114pub struct VaultRedeem {
115 pub status: VaultRedeemStatus,
116 pub id: String,
117 pub vault_id: u32,
118 pub vault_token_quantity: Decimal,
119 pub vault_token: Option<String>,
120 pub symbol: Option<String>,
121 pub quantity: Option<Decimal>,
122 pub nav: Option<Decimal>,
123 pub reason: Option<String>,
124 pub timestamp: i64,
125}