1+ import { Coin } from '@interchainjs/cosmos-types/types' ;
2+
3+ export interface Pool {
4+ $typeUrl ?: string ;
5+ address : string ;
6+ id : bigint ;
7+ poolParams : PoolParams ;
8+ /**
9+ * This string specifies who will govern the pool in the future.
10+ * Valid forms of this are:
11+ * {token name},{duration}
12+ * {duration}
13+ * where {token name} if specified is the token which determines the
14+ * governor, and if not specified is the LP token for this pool.duration is
15+ * a time specified as 0w,1w,2w, etc. which specifies how long the token
16+ * would need to be locked up to count in governance. 0w means no lockup.
17+ * TODO: Further improve these docs
18+ */
19+ futurePoolGovernor : string ;
20+ /** sum of all LP tokens sent out */
21+ totalShares : Coin ;
22+ /**
23+ * These are assumed to be sorted by denomiation.
24+ * They contain the pool asset and the information about the weight
25+ */
26+ poolAssets : PoolAsset [ ] ;
27+ /** sum of all non-normalized pool weights */
28+ totalWeight : string ;
29+ }
30+
31+ interface PoolParams {
32+ swapFee : string ;
33+ /**
34+ * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old
35+ * pools can maintain a non-zero fee. No new pool can be created with non-zero
36+ * fee anymore
37+ */
38+ exitFee : string ;
39+ smoothWeightChangeParams ?: SmoothWeightChangeParams ;
40+ }
41+
42+ interface SmoothWeightChangeParams {
43+ /**
44+ * The start time for beginning the weight change.
45+ * If a parameter change / pool instantiation leaves this blank,
46+ * it should be generated by the state_machine as the current time.
47+ */
48+ startTime : Date ;
49+ /** Duration for the weights to change over */
50+ duration : Duration ;
51+ /**
52+ * The initial pool weights. These are copied from the pool's settings
53+ * at the time of weight change instantiation.
54+ * The amount PoolAsset.token.amount field is ignored if present,
55+ * future type refactorings should just have a type with the denom & weight
56+ * here.
57+ */
58+ initialPoolWeights : PoolAsset [ ] ;
59+ /**
60+ * The target pool weights. The pool weights will change linearly with respect
61+ * to time between start_time, and start_time + duration. The amount
62+ * PoolAsset.token.amount field is ignored if present, future type
63+ * refactorings should just have a type with the denom & weight here.
64+ */
65+ targetPoolWeights : PoolAsset [ ] ;
66+ }
67+
68+ interface Duration {
69+ /**
70+ * Signed seconds of the span of time. Must be from -315,576,000,000
71+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
72+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
73+ */
74+ seconds : bigint ;
75+ /**
76+ * Signed fractions of a second at nanosecond resolution of the span
77+ * of time. Durations less than one second are represented with a 0
78+ * `seconds` field and a positive or negative `nanos` field. For durations
79+ * of one second or more, a non-zero value for the `nanos` field must be
80+ * of the same sign as the `seconds` field. Must be from -999,999,999
81+ * to +999,999,999 inclusive.
82+ */
83+ nanos : number ;
84+ }
85+
86+ interface PoolAsset {
87+ /**
88+ * Coins we are talking about,
89+ * the denomination must be unique amongst all PoolAssets for this pool.
90+ */
91+ token : Coin ;
92+ /** Weight that is not normalized. This weight must be less than 2^50 */
93+ weight : string ;
94+ }
0 commit comments