nibiru_std/proto/buf/
nibiru.spot.v1.rs

1// @generated
2/// Configuration parameters for the pool.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct PoolParams {
6    #[prost(string, tag="1")]
7    pub swap_fee: ::prost::alloc::string::String,
8    #[prost(string, tag="2")]
9    pub exit_fee: ::prost::alloc::string::String,
10    /// Amplification Parameter (A): Larger value of A make the curve better
11    /// resemble a straight line in the center (when pool is near balance).  Highly
12    /// volatile assets should use a lower value, while assets that are closer
13    /// together may be best with a higher value. This is only used if the
14    /// pool_type is set to 1 (stableswap)
15    #[prost(string, tag="3")]
16    pub a: ::prost::alloc::string::String,
17    #[prost(enumeration="PoolType", tag="4")]
18    pub pool_type: i32,
19}
20/// Which assets the pool contains.
21#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct PoolAsset {
24    /// Coins we are talking about,
25    /// the denomination must be unique amongst all PoolAssets for this pool.
26    #[prost(message, optional, tag="1")]
27    pub token: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
28    /// Weight that is not normalized. This weight must be less than 2^50
29    #[prost(string, tag="2")]
30    pub weight: ::prost::alloc::string::String,
31}
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct Pool {
35    /// The pool id.
36    #[prost(uint64, tag="1")]
37    pub id: u64,
38    /// The pool account address.
39    #[prost(string, tag="2")]
40    pub address: ::prost::alloc::string::String,
41    /// Fees and other pool-specific parameters.
42    #[prost(message, optional, tag="3")]
43    pub pool_params: ::core::option::Option<PoolParams>,
44    /// These are assumed to be sorted by denomiation.
45    /// They contain the pool asset and the information about the weight
46    #[prost(message, repeated, tag="4")]
47    pub pool_assets: ::prost::alloc::vec::Vec<PoolAsset>,
48    /// sum of all non-normalized pool weights
49    #[prost(string, tag="5")]
50    pub total_weight: ::prost::alloc::string::String,
51    /// sum of all LP tokens sent out
52    #[prost(message, optional, tag="6")]
53    pub total_shares: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
54}
55/// - `balancer`: Balancer are pools defined by the equation xy=k, extended by
56/// the weighs introduced by Balancer.
57/// - `stableswap`: Stableswap pools are defined by a combination of
58/// constant-product and constant-sum pool
59#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
60#[repr(i32)]
61pub enum PoolType {
62    Balancer = 0,
63    Stableswap = 1,
64}
65impl PoolType {
66    /// String value of the enum field names used in the ProtoBuf definition.
67    ///
68    /// The values are not transformed in any way and thus are considered stable
69    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
70    pub fn as_str_name(&self) -> &'static str {
71        match self {
72            PoolType::Balancer => "BALANCER",
73            PoolType::Stableswap => "STABLESWAP",
74        }
75    }
76    /// Creates an enum from field names used in the ProtoBuf definition.
77    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
78        match value {
79            "BALANCER" => Some(Self::Balancer),
80            "STABLESWAP" => Some(Self::Stableswap),
81            _ => None,
82        }
83    }
84}
85#[allow(clippy::derive_partial_eq_without_eq)]
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct EventPoolCreated {
88    /// the address of the user who created the pool
89    #[prost(string, tag="1")]
90    pub creator: ::prost::alloc::string::String,
91    /// the create pool fee
92    #[prost(message, repeated, tag="2")]
93    pub fees: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
94    /// the final state of the pool
95    #[prost(message, optional, tag="4")]
96    pub final_pool: ::core::option::Option<Pool>,
97    /// the amount of pool shares that the user received
98    #[prost(message, optional, tag="5")]
99    pub final_user_pool_shares: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
100}
101#[allow(clippy::derive_partial_eq_without_eq)]
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct EventPoolJoined {
104    /// the address of the user who joined the pool
105    #[prost(string, tag="1")]
106    pub address: ::prost::alloc::string::String,
107    /// the amount of tokens that the user deposited
108    #[prost(message, repeated, tag="2")]
109    pub tokens_in: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
110    /// the amount of pool shares that the user received
111    #[prost(message, optional, tag="3")]
112    pub pool_shares_out: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
113    /// the amount of tokens remaining for the user
114    #[prost(message, repeated, tag="4")]
115    pub rem_coins: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
116    /// the final state of the pool
117    #[prost(message, optional, tag="5")]
118    pub final_pool: ::core::option::Option<Pool>,
119    /// the final amount of user pool shares
120    #[prost(message, optional, tag="6")]
121    pub final_user_pool_shares: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
122}
123#[allow(clippy::derive_partial_eq_without_eq)]
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct EventPoolExited {
126    /// the address of the user who exited the pool
127    #[prost(string, tag="1")]
128    pub address: ::prost::alloc::string::String,
129    /// the amount of pool shares that the user exited with
130    #[prost(message, optional, tag="2")]
131    pub pool_shares_in: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
132    /// the amount of tokens returned to the user
133    #[prost(message, repeated, tag="3")]
134    pub tokens_out: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
135    /// the amount of fees collected by the pool
136    #[prost(message, repeated, tag="4")]
137    pub fees: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
138    /// the final state of the pool
139    #[prost(message, optional, tag="5")]
140    pub final_pool: ::core::option::Option<Pool>,
141    /// the final amount of user pool shares
142    #[prost(message, optional, tag="6")]
143    pub final_user_pool_shares: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
144}
145#[allow(clippy::derive_partial_eq_without_eq)]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct EventAssetsSwapped {
148    /// the address of the user who swapped tokens
149    #[prost(string, tag="1")]
150    pub address: ::prost::alloc::string::String,
151    /// the amount of tokens that the user deposited
152    #[prost(message, optional, tag="2")]
153    pub token_in: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
154    /// the amount of tokens that the user received
155    #[prost(message, optional, tag="3")]
156    pub token_out: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
157    /// the amount of fees collected by the pool
158    #[prost(message, optional, tag="4")]
159    pub fee: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
160    /// the final state of the pool
161    #[prost(message, optional, tag="5")]
162    pub final_pool: ::core::option::Option<Pool>,
163}
164/// Params defines the parameters for the module.
165#[allow(clippy::derive_partial_eq_without_eq)]
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct Params {
168    /// The start pool number, i.e. the first pool number that isn't taken yet.
169    #[prost(uint64, tag="1")]
170    pub starting_pool_number: u64,
171    /// The cost of creating a pool, taken from the pool creator's account.
172    #[prost(message, repeated, tag="2")]
173    pub pool_creation_fee: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
174    /// The assets that can be used to create liquidity pools
175    #[prost(string, repeated, tag="3")]
176    pub whitelisted_asset: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
177}
178/// GenesisState defines the spot module's genesis state.
179#[allow(clippy::derive_partial_eq_without_eq)]
180#[derive(Clone, PartialEq, ::prost::Message)]
181pub struct GenesisState {
182    /// params defines all the parameters of the module.
183    #[prost(message, optional, tag="1")]
184    pub params: ::core::option::Option<Params>,
185    /// pools defines all the pools of the module.
186    #[prost(message, repeated, tag="2")]
187    pub pools: ::prost::alloc::vec::Vec<Pool>,
188}
189/// QueryParamsRequest is request type for the Query/Params RPC method.
190#[allow(clippy::derive_partial_eq_without_eq)]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct QueryParamsRequest {
193}
194/// QueryParamsResponse is response type for the Query/Params RPC method.
195#[allow(clippy::derive_partial_eq_without_eq)]
196#[derive(Clone, PartialEq, ::prost::Message)]
197pub struct QueryParamsResponse {
198    /// params holds all the parameters of this module.
199    #[prost(message, optional, tag="1")]
200    pub params: ::core::option::Option<Params>,
201}
202#[allow(clippy::derive_partial_eq_without_eq)]
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct QueryPoolNumberRequest {
205}
206#[allow(clippy::derive_partial_eq_without_eq)]
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct QueryPoolNumberResponse {
209    #[prost(uint64, tag="1")]
210    pub pool_id: u64,
211}
212#[allow(clippy::derive_partial_eq_without_eq)]
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct QueryPoolRequest {
215    #[prost(uint64, tag="1")]
216    pub pool_id: u64,
217}
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct QueryPoolResponse {
221    #[prost(message, optional, tag="1")]
222    pub pool: ::core::option::Option<Pool>,
223}
224#[allow(clippy::derive_partial_eq_without_eq)]
225#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct QueryPoolsRequest {
227    /// pagination defines an optional pagination for the request.
228    #[prost(message, optional, tag="1")]
229    pub pagination: ::core::option::Option<crate::proto::cosmos::base::query::v1beta1::PageRequest>,
230}
231#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct QueryPoolsResponse {
234    #[prost(message, repeated, tag="1")]
235    pub pools: ::prost::alloc::vec::Vec<Pool>,
236    /// pagination defines the pagination in the response.
237    #[prost(message, optional, tag="2")]
238    pub pagination: ::core::option::Option<crate::proto::cosmos::base::query::v1beta1::PageResponse>,
239}
240#[allow(clippy::derive_partial_eq_without_eq)]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct QueryPoolParamsRequest {
243    #[prost(uint64, tag="1")]
244    pub pool_id: u64,
245}
246#[allow(clippy::derive_partial_eq_without_eq)]
247#[derive(Clone, PartialEq, ::prost::Message)]
248pub struct QueryPoolParamsResponse {
249    #[prost(message, optional, tag="1")]
250    pub pool_params: ::core::option::Option<PoolParams>,
251}
252#[allow(clippy::derive_partial_eq_without_eq)]
253#[derive(Clone, PartialEq, ::prost::Message)]
254pub struct QueryNumPoolsRequest {
255}
256#[allow(clippy::derive_partial_eq_without_eq)]
257#[derive(Clone, PartialEq, ::prost::Message)]
258pub struct QueryNumPoolsResponse {
259    #[prost(uint64, tag="1")]
260    pub num_pools: u64,
261}
262/// --------------------------------------------
263/// Query total liquidity the protocol
264#[allow(clippy::derive_partial_eq_without_eq)]
265#[derive(Clone, PartialEq, ::prost::Message)]
266pub struct QueryTotalLiquidityRequest {
267}
268#[allow(clippy::derive_partial_eq_without_eq)]
269#[derive(Clone, PartialEq, ::prost::Message)]
270pub struct QueryTotalLiquidityResponse {
271    #[prost(message, repeated, tag="1")]
272    pub liquidity: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
273}
274/// --------------------------------------------
275/// Query total liquidity for a pool
276#[allow(clippy::derive_partial_eq_without_eq)]
277#[derive(Clone, PartialEq, ::prost::Message)]
278pub struct QueryTotalPoolLiquidityRequest {
279    #[prost(uint64, tag="1")]
280    pub pool_id: u64,
281}
282#[allow(clippy::derive_partial_eq_without_eq)]
283#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct QueryTotalPoolLiquidityResponse {
285    #[prost(message, repeated, tag="1")]
286    pub liquidity: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
287}
288#[allow(clippy::derive_partial_eq_without_eq)]
289#[derive(Clone, PartialEq, ::prost::Message)]
290pub struct QueryTotalSharesRequest {
291    #[prost(uint64, tag="1")]
292    pub pool_id: u64,
293}
294#[allow(clippy::derive_partial_eq_without_eq)]
295#[derive(Clone, PartialEq, ::prost::Message)]
296pub struct QueryTotalSharesResponse {
297    /// sum of all LP tokens sent out
298    #[prost(message, optional, tag="1")]
299    pub total_shares: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
300}
301/// Returns the amount of tokenInDenom to produce 1 tokenOutDenom
302/// For example, if the price of NIBI = 9.123 NUSD, then setting
303/// tokenInDenom=NUSD and tokenOutDenom=NIBI would give "9.123".
304#[allow(clippy::derive_partial_eq_without_eq)]
305#[derive(Clone, PartialEq, ::prost::Message)]
306pub struct QuerySpotPriceRequest {
307    #[prost(uint64, tag="1")]
308    pub pool_id: u64,
309    /// the denomination of the token you are giving into the pool
310    #[prost(string, tag="2")]
311    pub token_in_denom: ::prost::alloc::string::String,
312    /// the denomination of the token you are taking out of the pool
313    #[prost(string, tag="3")]
314    pub token_out_denom: ::prost::alloc::string::String,
315}
316#[allow(clippy::derive_partial_eq_without_eq)]
317#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct QuerySpotPriceResponse {
319    #[prost(string, tag="1")]
320    pub spot_price: ::prost::alloc::string::String,
321}
322/// Given an exact amount of tokens in and a target tokenOutDenom, calculates
323/// the expected amount of tokens out received from a swap.
324#[allow(clippy::derive_partial_eq_without_eq)]
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct QuerySwapExactAmountInRequest {
327    #[prost(uint64, tag="1")]
328    pub pool_id: u64,
329    #[prost(message, optional, tag="2")]
330    pub token_in: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
331    #[prost(string, tag="3")]
332    pub token_out_denom: ::prost::alloc::string::String,
333}
334#[allow(clippy::derive_partial_eq_without_eq)]
335#[derive(Clone, PartialEq, ::prost::Message)]
336pub struct QuerySwapExactAmountInResponse {
337    #[prost(message, optional, tag="2")]
338    pub token_out: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
339    #[prost(message, optional, tag="3")]
340    pub fee: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
341}
342/// Given an exact amount of tokens out and a target tokenInDenom, calculates
343/// the expected amount of tokens in required to do the swap.
344#[allow(clippy::derive_partial_eq_without_eq)]
345#[derive(Clone, PartialEq, ::prost::Message)]
346pub struct QuerySwapExactAmountOutRequest {
347    #[prost(uint64, tag="1")]
348    pub pool_id: u64,
349    #[prost(message, optional, tag="2")]
350    pub token_out: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
351    #[prost(string, tag="3")]
352    pub token_in_denom: ::prost::alloc::string::String,
353}
354#[allow(clippy::derive_partial_eq_without_eq)]
355#[derive(Clone, PartialEq, ::prost::Message)]
356pub struct QuerySwapExactAmountOutResponse {
357    #[prost(message, optional, tag="2")]
358    pub token_in: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
359}
360#[allow(clippy::derive_partial_eq_without_eq)]
361#[derive(Clone, PartialEq, ::prost::Message)]
362pub struct QueryJoinExactAmountInRequest {
363    #[prost(uint64, tag="1")]
364    pub pool_id: u64,
365    #[prost(message, repeated, tag="2")]
366    pub tokens_in: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
367}
368#[allow(clippy::derive_partial_eq_without_eq)]
369#[derive(Clone, PartialEq, ::prost::Message)]
370pub struct QueryJoinExactAmountInResponse {
371    /// amount of pool shares returned to user after join
372    #[prost(string, tag="1")]
373    pub pool_shares_out: ::prost::alloc::string::String,
374    /// coins remaining after pool join
375    #[prost(message, repeated, tag="2")]
376    pub rem_coins: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
377}
378#[allow(clippy::derive_partial_eq_without_eq)]
379#[derive(Clone, PartialEq, ::prost::Message)]
380pub struct QueryJoinExactAmountOutRequest {
381    #[prost(uint64, tag="1")]
382    pub pool_id: u64,
383}
384#[allow(clippy::derive_partial_eq_without_eq)]
385#[derive(Clone, PartialEq, ::prost::Message)]
386pub struct QueryJoinExactAmountOutResponse {
387}
388#[allow(clippy::derive_partial_eq_without_eq)]
389#[derive(Clone, PartialEq, ::prost::Message)]
390pub struct QueryExitExactAmountInRequest {
391    #[prost(uint64, tag="1")]
392    pub pool_id: u64,
393    /// amount of pool shares to return to pool
394    #[prost(string, tag="2")]
395    pub pool_shares_in: ::prost::alloc::string::String,
396}
397#[allow(clippy::derive_partial_eq_without_eq)]
398#[derive(Clone, PartialEq, ::prost::Message)]
399pub struct QueryExitExactAmountInResponse {
400    /// coins obtained after exiting
401    #[prost(message, repeated, tag="1")]
402    pub tokens_out: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
403    #[prost(message, repeated, tag="2")]
404    pub fees: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
405}
406#[allow(clippy::derive_partial_eq_without_eq)]
407#[derive(Clone, PartialEq, ::prost::Message)]
408pub struct QueryExitExactAmountOutRequest {
409    #[prost(uint64, tag="1")]
410    pub pool_id: u64,
411}
412#[allow(clippy::derive_partial_eq_without_eq)]
413#[derive(Clone, PartialEq, ::prost::Message)]
414pub struct QueryExitExactAmountOutResponse {
415}
416#[allow(clippy::derive_partial_eq_without_eq)]
417#[derive(Clone, PartialEq, ::prost::Message)]
418pub struct MsgCreatePool {
419    #[prost(string, tag="1")]
420    pub creator: ::prost::alloc::string::String,
421    #[prost(message, optional, tag="2")]
422    pub pool_params: ::core::option::Option<PoolParams>,
423    #[prost(message, repeated, tag="3")]
424    pub pool_assets: ::prost::alloc::vec::Vec<PoolAsset>,
425}
426#[allow(clippy::derive_partial_eq_without_eq)]
427#[derive(Clone, PartialEq, ::prost::Message)]
428pub struct MsgCreatePoolResponse {
429    #[prost(uint64, tag="1")]
430    pub pool_id: u64,
431}
432///
433/// Message to join a pool (identified by poolId) with a set of tokens to deposit.
434#[allow(clippy::derive_partial_eq_without_eq)]
435#[derive(Clone, PartialEq, ::prost::Message)]
436pub struct MsgJoinPool {
437    #[prost(string, tag="1")]
438    pub sender: ::prost::alloc::string::String,
439    #[prost(uint64, tag="2")]
440    pub pool_id: u64,
441    #[prost(message, repeated, tag="3")]
442    pub tokens_in: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
443    #[prost(bool, tag="4")]
444    pub use_all_coins: bool,
445}
446///
447/// Response when a user joins a pool.
448#[allow(clippy::derive_partial_eq_without_eq)]
449#[derive(Clone, PartialEq, ::prost::Message)]
450pub struct MsgJoinPoolResponse {
451    /// the final state of the pool after a join
452    #[prost(message, optional, tag="1")]
453    pub pool: ::core::option::Option<Pool>,
454    /// sum of LP tokens minted from the join
455    #[prost(message, optional, tag="2")]
456    pub num_pool_shares_out: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
457    /// remaining tokens from attempting to join the pool
458    #[prost(message, repeated, tag="3")]
459    pub remaining_coins: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
460}
461#[allow(clippy::derive_partial_eq_without_eq)]
462#[derive(Clone, PartialEq, ::prost::Message)]
463pub struct MsgExitPool {
464    #[prost(string, tag="1")]
465    pub sender: ::prost::alloc::string::String,
466    #[prost(uint64, tag="2")]
467    pub pool_id: u64,
468    #[prost(message, optional, tag="3")]
469    pub pool_shares: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
470}
471#[allow(clippy::derive_partial_eq_without_eq)]
472#[derive(Clone, PartialEq, ::prost::Message)]
473pub struct MsgExitPoolResponse {
474    #[prost(message, repeated, tag="3")]
475    pub tokens_out: ::prost::alloc::vec::Vec<crate::proto::cosmos::base::v1beta1::Coin>,
476}
477#[allow(clippy::derive_partial_eq_without_eq)]
478#[derive(Clone, PartialEq, ::prost::Message)]
479pub struct MsgSwapAssets {
480    #[prost(string, tag="1")]
481    pub sender: ::prost::alloc::string::String,
482    #[prost(uint64, tag="2")]
483    pub pool_id: u64,
484    #[prost(message, optional, tag="3")]
485    pub token_in: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
486    #[prost(string, tag="4")]
487    pub token_out_denom: ::prost::alloc::string::String,
488}
489#[allow(clippy::derive_partial_eq_without_eq)]
490#[derive(Clone, PartialEq, ::prost::Message)]
491pub struct MsgSwapAssetsResponse {
492    #[prost(message, optional, tag="3")]
493    pub token_out: ::core::option::Option<crate::proto::cosmos::base::v1beta1::Coin>,
494}
495// @@protoc_insertion_point(module)