-
Notifications
You must be signed in to change notification settings - Fork 21
/
execute_msg.json
253 lines (253 loc) · 7.4 KB
/
execute_msg.json
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
242
243
244
245
246
247
248
249
250
251
252
253
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"anyOf": [
{
"description": "Update contract config",
"type": "object",
"required": [
"update_config"
],
"properties": {
"update_config": {
"type": "object",
"properties": {
"owner": {
"type": [
"string",
"null"
]
}
}
}
},
"additionalProperties": false
},
{
"description": "Specify parameters to query asset price",
"type": "object",
"required": [
"set_asset"
],
"properties": {
"set_asset": {
"type": "object",
"required": [
"asset",
"price_source"
],
"properties": {
"asset": {
"$ref": "#/definitions/Asset"
},
"price_source": {
"$ref": "#/definitions/PriceSource_for_String"
}
}
}
},
"additionalProperties": false
},
{
"description": "Fetch cumulative prices from Astroport pairs and record in contract storage",
"type": "object",
"required": [
"record_twap_snapshots"
],
"properties": {
"record_twap_snapshots": {
"type": "object",
"required": [
"assets"
],
"properties": {
"assets": {
"type": "array",
"items": {
"$ref": "#/definitions/Asset"
}
}
}
}
},
"additionalProperties": false
}
],
"definitions": {
"Asset": {
"description": "Represents either a native asset or a cw20. Meant to be used as part of a msg in a contract call and not to be used internally",
"anyOf": [
{
"type": "object",
"required": [
"cw20"
],
"properties": {
"cw20": {
"type": "object",
"required": [
"contract_addr"
],
"properties": {
"contract_addr": {
"type": "string"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"native"
],
"properties": {
"native": {
"type": "object",
"required": [
"denom"
],
"properties": {
"denom": {
"type": "string"
}
}
}
},
"additionalProperties": false
}
]
},
"Decimal": {
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
"type": "string"
},
"PriceSource_for_String": {
"anyOf": [
{
"description": "Returns a fixed value; used for UST",
"type": "object",
"required": [
"fixed"
],
"properties": {
"fixed": {
"type": "object",
"required": [
"price"
],
"properties": {
"price": {
"$ref": "#/definitions/Decimal"
}
}
}
},
"additionalProperties": false
},
{
"description": "Native Terra stablecoins transaction rate quoted in UST",
"type": "object",
"required": [
"native"
],
"properties": {
"native": {
"type": "object",
"required": [
"denom"
],
"properties": {
"denom": {
"type": "string"
}
}
}
},
"additionalProperties": false
},
{
"description": "Astroport spot price quoted in UST\n\nNOTE: `pair_address` must point to an astroport pair consists of the asset of intereset and UST",
"type": "object",
"required": [
"astroport_spot"
],
"properties": {
"astroport_spot": {
"type": "object",
"required": [
"pair_address"
],
"properties": {
"pair_address": {
"description": "Address of the Astroport pair",
"type": "string"
}
}
}
},
"additionalProperties": false
},
{
"description": "Astroport TWAP price quoted in UST\n\nNOTE: `pair_address` must point to an astroport pair consists of the asset of intereset and UST",
"type": "object",
"required": [
"astroport_twap"
],
"properties": {
"astroport_twap": {
"type": "object",
"required": [
"pair_address",
"tolerance",
"window_size"
],
"properties": {
"pair_address": {
"description": "Address of the Astroport pair",
"type": "string"
},
"tolerance": {
"description": "When calculating averaged price, we take the most recent TWAP snapshot and find a second snapshot in the range of window_size +/- tolerance. For example, if window size is 5 minutes and tolerance is 1 minute, we look for snapshots that are 4 - 6 minutes back in time from the most recent snapshot.\n\nIf there are multiple snapshots within the range, we take the one that is closest to the desired window size.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"window_size": {
"description": "Address of the asset of interest\n\nNOTE: Spot price in intended for CW20 tokens. Terra native tokens should use Fixed or Native price sources.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
},
"additionalProperties": false
},
{
"description": "Astroport liquidity token\n\nNOTE: Astroport's pair contract does not have a query command to check the address of the LP token associated with a pair. Therefore, we can't implement relevant checks in the contract. The owner must make sure the addresses supplied are accurate",
"type": "object",
"required": [
"astroport_liquidity_token"
],
"properties": {
"astroport_liquidity_token": {
"type": "object",
"required": [
"pair_address"
],
"properties": {
"pair_address": {
"description": "Address of the asset of interest",
"type": "string"
}
}
}
},
"additionalProperties": false
}
]
}
}
}