@coffer_so/sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +283 -0
- package/dist/clients/AdminClient.d.ts +194 -0
- package/dist/clients/AdminClient.d.ts.map +1 -0
- package/dist/clients/AdminClient.js +482 -0
- package/dist/clients/AdminClient.js.map +1 -0
- package/dist/clients/CofferBackendClient.d.ts +877 -0
- package/dist/clients/CofferBackendClient.d.ts.map +1 -0
- package/dist/clients/CofferBackendClient.js +536 -0
- package/dist/clients/CofferBackendClient.js.map +1 -0
- package/dist/clients/CubeBackendClient.d.ts +877 -0
- package/dist/clients/CubeBackendClient.d.ts.map +1 -0
- package/dist/clients/CubeBackendClient.js +536 -0
- package/dist/clients/CubeBackendClient.js.map +1 -0
- package/dist/clients/CubicPoolClient.d.ts +120 -0
- package/dist/clients/CubicPoolClient.d.ts.map +1 -0
- package/dist/clients/CubicPoolClient.js +687 -0
- package/dist/clients/CubicPoolClient.js.map +1 -0
- package/dist/clients/PoolFactoryClient.d.ts +53 -0
- package/dist/clients/PoolFactoryClient.d.ts.map +1 -0
- package/dist/clients/PoolFactoryClient.js +91 -0
- package/dist/clients/PoolFactoryClient.js.map +1 -0
- package/dist/clients/RpcClient.d.ts +49 -0
- package/dist/clients/RpcClient.d.ts.map +1 -0
- package/dist/clients/RpcClient.js +135 -0
- package/dist/clients/RpcClient.js.map +1 -0
- package/dist/clients/SingleTokenDepositClient.d.ts +67 -0
- package/dist/clients/SingleTokenDepositClient.d.ts.map +1 -0
- package/dist/clients/SingleTokenDepositClient.js +105 -0
- package/dist/clients/SingleTokenDepositClient.js.map +1 -0
- package/dist/clients/contract-instructions.d.ts +24 -0
- package/dist/clients/contract-instructions.d.ts.map +1 -0
- package/dist/clients/contract-instructions.js +130 -0
- package/dist/clients/contract-instructions.js.map +1 -0
- package/dist/clients/index.d.ts +10 -0
- package/dist/clients/index.d.ts.map +1 -0
- package/dist/clients/index.js +26 -0
- package/dist/clients/index.js.map +1 -0
- package/dist/clients/quote-math.d.ts +15 -0
- package/dist/clients/quote-math.d.ts.map +1 -0
- package/dist/clients/quote-math.js +98 -0
- package/dist/clients/quote-math.js.map +1 -0
- package/dist/clients/tx-builders.d.ts +231 -0
- package/dist/clients/tx-builders.d.ts.map +1 -0
- package/dist/clients/tx-builders.js +861 -0
- package/dist/clients/tx-builders.js.map +1 -0
- package/dist/clients/versioned.d.ts +34 -0
- package/dist/clients/versioned.d.ts.map +1 -0
- package/dist/clients/versioned.js +55 -0
- package/dist/clients/versioned.js.map +1 -0
- package/dist/config/index.d.ts +65 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +75 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/networks.d.ts +12 -0
- package/dist/config/networks.d.ts.map +1 -0
- package/dist/config/networks.js +51 -0
- package/dist/config/networks.js.map +1 -0
- package/dist/config/tokens.d.ts +19 -0
- package/dist/config/tokens.d.ts.map +1 -0
- package/dist/config/tokens.js +43 -0
- package/dist/config/tokens.js.map +1 -0
- package/dist/idl/cubic_pool.json +4203 -0
- package/dist/idl/index.d.ts +1769 -0
- package/dist/idl/index.d.ts.map +1 -0
- package/dist/idl/index.js +18 -0
- package/dist/idl/index.js.map +1 -0
- package/dist/idl/protocol_admin.json +2615 -0
- package/dist/idl/single_token_liquidity.json +1121 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +206 -0
- package/dist/index.js.map +1 -0
- package/dist/math/cubicMath.d.ts +40 -0
- package/dist/math/cubicMath.d.ts.map +1 -0
- package/dist/math/cubicMath.js +82 -0
- package/dist/math/cubicMath.js.map +1 -0
- package/dist/math/fixedPoint.d.ts +19 -0
- package/dist/math/fixedPoint.d.ts.map +1 -0
- package/dist/math/fixedPoint.js +86 -0
- package/dist/math/fixedPoint.js.map +1 -0
- package/dist/math/index.d.ts +9 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/math/index.js +30 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/logExp.d.ts +6 -0
- package/dist/math/logExp.d.ts.map +1 -0
- package/dist/math/logExp.js +68 -0
- package/dist/math/logExp.js.map +1 -0
- package/dist/math/lpLoss.d.ts +44 -0
- package/dist/math/lpLoss.d.ts.map +1 -0
- package/dist/math/lpLoss.js +103 -0
- package/dist/math/lpLoss.js.map +1 -0
- package/dist/math/maxSelloff.d.ts +164 -0
- package/dist/math/maxSelloff.d.ts.map +1 -0
- package/dist/math/maxSelloff.js +397 -0
- package/dist/math/maxSelloff.js.map +1 -0
- package/dist/math/singleToken.d.ts +54 -0
- package/dist/math/singleToken.d.ts.map +1 -0
- package/dist/math/singleToken.js +188 -0
- package/dist/math/singleToken.js.map +1 -0
- package/dist/math/slippage.d.ts +13 -0
- package/dist/math/slippage.d.ts.map +1 -0
- package/dist/math/slippage.js +44 -0
- package/dist/math/slippage.js.map +1 -0
- package/dist/math/surgeFee.d.ts +24 -0
- package/dist/math/surgeFee.d.ts.map +1 -0
- package/dist/math/surgeFee.js +85 -0
- package/dist/math/surgeFee.js.map +1 -0
- package/dist/math/weightedMath.d.ts +20 -0
- package/dist/math/weightedMath.d.ts.map +1 -0
- package/dist/math/weightedMath.js +66 -0
- package/dist/math/weightedMath.js.map +1 -0
- package/dist/parsers/borsh.d.ts +28 -0
- package/dist/parsers/borsh.d.ts.map +1 -0
- package/dist/parsers/borsh.js +104 -0
- package/dist/parsers/borsh.js.map +1 -0
- package/dist/parsers/contracts.d.ts +26 -0
- package/dist/parsers/contracts.d.ts.map +1 -0
- package/dist/parsers/contracts.js +62 -0
- package/dist/parsers/contracts.js.map +1 -0
- package/dist/parsers/events.d.ts +3 -0
- package/dist/parsers/events.d.ts.map +1 -0
- package/dist/parsers/events.js +281 -0
- package/dist/parsers/events.js.map +1 -0
- package/dist/parsers/index.d.ts +6 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +22 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/mintAccount.d.ts +24 -0
- package/dist/parsers/mintAccount.d.ts.map +1 -0
- package/dist/parsers/mintAccount.js +27 -0
- package/dist/parsers/mintAccount.js.map +1 -0
- package/dist/parsers/poolAccount.d.ts +141 -0
- package/dist/parsers/poolAccount.d.ts.map +1 -0
- package/dist/parsers/poolAccount.js +224 -0
- package/dist/parsers/poolAccount.js.map +1 -0
- package/dist/types/contracts.d.ts +1340 -0
- package/dist/types/contracts.d.ts.map +1 -0
- package/dist/types/contracts.js +3 -0
- package/dist/types/contracts.js.map +1 -0
- package/dist/types/events.d.ts +172 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +3 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +22 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/pool.d.ts +149 -0
- package/dist/types/pool.d.ts.map +1 -0
- package/dist/types/pool.js +3 -0
- package/dist/types/pool.js.map +1 -0
- package/dist/types/result.d.ts +24 -0
- package/dist/types/result.d.ts.map +1 -0
- package/dist/types/result.js +11 -0
- package/dist/types/result.js.map +1 -0
- package/dist/types/tx.d.ts +261 -0
- package/dist/types/tx.d.ts.map +1 -0
- package/dist/types/tx.js +3 -0
- package/dist/types/tx.js.map +1 -0
- package/dist/utils/errors.d.ts +44 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +192 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/extensions.d.ts +98 -0
- package/dist/utils/extensions.d.ts.map +1 -0
- package/dist/utils/extensions.js +187 -0
- package/dist/utils/extensions.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +21 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/pda.d.ts +8 -0
- package/dist/utils/pda.d.ts.map +1 -0
- package/dist/utils/pda.js +27 -0
- package/dist/utils/pda.js.map +1 -0
- package/dist/utils/retry.d.ts +22 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +62 -0
- package/dist/utils/retry.js.map +1 -0
- package/package.json +54 -0
- package/src/clients/AdminClient.ts +608 -0
- package/src/clients/CofferBackendClient.ts +1413 -0
- package/src/clients/CubicPoolClient.ts +719 -0
- package/src/clients/PoolFactoryClient.ts +110 -0
- package/src/clients/RpcClient.ts +195 -0
- package/src/clients/SingleTokenDepositClient.ts +143 -0
- package/src/clients/contract-instructions.ts +115 -0
- package/src/clients/index.ts +9 -0
- package/src/clients/quote-math.ts +81 -0
- package/src/clients/tx-builders.ts +1096 -0
- package/src/clients/versioned.ts +80 -0
- package/src/config/index.ts +111 -0
- package/src/config/networks.ts +71 -0
- package/src/config/tokens.ts +52 -0
- package/src/idl/cubic_pool.json +4203 -0
- package/src/idl/index.ts +13 -0
- package/src/idl/protocol_admin.json +2615 -0
- package/src/idl/single_token_liquidity.json +1121 -0
- package/src/index.ts +262 -0
- package/src/math/cubicMath.ts +92 -0
- package/src/math/fixedPoint.ts +71 -0
- package/src/math/index.ts +13 -0
- package/src/math/logExp.ts +61 -0
- package/src/math/lpLoss.ts +160 -0
- package/src/math/maxSelloff.ts +564 -0
- package/src/math/singleToken.ts +251 -0
- package/src/math/slippage.ts +38 -0
- package/src/math/surgeFee.ts +101 -0
- package/src/math/weightedMath.ts +64 -0
- package/src/parsers/borsh.ts +106 -0
- package/src/parsers/contracts.ts +64 -0
- package/src/parsers/events.ts +275 -0
- package/src/parsers/index.ts +5 -0
- package/src/parsers/mintAccount.ts +44 -0
- package/src/parsers/poolAccount.ts +372 -0
- package/src/types/contracts.ts +238 -0
- package/src/types/events.ts +198 -0
- package/src/types/index.ts +5 -0
- package/src/types/pool.ts +147 -0
- package/src/types/result.ts +51 -0
- package/src/types/tx.ts +278 -0
- package/src/utils/errors.ts +210 -0
- package/src/utils/extensions.ts +196 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/pda.ts +58 -0
- package/src/utils/retry.ts +85 -0
|
@@ -0,0 +1,4203 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "8iQtGj9mcUfFUGaiCpPy89swC3s8YTC8FhVZWfgeZhwu",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "cubic_pool",
|
|
5
|
+
"version": "0.5.1",
|
|
6
|
+
"spec": "0.1.0",
|
|
7
|
+
"description": "Cubic Pool DEX - Multi-pool DEX with virtual liquidity and leverage logic"
|
|
8
|
+
},
|
|
9
|
+
"instructions": [
|
|
10
|
+
{
|
|
11
|
+
"name": "accept_pool_admin_transfer",
|
|
12
|
+
"docs": [
|
|
13
|
+
"Step 2 — pending admin claims."
|
|
14
|
+
],
|
|
15
|
+
"discriminator": [
|
|
16
|
+
155,
|
|
17
|
+
46,
|
|
18
|
+
127,
|
|
19
|
+
94,
|
|
20
|
+
247,
|
|
21
|
+
5,
|
|
22
|
+
46,
|
|
23
|
+
184
|
|
24
|
+
],
|
|
25
|
+
"accounts": [
|
|
26
|
+
{
|
|
27
|
+
"name": "pool",
|
|
28
|
+
"writable": true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "new_admin",
|
|
32
|
+
"signer": true
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"args": []
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "accept_protocol_admin_transfer",
|
|
39
|
+
"docs": [
|
|
40
|
+
"Step 2 — pending admin claims."
|
|
41
|
+
],
|
|
42
|
+
"discriminator": [
|
|
43
|
+
109,
|
|
44
|
+
70,
|
|
45
|
+
85,
|
|
46
|
+
195,
|
|
47
|
+
244,
|
|
48
|
+
39,
|
|
49
|
+
244,
|
|
50
|
+
102
|
|
51
|
+
],
|
|
52
|
+
"accounts": [
|
|
53
|
+
{
|
|
54
|
+
"name": "config",
|
|
55
|
+
"writable": true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "new_admin",
|
|
59
|
+
"signer": true
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"args": []
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "add_liquidity",
|
|
66
|
+
"docs": [
|
|
67
|
+
"Add proportional liquidity and mint BPT to the user.",
|
|
68
|
+
"",
|
|
69
|
+
"# Parameters",
|
|
70
|
+
"* `token_amounts` — per-token deposit amounts in pool order.",
|
|
71
|
+
"* `minimum_bpt_amount`— slippage floor on BPT received.",
|
|
72
|
+
"",
|
|
73
|
+
"# Used by",
|
|
74
|
+
"User wallets, single-token-liquidity helper."
|
|
75
|
+
],
|
|
76
|
+
"discriminator": [
|
|
77
|
+
181,
|
|
78
|
+
157,
|
|
79
|
+
89,
|
|
80
|
+
67,
|
|
81
|
+
143,
|
|
82
|
+
182,
|
|
83
|
+
52,
|
|
84
|
+
72
|
|
85
|
+
],
|
|
86
|
+
"accounts": [
|
|
87
|
+
{
|
|
88
|
+
"name": "pool",
|
|
89
|
+
"writable": true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "bpt_mint",
|
|
93
|
+
"writable": true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "user_bpt_account",
|
|
97
|
+
"writable": true
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "user",
|
|
101
|
+
"signer": true
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "token_program",
|
|
105
|
+
"docs": [
|
|
106
|
+
"Token program for the BPT mint (same one used for `bpt_mint`).",
|
|
107
|
+
"Per-token programs come via `remaining_accounts` because each",
|
|
108
|
+
"pool token may use a different program."
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"args": [
|
|
113
|
+
{
|
|
114
|
+
"name": "token_amounts",
|
|
115
|
+
"type": {
|
|
116
|
+
"vec": "u64"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "minimum_bpt_amount",
|
|
121
|
+
"type": "u64"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "cancel_pool_admin_transfer",
|
|
127
|
+
"docs": [
|
|
128
|
+
"Cancel a pending pool-admin transfer."
|
|
129
|
+
],
|
|
130
|
+
"discriminator": [
|
|
131
|
+
151,
|
|
132
|
+
135,
|
|
133
|
+
205,
|
|
134
|
+
125,
|
|
135
|
+
93,
|
|
136
|
+
160,
|
|
137
|
+
135,
|
|
138
|
+
143
|
|
139
|
+
],
|
|
140
|
+
"accounts": [
|
|
141
|
+
{
|
|
142
|
+
"name": "pool",
|
|
143
|
+
"writable": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "authority",
|
|
147
|
+
"signer": true
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"args": []
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "cancel_protocol_admin_transfer",
|
|
154
|
+
"docs": [
|
|
155
|
+
"Cancel a pending protocol-admin transfer."
|
|
156
|
+
],
|
|
157
|
+
"discriminator": [
|
|
158
|
+
183,
|
|
159
|
+
26,
|
|
160
|
+
130,
|
|
161
|
+
6,
|
|
162
|
+
131,
|
|
163
|
+
36,
|
|
164
|
+
32,
|
|
165
|
+
186
|
|
166
|
+
],
|
|
167
|
+
"accounts": [
|
|
168
|
+
{
|
|
169
|
+
"name": "config",
|
|
170
|
+
"writable": true
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "authority",
|
|
174
|
+
"signer": true
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"args": []
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "collect_protocol_fees",
|
|
181
|
+
"docs": [
|
|
182
|
+
"Sweep `protocol_fees_owed` for every token to caller-supplied",
|
|
183
|
+
"recipients and zero the counters.",
|
|
184
|
+
"",
|
|
185
|
+
"# Authority",
|
|
186
|
+
"`protocol_admin` AND Treasury PDA.",
|
|
187
|
+
"",
|
|
188
|
+
"# remaining_accounts",
|
|
189
|
+
"`[vault_i, recipient_i, token_program_i]` per token.",
|
|
190
|
+
"",
|
|
191
|
+
"# Used by",
|
|
192
|
+
"`protocol_admin::pool_collect_protocol_fees` (CPI)."
|
|
193
|
+
],
|
|
194
|
+
"discriminator": [
|
|
195
|
+
22,
|
|
196
|
+
67,
|
|
197
|
+
23,
|
|
198
|
+
98,
|
|
199
|
+
150,
|
|
200
|
+
178,
|
|
201
|
+
70,
|
|
202
|
+
220
|
|
203
|
+
],
|
|
204
|
+
"accounts": [
|
|
205
|
+
{
|
|
206
|
+
"name": "config"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "pool",
|
|
210
|
+
"writable": true
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "authority",
|
|
214
|
+
"signer": true
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"args": []
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "debug_withdraw_liquidity",
|
|
221
|
+
"docs": [
|
|
222
|
+
"Emergency drain — pool becomes BRICKED.",
|
|
223
|
+
"",
|
|
224
|
+
"`actual_balances` and `virtual_balances` are intentionally NOT",
|
|
225
|
+
"updated. Once vaults are drained out-of-band the invariant math",
|
|
226
|
+
"is meaningless, so the pool MUST stay `pool_enabled = false`",
|
|
227
|
+
"forever. Re-enabling would let users swap/join against stale",
|
|
228
|
+
"state and extract value at LP / protocol expense.",
|
|
229
|
+
"",
|
|
230
|
+
"# Authority",
|
|
231
|
+
"`protocol_admin` AND Treasury PDA.",
|
|
232
|
+
"",
|
|
233
|
+
"# Prerequisites",
|
|
234
|
+
"`pool.pool_enabled == false` (handler enforces).",
|
|
235
|
+
"",
|
|
236
|
+
"# Parameters",
|
|
237
|
+
"* `token_amounts` — per-token withdraw amounts (use 0 to skip).",
|
|
238
|
+
"",
|
|
239
|
+
"# Used by",
|
|
240
|
+
"`protocol_admin::pool_debug_withdraw_liquidity` (CPI),",
|
|
241
|
+
"driven by `admin-panel/03-emergency-withdraw.ts`."
|
|
242
|
+
],
|
|
243
|
+
"discriminator": [
|
|
244
|
+
139,
|
|
245
|
+
40,
|
|
246
|
+
126,
|
|
247
|
+
103,
|
|
248
|
+
199,
|
|
249
|
+
34,
|
|
250
|
+
143,
|
|
251
|
+
137
|
|
252
|
+
],
|
|
253
|
+
"accounts": [
|
|
254
|
+
{
|
|
255
|
+
"name": "config"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "pool",
|
|
259
|
+
"writable": true
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "authority",
|
|
263
|
+
"signer": true
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"args": [
|
|
267
|
+
{
|
|
268
|
+
"name": "token_amounts",
|
|
269
|
+
"type": {
|
|
270
|
+
"vec": "u64"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "disable_pool_admin",
|
|
277
|
+
"docs": [
|
|
278
|
+
"Permanently renounce pool-admin on this pool. Single-step,",
|
|
279
|
+
"irreversible."
|
|
280
|
+
],
|
|
281
|
+
"discriminator": [
|
|
282
|
+
106,
|
|
283
|
+
106,
|
|
284
|
+
112,
|
|
285
|
+
255,
|
|
286
|
+
92,
|
|
287
|
+
31,
|
|
288
|
+
2,
|
|
289
|
+
138
|
|
290
|
+
],
|
|
291
|
+
"accounts": [
|
|
292
|
+
{
|
|
293
|
+
"name": "pool",
|
|
294
|
+
"writable": true
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "authority",
|
|
298
|
+
"signer": true
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"args": []
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"name": "get_pool_info",
|
|
305
|
+
"docs": [
|
|
306
|
+
"Read-only \"view\": emit a `PoolInfo` event with the pool's full",
|
|
307
|
+
"state. Intended for `simulate({ commitment: ... })` calls; not",
|
|
308
|
+
"useful as part of a signed transaction.",
|
|
309
|
+
"",
|
|
310
|
+
"# Used by",
|
|
311
|
+
"SDK helpers, frontend pool-detail pages, indexer health-check",
|
|
312
|
+
"fallback."
|
|
313
|
+
],
|
|
314
|
+
"discriminator": [
|
|
315
|
+
9,
|
|
316
|
+
48,
|
|
317
|
+
220,
|
|
318
|
+
101,
|
|
319
|
+
22,
|
|
320
|
+
240,
|
|
321
|
+
78,
|
|
322
|
+
200
|
|
323
|
+
],
|
|
324
|
+
"accounts": [
|
|
325
|
+
{
|
|
326
|
+
"name": "pool"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"args": []
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "initialize_config",
|
|
333
|
+
"docs": [
|
|
334
|
+
"Initialise a new `CubicPoolConfig`. Treasury wrapper passes the",
|
|
335
|
+
"Treasury PDA as both admin pubkeys; direct calls produce",
|
|
336
|
+
"Initialise a fresh `CubicPoolConfig`.",
|
|
337
|
+
"",
|
|
338
|
+
"# Parameters",
|
|
339
|
+
"* `protocol_admin` — pubkey allowed to pause pools, set",
|
|
340
|
+
"`protocol_fee_rate`, collect fees, drain via debug-withdraw,",
|
|
341
|
+
"update banned extensions, and rotate itself via the",
|
|
342
|
+
"pending/accept flow.",
|
|
343
|
+
"* `default_protocol_fee_rate`— seeded onto every new pool under",
|
|
344
|
+
"this config (basis points, ≤ `MAX_PROTOCOL_FEE_RATE`).",
|
|
345
|
+
"",
|
|
346
|
+
"Pool-admin (level-1) is per-pool — set automatically to the wallet",
|
|
347
|
+
"that calls `initialize_cubic_pool`."
|
|
348
|
+
],
|
|
349
|
+
"discriminator": [
|
|
350
|
+
208,
|
|
351
|
+
127,
|
|
352
|
+
21,
|
|
353
|
+
1,
|
|
354
|
+
194,
|
|
355
|
+
190,
|
|
356
|
+
196,
|
|
357
|
+
70
|
|
358
|
+
],
|
|
359
|
+
"accounts": [
|
|
360
|
+
{
|
|
361
|
+
"name": "config",
|
|
362
|
+
"writable": true,
|
|
363
|
+
"signer": true
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "protocol_admin_treasury",
|
|
367
|
+
"docs": [
|
|
368
|
+
"Treasury PDA of the protocol-admin program. Validated two ways:",
|
|
369
|
+
"the `seeds` + `seeds::program` constraint pins *which* account this",
|
|
370
|
+
"must be, and the `Signer` type proves the call came through",
|
|
371
|
+
"protocol-admin's admin-gated CPI (only that program can",
|
|
372
|
+
"`invoke_signed` these seeds).",
|
|
373
|
+
"",
|
|
374
|
+
"The type must be `Signer` rather than an `UncheckedAccount` with an",
|
|
375
|
+
"`is_signer` constraint: Anchor derives CPI account metas from the",
|
|
376
|
+
"field TYPE, so an `UncheckedAccount` here would be emitted with",
|
|
377
|
+
"`is_signer: false` and the caller's `invoke_signed` signature would",
|
|
378
|
+
"never reach this program."
|
|
379
|
+
],
|
|
380
|
+
"signer": true
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"name": "payer",
|
|
384
|
+
"docs": [
|
|
385
|
+
"Pays the rent for `config`. Must be a `Signer`."
|
|
386
|
+
],
|
|
387
|
+
"writable": true,
|
|
388
|
+
"signer": true
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"name": "system_program"
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
"args": [
|
|
395
|
+
{
|
|
396
|
+
"name": "default_protocol_fee_rate",
|
|
397
|
+
"type": "u16"
|
|
398
|
+
}
|
|
399
|
+
]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "initialize_cubic_pool",
|
|
403
|
+
"docs": [
|
|
404
|
+
"Initialise a fresh pool under `config`. Creates the pool PDA and",
|
|
405
|
+
"BPT mint, validates token mints / weights / virtual balances, and",
|
|
406
|
+
"pins per-token programs.",
|
|
407
|
+
"",
|
|
408
|
+
"The pool's token set is the `remaining_accounts` list — one mint per",
|
|
409
|
+
"token, in the same order as the weights. There is no `tokens` argument:",
|
|
410
|
+
"it duplicated those accounts exactly and cost 324 bytes at 10 tokens,",
|
|
411
|
+
"which alone pushed a 10-token deploy past the transaction size limit.",
|
|
412
|
+
"",
|
|
413
|
+
"# Parameters",
|
|
414
|
+
"* `normalized_weights` — basis points, sum = `WEIGHT_SCALE`.",
|
|
415
|
+
"* `initial_virtual_balances` — seed virtual balances (raw units),",
|
|
416
|
+
"each > 0.",
|
|
417
|
+
"* `swap_fee_rate` — hundredths of bps,",
|
|
418
|
+
"≤ `MAX_SWAP_FEE_RATE`.",
|
|
419
|
+
"* `pool_id` — caller-chosen 64-bit salt baked",
|
|
420
|
+
"into PDA seeds. Unique per config.",
|
|
421
|
+
"",
|
|
422
|
+
"# remaining_accounts",
|
|
423
|
+
"One mint account per token in `tokens` order.",
|
|
424
|
+
"",
|
|
425
|
+
"# Used by",
|
|
426
|
+
"SDK `PoolFactoryClient.buildDeployPoolTx`, deploy-pool scripts."
|
|
427
|
+
],
|
|
428
|
+
"discriminator": [
|
|
429
|
+
215,
|
|
430
|
+
148,
|
|
431
|
+
116,
|
|
432
|
+
207,
|
|
433
|
+
121,
|
|
434
|
+
104,
|
|
435
|
+
111,
|
|
436
|
+
131
|
|
437
|
+
],
|
|
438
|
+
"accounts": [
|
|
439
|
+
{
|
|
440
|
+
"name": "config",
|
|
441
|
+
"docs": [
|
|
442
|
+
"Parent governance config. Read-only — only its pubkey and the",
|
|
443
|
+
"`default_protocol_fee_rate` / `banned_extensions` are consumed."
|
|
444
|
+
]
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "pool",
|
|
448
|
+
"docs": [
|
|
449
|
+
"New pool PDA. Seeded so multiple pools per config are possible",
|
|
450
|
+
"via distinct `pool_id` values."
|
|
451
|
+
],
|
|
452
|
+
"writable": true
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "bpt_mint",
|
|
456
|
+
"docs": [
|
|
457
|
+
"Brand-new BPT mint. Authority is the pool PDA, decimals fixed at",
|
|
458
|
+
"`BPT_DECIMALS` (= 9). `mint::token_program` follows the",
|
|
459
|
+
"`token_program` account passed below — this only constrains BPT,",
|
|
460
|
+
"not the per-pool tokens."
|
|
461
|
+
],
|
|
462
|
+
"writable": true
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"name": "payer",
|
|
466
|
+
"writable": true,
|
|
467
|
+
"signer": true
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "token_program"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "associated_token_program"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"name": "system_program"
|
|
477
|
+
}
|
|
478
|
+
],
|
|
479
|
+
"args": [
|
|
480
|
+
{
|
|
481
|
+
"name": "normalized_weights",
|
|
482
|
+
"type": {
|
|
483
|
+
"vec": "u64"
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"name": "initial_virtual_balances",
|
|
488
|
+
"type": {
|
|
489
|
+
"vec": "u64"
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "swap_fee_rate",
|
|
494
|
+
"type": "u32"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"name": "pool_id",
|
|
498
|
+
"type": "u64"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "banned_extensions_override",
|
|
502
|
+
"type": {
|
|
503
|
+
"option": "u64"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"name": "initialize_pool_alt",
|
|
510
|
+
"docs": [
|
|
511
|
+
"Provision a per-pool Address Lookup Table so client SDKs can build",
|
|
512
|
+
"`VersionedTransaction`s for `add_liquidity` / `remove_liquidity` on",
|
|
513
|
+
"pools whose account count exceeds the legacy 1232-byte ceiling",
|
|
514
|
+
"(≥ 7 tokens in practice).",
|
|
515
|
+
"",
|
|
516
|
+
"# Parameters",
|
|
517
|
+
"* `recent_slot` — recent slot used by the ALT program to derive",
|
|
518
|
+
"the table address. Caller should pass",
|
|
519
|
+
"`connection.getSlot('finalized')`.",
|
|
520
|
+
"",
|
|
521
|
+
"# Flow",
|
|
522
|
+
"One transaction performs three CPIs into the ALT program:",
|
|
523
|
+
"`create_lookup_table` → `extend_lookup_table` (pool, BPT mint,",
|
|
524
|
+
"vaults, mints, standard programs) → `freeze_lookup_table`.",
|
|
525
|
+
"The ALT becomes immutable forever — its rent (~0.005 SOL for a",
|
|
526
|
+
"7-token pool) is permanently locked.",
|
|
527
|
+
"",
|
|
528
|
+
"# Authority",
|
|
529
|
+
"`pool.pool_admin`. Idempotent: rejects with `AltAlreadyInitialized`",
|
|
530
|
+
"if `pool.lookup_table != Pubkey::default()`.",
|
|
531
|
+
"",
|
|
532
|
+
"# Used by",
|
|
533
|
+
"`scripts/cli/initialize-pool-alts.ts` (one-shot bootstrap for",
|
|
534
|
+
"existing prod pools), and `sdk` after `initialize_cubic_pool` on",
|
|
535
|
+
"fresh pools."
|
|
536
|
+
],
|
|
537
|
+
"discriminator": [
|
|
538
|
+
251,
|
|
539
|
+
135,
|
|
540
|
+
66,
|
|
541
|
+
2,
|
|
542
|
+
244,
|
|
543
|
+
73,
|
|
544
|
+
12,
|
|
545
|
+
144
|
|
546
|
+
],
|
|
547
|
+
"accounts": [
|
|
548
|
+
{
|
|
549
|
+
"name": "pool",
|
|
550
|
+
"docs": [
|
|
551
|
+
"Pool to provision the ALT for. Must have `lookup_table ==",
|
|
552
|
+
"Pubkey::default()`. The handler writes the new ALT address back",
|
|
553
|
+
"onto this account."
|
|
554
|
+
],
|
|
555
|
+
"writable": true
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "config",
|
|
559
|
+
"docs": [
|
|
560
|
+
"`CubicPoolConfig` this pool inherits governance from. Pinned via",
|
|
561
|
+
"`pool.config`. Reading it lets the handler also accept",
|
|
562
|
+
"`config.protocol_admin` as an authority — which is the Treasury",
|
|
563
|
+
"PDA, only signable through `protocol_admin.pool_initialize_alt`."
|
|
564
|
+
]
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"name": "authority",
|
|
568
|
+
"docs": [
|
|
569
|
+
"Authority. Must equal either `pool.pool_admin` (per-pool owner",
|
|
570
|
+
"path) or `config.protocol_admin` (Treasury PDA via the",
|
|
571
|
+
"protocol-admin CPI wrapper). Authorises the ALT creation; the",
|
|
572
|
+
"derived ALT address is `[authority, recent_slot]`."
|
|
573
|
+
],
|
|
574
|
+
"signer": true
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"name": "payer",
|
|
578
|
+
"docs": [
|
|
579
|
+
"Payer for ALT rent + per-extend top-ups. Decoupled from",
|
|
580
|
+
"`authority` because Treasury PDA (the wrapper-path authority)",
|
|
581
|
+
"owns data and so cannot be `from` in `system_program::transfer`.",
|
|
582
|
+
"In the pool-admin path callers pass the same key for both — no",
|
|
583
|
+
"behavioural change."
|
|
584
|
+
],
|
|
585
|
+
"writable": true,
|
|
586
|
+
"signer": true
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"name": "lookup_table",
|
|
590
|
+
"docs": [
|
|
591
|
+
"`[authority, recent_slot]` by the ALT program. Re-derived and",
|
|
592
|
+
"matched against this account in the handler."
|
|
593
|
+
],
|
|
594
|
+
"writable": true
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"name": "system_program"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"name": "alt_program",
|
|
601
|
+
"docs": [
|
|
602
|
+
"`solana_address_lookup_table_interface::id()` in the handler."
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
],
|
|
606
|
+
"args": [
|
|
607
|
+
{
|
|
608
|
+
"name": "recent_slot",
|
|
609
|
+
"type": "u64"
|
|
610
|
+
}
|
|
611
|
+
]
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"name": "initiate_pool_admin_transfer",
|
|
615
|
+
"docs": [
|
|
616
|
+
"Step 1 — current `pool.pool_admin` proposes a successor."
|
|
617
|
+
],
|
|
618
|
+
"discriminator": [
|
|
619
|
+
10,
|
|
620
|
+
148,
|
|
621
|
+
147,
|
|
622
|
+
98,
|
|
623
|
+
73,
|
|
624
|
+
190,
|
|
625
|
+
31,
|
|
626
|
+
43
|
|
627
|
+
],
|
|
628
|
+
"accounts": [
|
|
629
|
+
{
|
|
630
|
+
"name": "pool",
|
|
631
|
+
"writable": true
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "authority",
|
|
635
|
+
"signer": true
|
|
636
|
+
}
|
|
637
|
+
],
|
|
638
|
+
"args": [
|
|
639
|
+
{
|
|
640
|
+
"name": "new_admin",
|
|
641
|
+
"type": "pubkey"
|
|
642
|
+
}
|
|
643
|
+
]
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "initiate_protocol_admin_transfer",
|
|
647
|
+
"docs": [
|
|
648
|
+
"Step 1 — current `config.protocol_admin` proposes a successor."
|
|
649
|
+
],
|
|
650
|
+
"discriminator": [
|
|
651
|
+
167,
|
|
652
|
+
129,
|
|
653
|
+
39,
|
|
654
|
+
182,
|
|
655
|
+
10,
|
|
656
|
+
106,
|
|
657
|
+
51,
|
|
658
|
+
148
|
|
659
|
+
],
|
|
660
|
+
"accounts": [
|
|
661
|
+
{
|
|
662
|
+
"name": "config",
|
|
663
|
+
"writable": true
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "authority",
|
|
667
|
+
"signer": true
|
|
668
|
+
}
|
|
669
|
+
],
|
|
670
|
+
"args": [
|
|
671
|
+
{
|
|
672
|
+
"name": "new_admin",
|
|
673
|
+
"type": "pubkey"
|
|
674
|
+
}
|
|
675
|
+
]
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "migrate_to_v5",
|
|
679
|
+
"docs": [
|
|
680
|
+
"Pool storage migration entrypoint for the v4 → v5 layout change.",
|
|
681
|
+
"",
|
|
682
|
+
"**This instruction mutates state — it is not a no-op.** It backfills",
|
|
683
|
+
"`pool.banned_extensions` from the parent config when the pool still",
|
|
684
|
+
"reads `0` (the zeroed pre-upgrade `reserved` bytes), and, when",
|
|
685
|
+
"`reactivate_tokens` is set, flips every token's `is_active` back to",
|
|
686
|
+
"`true`.",
|
|
687
|
+
"",
|
|
688
|
+
"# Parameters",
|
|
689
|
+
"* `reactivate_tokens` — pass `true` ONLY on the one-shot v4 → v5 pass,",
|
|
690
|
+
"where `is_active` decodes as `false` because it lands on the old",
|
|
691
|
+
"zeroed `reserved` byte. Pass `false` on every later call: `true`",
|
|
692
|
+
"would silently re-open every token an admin deliberately disabled",
|
|
693
|
+
"with `set_token_active(i, false)`.",
|
|
694
|
+
"",
|
|
695
|
+
"# Authority",
|
|
696
|
+
"`pool.pool_admin` OR `config.protocol_admin`, neither being the",
|
|
697
|
+
"default key.",
|
|
698
|
+
"",
|
|
699
|
+
"Idempotent in both directions — a second run backfills nothing and",
|
|
700
|
+
"reactivates nothing."
|
|
701
|
+
],
|
|
702
|
+
"discriminator": [
|
|
703
|
+
127,
|
|
704
|
+
60,
|
|
705
|
+
135,
|
|
706
|
+
204,
|
|
707
|
+
181,
|
|
708
|
+
90,
|
|
709
|
+
202,
|
|
710
|
+
249
|
|
711
|
+
],
|
|
712
|
+
"accounts": [
|
|
713
|
+
{
|
|
714
|
+
"name": "pool",
|
|
715
|
+
"writable": true
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "config",
|
|
719
|
+
"docs": [
|
|
720
|
+
"Parent config — authorises via `protocol_admin` and supplies the",
|
|
721
|
+
"`banned_extensions` bitmap the migration backfills onto the pool."
|
|
722
|
+
]
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"name": "authority",
|
|
726
|
+
"signer": true
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
"name": "system_program"
|
|
730
|
+
}
|
|
731
|
+
],
|
|
732
|
+
"args": [
|
|
733
|
+
{
|
|
734
|
+
"name": "reactivate_tokens",
|
|
735
|
+
"type": "bool"
|
|
736
|
+
}
|
|
737
|
+
]
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"name": "range_manager_update",
|
|
741
|
+
"docs": [
|
|
742
|
+
"Tweak any subset of `virtual_balances` and / or `normalized_weights`",
|
|
743
|
+
"within the configured envelope. Range-manager only.",
|
|
744
|
+
"",
|
|
745
|
+
"# Parameters",
|
|
746
|
+
"* `vb_changes` — sparse `[(index, new_vb)]`; may be empty.",
|
|
747
|
+
"* `weight_changes` — sparse `[(index, new_weight_bps)]`; may be",
|
|
748
|
+
"empty. The resulting weight vector must sum to `WEIGHT_SCALE`",
|
|
749
|
+
"and stay within `[MIN_WEIGHT, MAX_WEIGHT]` per token, otherwise",
|
|
750
|
+
"the whole instruction reverts."
|
|
751
|
+
],
|
|
752
|
+
"discriminator": [
|
|
753
|
+
245,
|
|
754
|
+
183,
|
|
755
|
+
35,
|
|
756
|
+
69,
|
|
757
|
+
200,
|
|
758
|
+
10,
|
|
759
|
+
172,
|
|
760
|
+
44
|
|
761
|
+
],
|
|
762
|
+
"accounts": [
|
|
763
|
+
{
|
|
764
|
+
"name": "pool",
|
|
765
|
+
"docs": [
|
|
766
|
+
"Mutated — handler writes new virtual_balances / normalized_weights",
|
|
767
|
+
"and bumps `range_manager_last_updated`.",
|
|
768
|
+
"",
|
|
769
|
+
"`pool_enabled` is part of the gate: swaps and liquidity operations",
|
|
770
|
+
"honour the kill switch, and a range manager that kept rewriting",
|
|
771
|
+
"virtual balances and weights through a protocol-level pause would",
|
|
772
|
+
"leave governance with no way to contain a misbehaving one (only the",
|
|
773
|
+
"pool admin can un-appoint it)."
|
|
774
|
+
],
|
|
775
|
+
"writable": true
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "authority",
|
|
779
|
+
"signer": true
|
|
780
|
+
}
|
|
781
|
+
],
|
|
782
|
+
"args": [
|
|
783
|
+
{
|
|
784
|
+
"name": "vb_changes",
|
|
785
|
+
"type": {
|
|
786
|
+
"vec": {
|
|
787
|
+
"defined": {
|
|
788
|
+
"name": "TokenChange"
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"name": "weight_changes",
|
|
795
|
+
"type": {
|
|
796
|
+
"vec": {
|
|
797
|
+
"defined": {
|
|
798
|
+
"name": "TokenChange"
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
]
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"name": "remove_liquidity",
|
|
807
|
+
"docs": [
|
|
808
|
+
"Burn BPT proportionally and pay out tokens.",
|
|
809
|
+
"",
|
|
810
|
+
"# Minimum-supply floor",
|
|
811
|
+
"The pool always retains at least `MINIMUM_INITIAL_BPT` of supply",
|
|
812
|
+
"so the proportional math never sees a zero-supply state. If the",
|
|
813
|
+
"caller's `bpt_amount` would push supply below the floor, the burn",
|
|
814
|
+
"is silently capped at `total_supply - MINIMUM_INITIAL_BPT` and",
|
|
815
|
+
"the residual BPT stays in the user's wallet.",
|
|
816
|
+
"",
|
|
817
|
+
"# Parameters",
|
|
818
|
+
"* `bpt_amount` — caller's requested burn (raw BPT).",
|
|
819
|
+
"* `minimum_token_amounts` — per-token slippage floors against the",
|
|
820
|
+
"*effective* (capped) burn.",
|
|
821
|
+
"",
|
|
822
|
+
"# Used by",
|
|
823
|
+
"User wallets, SDK `LiquidityClient`."
|
|
824
|
+
],
|
|
825
|
+
"discriminator": [
|
|
826
|
+
80,
|
|
827
|
+
85,
|
|
828
|
+
209,
|
|
829
|
+
72,
|
|
830
|
+
24,
|
|
831
|
+
206,
|
|
832
|
+
177,
|
|
833
|
+
108
|
|
834
|
+
],
|
|
835
|
+
"accounts": [
|
|
836
|
+
{
|
|
837
|
+
"name": "pool",
|
|
838
|
+
"writable": true
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"name": "bpt_mint",
|
|
842
|
+
"writable": true
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
"name": "user_bpt_account",
|
|
846
|
+
"writable": true
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"name": "user",
|
|
850
|
+
"signer": true
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
"name": "token_program"
|
|
854
|
+
}
|
|
855
|
+
],
|
|
856
|
+
"args": [
|
|
857
|
+
{
|
|
858
|
+
"name": "bpt_amount",
|
|
859
|
+
"type": "u64"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
"name": "minimum_token_amounts",
|
|
863
|
+
"type": {
|
|
864
|
+
"vec": "u64"
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
]
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
"name": "set_banned_extensions",
|
|
871
|
+
"docs": [
|
|
872
|
+
"Update the Token-2022 banned-extensions bitmap on a config.",
|
|
873
|
+
"Only affects future pool inits.",
|
|
874
|
+
"",
|
|
875
|
+
"# Authority",
|
|
876
|
+
"`protocol_admin` AND Treasury PDA.",
|
|
877
|
+
"",
|
|
878
|
+
"# Used by",
|
|
879
|
+
"`protocol_admin::pool_set_banned_extensions` (CPI).",
|
|
880
|
+
"# Parameters",
|
|
881
|
+
"* `banned_extensions` — the DEFAULT a pool creator inherits when",
|
|
882
|
+
"they pass no override. A creator may loosen it.",
|
|
883
|
+
"* `hard_banned_extensions` — the FLOOR a creator can never clear,",
|
|
884
|
+
"OR-ed into every new pool's effective bitmap. This is where",
|
|
885
|
+
"custody-reaching extensions belong (`PermanentDelegate`,",
|
|
886
|
+
"`TransferHook`). Governance can lower it to list an issuer whose",
|
|
887
|
+
"mint legitimately carries one — PYUSD-class stablecoins ship",
|
|
888
|
+
"`PermanentDelegate` for compliance seizure — which is a deliberate",
|
|
889
|
+
"decision to trust that issuer with vault custody."
|
|
890
|
+
],
|
|
891
|
+
"discriminator": [
|
|
892
|
+
86,
|
|
893
|
+
95,
|
|
894
|
+
249,
|
|
895
|
+
149,
|
|
896
|
+
142,
|
|
897
|
+
105,
|
|
898
|
+
100,
|
|
899
|
+
151
|
|
900
|
+
],
|
|
901
|
+
"accounts": [
|
|
902
|
+
{
|
|
903
|
+
"name": "config",
|
|
904
|
+
"writable": true
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
"name": "authority",
|
|
908
|
+
"signer": true
|
|
909
|
+
}
|
|
910
|
+
],
|
|
911
|
+
"args": [
|
|
912
|
+
{
|
|
913
|
+
"name": "banned_extensions",
|
|
914
|
+
"type": "u64"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"name": "hard_banned_extensions",
|
|
918
|
+
"type": "u64"
|
|
919
|
+
}
|
|
920
|
+
]
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"name": "set_max_selloff",
|
|
924
|
+
"docs": [
|
|
925
|
+
"Set the per-token sell-off policy — sliding-window cap, period, and",
|
|
926
|
+
"the variable surge-fee curve — for every active token in one call.",
|
|
927
|
+
"Pool-admin only.",
|
|
928
|
+
"",
|
|
929
|
+
"# Parameters",
|
|
930
|
+
"* `params` — length == `token_count`, one",
|
|
931
|
+
"`instructions::set_max_selloff::SelloffParams` per token",
|
|
932
|
+
"(`max_selloff_pct`, `period_length`, `fee_threshold_pct`,",
|
|
933
|
+
"`fee_slope_low_pct`, `fee_slope_high_pct`; all `_pct` in",
|
|
934
|
+
"`PERCENT_SCALE` units). The surge fee rises convexly as the",
|
|
935
|
+
"window fills and is charged on the output token, 100% to the",
|
|
936
|
+
"protocol bucket."
|
|
937
|
+
],
|
|
938
|
+
"discriminator": [
|
|
939
|
+
100,
|
|
940
|
+
44,
|
|
941
|
+
68,
|
|
942
|
+
198,
|
|
943
|
+
33,
|
|
944
|
+
58,
|
|
945
|
+
147,
|
|
946
|
+
254
|
|
947
|
+
],
|
|
948
|
+
"accounts": [
|
|
949
|
+
{
|
|
950
|
+
"name": "pool",
|
|
951
|
+
"writable": true
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
"name": "authority",
|
|
955
|
+
"signer": true
|
|
956
|
+
}
|
|
957
|
+
],
|
|
958
|
+
"args": [
|
|
959
|
+
{
|
|
960
|
+
"name": "params",
|
|
961
|
+
"type": {
|
|
962
|
+
"vec": {
|
|
963
|
+
"defined": {
|
|
964
|
+
"name": "SelloffParams"
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
]
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"name": "set_pool_enabled",
|
|
973
|
+
"docs": [
|
|
974
|
+
"Master pool kill-switch. When `enabled = false`, swaps and",
|
|
975
|
+
"add/remove liquidity all revert.",
|
|
976
|
+
"",
|
|
977
|
+
"# Authority",
|
|
978
|
+
"`protocol_admin` AND Treasury PDA.",
|
|
979
|
+
"",
|
|
980
|
+
"# Used by",
|
|
981
|
+
"`protocol_admin::pool_set_pool_enabled` (CPI)."
|
|
982
|
+
],
|
|
983
|
+
"discriminator": [
|
|
984
|
+
53,
|
|
985
|
+
76,
|
|
986
|
+
170,
|
|
987
|
+
37,
|
|
988
|
+
55,
|
|
989
|
+
222,
|
|
990
|
+
63,
|
|
991
|
+
21
|
|
992
|
+
],
|
|
993
|
+
"accounts": [
|
|
994
|
+
{
|
|
995
|
+
"name": "config"
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"name": "pool",
|
|
999
|
+
"writable": true
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"name": "authority",
|
|
1003
|
+
"signer": true
|
|
1004
|
+
}
|
|
1005
|
+
],
|
|
1006
|
+
"args": [
|
|
1007
|
+
{
|
|
1008
|
+
"name": "enabled",
|
|
1009
|
+
"type": "bool"
|
|
1010
|
+
}
|
|
1011
|
+
]
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"name": "set_protocol_fee_rate",
|
|
1015
|
+
"docs": [
|
|
1016
|
+
"Set `pool.protocol_fee_rate`.",
|
|
1017
|
+
"",
|
|
1018
|
+
"# Authority",
|
|
1019
|
+
"`protocol_admin` AND Treasury PDA.",
|
|
1020
|
+
"",
|
|
1021
|
+
"# Parameters",
|
|
1022
|
+
"* `protocol_fee_rate` — basis points, ≤ `MAX_PROTOCOL_FEE_RATE`.",
|
|
1023
|
+
"",
|
|
1024
|
+
"# Used by",
|
|
1025
|
+
"`protocol_admin::pool_set_protocol_fee_rate` (CPI)."
|
|
1026
|
+
],
|
|
1027
|
+
"discriminator": [
|
|
1028
|
+
95,
|
|
1029
|
+
7,
|
|
1030
|
+
4,
|
|
1031
|
+
50,
|
|
1032
|
+
154,
|
|
1033
|
+
79,
|
|
1034
|
+
156,
|
|
1035
|
+
131
|
|
1036
|
+
],
|
|
1037
|
+
"accounts": [
|
|
1038
|
+
{
|
|
1039
|
+
"name": "config"
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
"name": "pool",
|
|
1043
|
+
"writable": true
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
"name": "authority",
|
|
1047
|
+
"signer": true
|
|
1048
|
+
}
|
|
1049
|
+
],
|
|
1050
|
+
"args": [
|
|
1051
|
+
{
|
|
1052
|
+
"name": "protocol_fee_rate",
|
|
1053
|
+
"type": "u16"
|
|
1054
|
+
}
|
|
1055
|
+
]
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"name": "set_range_manager",
|
|
1059
|
+
"docs": [
|
|
1060
|
+
"Set or disable the range-manager pubkey on `pool`. Pool-admin only —",
|
|
1061
|
+
"protocol-admin cannot reach this. Combine `new_manager =",
|
|
1062
|
+
"Pubkey::default()` with `enabled = false` for the fully-disabled",
|
|
1063
|
+
"state. New pools deploy with this off by default.",
|
|
1064
|
+
"",
|
|
1065
|
+
"# Parameters",
|
|
1066
|
+
"* `new_manager` — pubkey allowed to call `range_manager_update`.",
|
|
1067
|
+
"* `enabled` — gate flag; `false` blocks the manager even if",
|
|
1068
|
+
"pubkey is set."
|
|
1069
|
+
],
|
|
1070
|
+
"discriminator": [
|
|
1071
|
+
103,
|
|
1072
|
+
102,
|
|
1073
|
+
173,
|
|
1074
|
+
112,
|
|
1075
|
+
8,
|
|
1076
|
+
2,
|
|
1077
|
+
37,
|
|
1078
|
+
132
|
|
1079
|
+
],
|
|
1080
|
+
"accounts": [
|
|
1081
|
+
{
|
|
1082
|
+
"name": "config"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
"name": "pool",
|
|
1086
|
+
"writable": true
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"name": "authority",
|
|
1090
|
+
"signer": true
|
|
1091
|
+
}
|
|
1092
|
+
],
|
|
1093
|
+
"args": [
|
|
1094
|
+
{
|
|
1095
|
+
"name": "new_manager",
|
|
1096
|
+
"type": "pubkey"
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
"name": "enabled",
|
|
1100
|
+
"type": "bool"
|
|
1101
|
+
}
|
|
1102
|
+
]
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
"name": "set_range_manager_config",
|
|
1106
|
+
"docs": [
|
|
1107
|
+
"Configure the envelope the range-manager must stay within. Pool-",
|
|
1108
|
+
"admin only. Limits are per-token (applied independently in the",
|
|
1109
|
+
"update loop) and a percentage of the CURRENT value, in",
|
|
1110
|
+
"`PERCENT_SCALE` units (10_000 = 100%).",
|
|
1111
|
+
"",
|
|
1112
|
+
"# Parameters",
|
|
1113
|
+
"* `max_vb_change_pct` — ≤ 10_000. 5% = 500.",
|
|
1114
|
+
"* `max_weight_change_pct` — ≤ 10_000.",
|
|
1115
|
+
"* `min_update_interval_secs` — rate-limit between successive",
|
|
1116
|
+
"`range_manager_update` calls.",
|
|
1117
|
+
"* `max_leverage_bps` — absolute band on",
|
|
1118
|
+
"`virtual_balance / actual_balance` the manager must leave every",
|
|
1119
|
+
"live token inside (10_000 = 1.0×; `0` disables that side). The",
|
|
1120
|
+
"percentage caps above bound how FAST the manager may move; this",
|
|
1121
|
+
"bounds how FAR.",
|
|
1122
|
+
"* `min_leverage_bps` — the FLOOR of the same envelope, and the side",
|
|
1123
|
+
"that actually protects capital. Output is priced off virtual",
|
|
1124
|
+
"balances, so depressing one makes the pool believe it holds less than",
|
|
1125
|
+
"it does and sells the other side's real reserves at a fabricated",
|
|
1126
|
+
"rate. A ceiling alone never sees that coming. `0` disables it.",
|
|
1127
|
+
"Appended at the END of the argument list — Borsh is positional."
|
|
1128
|
+
],
|
|
1129
|
+
"discriminator": [
|
|
1130
|
+
103,
|
|
1131
|
+
211,
|
|
1132
|
+
0,
|
|
1133
|
+
200,
|
|
1134
|
+
164,
|
|
1135
|
+
189,
|
|
1136
|
+
245,
|
|
1137
|
+
205
|
|
1138
|
+
],
|
|
1139
|
+
"accounts": [
|
|
1140
|
+
{
|
|
1141
|
+
"name": "pool",
|
|
1142
|
+
"writable": true
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
"name": "authority",
|
|
1146
|
+
"signer": true
|
|
1147
|
+
}
|
|
1148
|
+
],
|
|
1149
|
+
"args": [
|
|
1150
|
+
{
|
|
1151
|
+
"name": "max_vb_change_pct",
|
|
1152
|
+
"type": "u16"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
"name": "max_weight_change_pct",
|
|
1156
|
+
"type": "u16"
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
"name": "min_update_interval_secs",
|
|
1160
|
+
"type": "u32"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
"name": "max_leverage_bps",
|
|
1164
|
+
"type": "u32"
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
"name": "min_leverage_bps",
|
|
1168
|
+
"type": "u32"
|
|
1169
|
+
}
|
|
1170
|
+
]
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
"name": "set_swap_fee_rate",
|
|
1174
|
+
"docs": [
|
|
1175
|
+
"Set `pool.swap_fee_rate`.",
|
|
1176
|
+
"",
|
|
1177
|
+
"# Authority",
|
|
1178
|
+
"`pool_admin` AND Treasury PDA.",
|
|
1179
|
+
"",
|
|
1180
|
+
"# Parameters",
|
|
1181
|
+
"* `swap_fee_rate` — hundredths of bps, ≤ `MAX_SWAP_FEE_RATE`.",
|
|
1182
|
+
"",
|
|
1183
|
+
"# Used by",
|
|
1184
|
+
"The pool admin's own wallet, and the admin panel. There is deliberately",
|
|
1185
|
+
"NO `protocol_admin::pool_set_swap_fee_rate` wrapper: the swap fee is the",
|
|
1186
|
+
"pool admin's parameter, not governance's, and the context requires the",
|
|
1187
|
+
"pool admin to sign. Governance's lever over a pool's economics is",
|
|
1188
|
+
"`pool_set_protocol_fee_rate`, which is a different field."
|
|
1189
|
+
],
|
|
1190
|
+
"discriminator": [
|
|
1191
|
+
144,
|
|
1192
|
+
102,
|
|
1193
|
+
81,
|
|
1194
|
+
175,
|
|
1195
|
+
135,
|
|
1196
|
+
50,
|
|
1197
|
+
36,
|
|
1198
|
+
191
|
|
1199
|
+
],
|
|
1200
|
+
"accounts": [
|
|
1201
|
+
{
|
|
1202
|
+
"name": "pool",
|
|
1203
|
+
"docs": [
|
|
1204
|
+
"Mutated. `authority` must equal `pool.pool_admin` (storage-only",
|
|
1205
|
+
"admin pubkey; no hardcoded address)."
|
|
1206
|
+
],
|
|
1207
|
+
"writable": true
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
"name": "authority",
|
|
1211
|
+
"signer": true
|
|
1212
|
+
}
|
|
1213
|
+
],
|
|
1214
|
+
"args": [
|
|
1215
|
+
{
|
|
1216
|
+
"name": "swap_fee_rate",
|
|
1217
|
+
"type": "u32"
|
|
1218
|
+
}
|
|
1219
|
+
]
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
"name": "set_swaps_enabled",
|
|
1223
|
+
"docs": [
|
|
1224
|
+
"Per-pool swap toggle (less invasive than `set_pool_enabled` —",
|
|
1225
|
+
"LPs can still add/remove liquidity).",
|
|
1226
|
+
"",
|
|
1227
|
+
"# Authority",
|
|
1228
|
+
"`pool_admin` OR `protocol_admin`, AND Treasury PDA.",
|
|
1229
|
+
"",
|
|
1230
|
+
"# Used by",
|
|
1231
|
+
"`protocol_admin::pool_set_swaps_enabled` (CPI)."
|
|
1232
|
+
],
|
|
1233
|
+
"discriminator": [
|
|
1234
|
+
144,
|
|
1235
|
+
154,
|
|
1236
|
+
205,
|
|
1237
|
+
58,
|
|
1238
|
+
241,
|
|
1239
|
+
169,
|
|
1240
|
+
64,
|
|
1241
|
+
40
|
|
1242
|
+
],
|
|
1243
|
+
"accounts": [
|
|
1244
|
+
{
|
|
1245
|
+
"name": "config"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"name": "pool",
|
|
1249
|
+
"writable": true
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
"name": "authority",
|
|
1253
|
+
"signer": true
|
|
1254
|
+
}
|
|
1255
|
+
],
|
|
1256
|
+
"args": [
|
|
1257
|
+
{
|
|
1258
|
+
"name": "enabled",
|
|
1259
|
+
"type": "bool"
|
|
1260
|
+
}
|
|
1261
|
+
]
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
"name": "set_token_active",
|
|
1265
|
+
"docs": [
|
|
1266
|
+
"Set a token's `is_active` flag. When `false`, swaps whose INPUT token",
|
|
1267
|
+
"is `token_index` revert (`TokenInactive`); the token can still be",
|
|
1268
|
+
"bought (as output) and liquidity ops are unaffected.",
|
|
1269
|
+
"",
|
|
1270
|
+
"# Authority",
|
|
1271
|
+
"`pool.pool_admin` OR `config.protocol_admin` (Treasury PDA). The",
|
|
1272
|
+
"Treasury path is reachable by admin OR supervisor via",
|
|
1273
|
+
"`protocol_admin::pool_set_token_active`."
|
|
1274
|
+
],
|
|
1275
|
+
"discriminator": [
|
|
1276
|
+
0,
|
|
1277
|
+
158,
|
|
1278
|
+
202,
|
|
1279
|
+
35,
|
|
1280
|
+
50,
|
|
1281
|
+
139,
|
|
1282
|
+
217,
|
|
1283
|
+
18
|
|
1284
|
+
],
|
|
1285
|
+
"accounts": [
|
|
1286
|
+
{
|
|
1287
|
+
"name": "config"
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
"name": "pool",
|
|
1291
|
+
"writable": true
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"name": "authority",
|
|
1295
|
+
"signer": true
|
|
1296
|
+
}
|
|
1297
|
+
],
|
|
1298
|
+
"args": [
|
|
1299
|
+
{
|
|
1300
|
+
"name": "token_index",
|
|
1301
|
+
"type": "u8"
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
"name": "is_active",
|
|
1305
|
+
"type": "bool"
|
|
1306
|
+
}
|
|
1307
|
+
]
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
"name": "swap",
|
|
1311
|
+
"docs": [
|
|
1312
|
+
"Swap one pool token for another using `calc_out_given_in`.",
|
|
1313
|
+
"",
|
|
1314
|
+
"# Parameters",
|
|
1315
|
+
"* `amount_in` — raw input token units (pre-fee).",
|
|
1316
|
+
"* `minimum_amount_out`— slippage floor.",
|
|
1317
|
+
"* `token_in_index` — index in `pool.token_mints`.",
|
|
1318
|
+
"* `token_out_index` — different index in `pool.token_mints`.",
|
|
1319
|
+
"",
|
|
1320
|
+
"# Used by",
|
|
1321
|
+
"User wallets, SDK `SwapClient`, single-token-liquidity helper."
|
|
1322
|
+
],
|
|
1323
|
+
"discriminator": [
|
|
1324
|
+
248,
|
|
1325
|
+
198,
|
|
1326
|
+
158,
|
|
1327
|
+
145,
|
|
1328
|
+
225,
|
|
1329
|
+
117,
|
|
1330
|
+
135,
|
|
1331
|
+
200
|
|
1332
|
+
],
|
|
1333
|
+
"accounts": [
|
|
1334
|
+
{
|
|
1335
|
+
"name": "pool",
|
|
1336
|
+
"writable": true
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
"name": "token_mint_in"
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
"name": "token_mint_out"
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
"name": "user_token_account_in",
|
|
1346
|
+
"docs": [
|
|
1347
|
+
"User's input-token account. Mint and owner cross-checked."
|
|
1348
|
+
],
|
|
1349
|
+
"writable": true
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"name": "user_token_account_out",
|
|
1353
|
+
"writable": true
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
"name": "vault_in",
|
|
1357
|
+
"docs": [
|
|
1358
|
+
"Pool input vault. ATA(pool, mint_in, token_program_in) — verified",
|
|
1359
|
+
"in handler."
|
|
1360
|
+
],
|
|
1361
|
+
"writable": true
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"name": "vault_out",
|
|
1365
|
+
"writable": true
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"name": "user",
|
|
1369
|
+
"signer": true
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"name": "token_program_in"
|
|
1373
|
+
},
|
|
1374
|
+
{
|
|
1375
|
+
"name": "token_program_out"
|
|
1376
|
+
}
|
|
1377
|
+
],
|
|
1378
|
+
"args": [
|
|
1379
|
+
{
|
|
1380
|
+
"name": "amount_in",
|
|
1381
|
+
"type": "u64"
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
"name": "minimum_amount_out",
|
|
1385
|
+
"type": "u64"
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
"name": "token_in_index",
|
|
1389
|
+
"type": "u8"
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
"name": "token_out_index",
|
|
1393
|
+
"type": "u8"
|
|
1394
|
+
}
|
|
1395
|
+
]
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"name": "withdraw_sol",
|
|
1399
|
+
"docs": [
|
|
1400
|
+
"Drain lamports from a cubic-pool-owned account, leaving at least",
|
|
1401
|
+
"the rent-exempt minimum.",
|
|
1402
|
+
"",
|
|
1403
|
+
"# Authority",
|
|
1404
|
+
"Treasury PDA only.",
|
|
1405
|
+
"",
|
|
1406
|
+
"# Parameters",
|
|
1407
|
+
"* `amount` — lamports; must be > 0 and ≤",
|
|
1408
|
+
"`source.lamports() - rent_exempt_minimum(source.data_len())`.",
|
|
1409
|
+
"",
|
|
1410
|
+
"# Used by",
|
|
1411
|
+
"`protocol_admin::pool_withdraw_sol` (CPI)."
|
|
1412
|
+
],
|
|
1413
|
+
"discriminator": [
|
|
1414
|
+
145,
|
|
1415
|
+
131,
|
|
1416
|
+
74,
|
|
1417
|
+
136,
|
|
1418
|
+
65,
|
|
1419
|
+
137,
|
|
1420
|
+
42,
|
|
1421
|
+
38
|
|
1422
|
+
],
|
|
1423
|
+
"accounts": [
|
|
1424
|
+
{
|
|
1425
|
+
"name": "config"
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
"name": "source",
|
|
1429
|
+
"writable": true
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
"name": "recipient",
|
|
1433
|
+
"writable": true
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
"name": "authority",
|
|
1437
|
+
"signer": true
|
|
1438
|
+
}
|
|
1439
|
+
],
|
|
1440
|
+
"args": [
|
|
1441
|
+
{
|
|
1442
|
+
"name": "amount",
|
|
1443
|
+
"type": "u64"
|
|
1444
|
+
}
|
|
1445
|
+
]
|
|
1446
|
+
}
|
|
1447
|
+
],
|
|
1448
|
+
"accounts": [
|
|
1449
|
+
{
|
|
1450
|
+
"name": "CubicPool",
|
|
1451
|
+
"discriminator": [
|
|
1452
|
+
137,
|
|
1453
|
+
210,
|
|
1454
|
+
42,
|
|
1455
|
+
22,
|
|
1456
|
+
209,
|
|
1457
|
+
156,
|
|
1458
|
+
43,
|
|
1459
|
+
78
|
|
1460
|
+
]
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"name": "CubicPoolConfig",
|
|
1464
|
+
"discriminator": [
|
|
1465
|
+
4,
|
|
1466
|
+
29,
|
|
1467
|
+
243,
|
|
1468
|
+
10,
|
|
1469
|
+
142,
|
|
1470
|
+
64,
|
|
1471
|
+
232,
|
|
1472
|
+
118
|
|
1473
|
+
]
|
|
1474
|
+
}
|
|
1475
|
+
],
|
|
1476
|
+
"events": [
|
|
1477
|
+
{
|
|
1478
|
+
"name": "BannedExtensionsUpdated",
|
|
1479
|
+
"discriminator": [
|
|
1480
|
+
107,
|
|
1481
|
+
126,
|
|
1482
|
+
13,
|
|
1483
|
+
149,
|
|
1484
|
+
182,
|
|
1485
|
+
108,
|
|
1486
|
+
139,
|
|
1487
|
+
202
|
|
1488
|
+
]
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
"name": "ConfigInitialized",
|
|
1492
|
+
"discriminator": [
|
|
1493
|
+
181,
|
|
1494
|
+
49,
|
|
1495
|
+
200,
|
|
1496
|
+
156,
|
|
1497
|
+
19,
|
|
1498
|
+
167,
|
|
1499
|
+
178,
|
|
1500
|
+
91
|
|
1501
|
+
]
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
"name": "DebugLiquidityWithdrawn",
|
|
1505
|
+
"discriminator": [
|
|
1506
|
+
174,
|
|
1507
|
+
59,
|
|
1508
|
+
149,
|
|
1509
|
+
22,
|
|
1510
|
+
135,
|
|
1511
|
+
129,
|
|
1512
|
+
129,
|
|
1513
|
+
83
|
|
1514
|
+
]
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
"name": "LiquidityAdded",
|
|
1518
|
+
"discriminator": [
|
|
1519
|
+
154,
|
|
1520
|
+
26,
|
|
1521
|
+
221,
|
|
1522
|
+
108,
|
|
1523
|
+
238,
|
|
1524
|
+
64,
|
|
1525
|
+
217,
|
|
1526
|
+
161
|
|
1527
|
+
]
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
"name": "LiquidityRemoved",
|
|
1531
|
+
"discriminator": [
|
|
1532
|
+
225,
|
|
1533
|
+
105,
|
|
1534
|
+
216,
|
|
1535
|
+
39,
|
|
1536
|
+
124,
|
|
1537
|
+
116,
|
|
1538
|
+
169,
|
|
1539
|
+
189
|
|
1540
|
+
]
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
"name": "MaxSelloffSet",
|
|
1544
|
+
"discriminator": [
|
|
1545
|
+
134,
|
|
1546
|
+
183,
|
|
1547
|
+
49,
|
|
1548
|
+
134,
|
|
1549
|
+
82,
|
|
1550
|
+
138,
|
|
1551
|
+
85,
|
|
1552
|
+
234
|
|
1553
|
+
]
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
"name": "MaxSelloffWindowAdvanced",
|
|
1557
|
+
"discriminator": [
|
|
1558
|
+
229,
|
|
1559
|
+
227,
|
|
1560
|
+
163,
|
|
1561
|
+
30,
|
|
1562
|
+
22,
|
|
1563
|
+
183,
|
|
1564
|
+
78,
|
|
1565
|
+
57
|
|
1566
|
+
]
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
"name": "PoolAdminDisabled",
|
|
1570
|
+
"discriminator": [
|
|
1571
|
+
158,
|
|
1572
|
+
98,
|
|
1573
|
+
202,
|
|
1574
|
+
37,
|
|
1575
|
+
243,
|
|
1576
|
+
57,
|
|
1577
|
+
247,
|
|
1578
|
+
87
|
|
1579
|
+
]
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
"name": "PoolAdminTransferCancelled",
|
|
1583
|
+
"discriminator": [
|
|
1584
|
+
238,
|
|
1585
|
+
53,
|
|
1586
|
+
38,
|
|
1587
|
+
143,
|
|
1588
|
+
194,
|
|
1589
|
+
45,
|
|
1590
|
+
206,
|
|
1591
|
+
179
|
|
1592
|
+
]
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
"name": "PoolAdminTransferInitiated",
|
|
1596
|
+
"discriminator": [
|
|
1597
|
+
33,
|
|
1598
|
+
195,
|
|
1599
|
+
202,
|
|
1600
|
+
133,
|
|
1601
|
+
209,
|
|
1602
|
+
42,
|
|
1603
|
+
157,
|
|
1604
|
+
78
|
|
1605
|
+
]
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
"name": "PoolAdminTransferred",
|
|
1609
|
+
"discriminator": [
|
|
1610
|
+
123,
|
|
1611
|
+
48,
|
|
1612
|
+
231,
|
|
1613
|
+
186,
|
|
1614
|
+
53,
|
|
1615
|
+
67,
|
|
1616
|
+
156,
|
|
1617
|
+
254
|
|
1618
|
+
]
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
"name": "PoolAltInitialized",
|
|
1622
|
+
"discriminator": [
|
|
1623
|
+
61,
|
|
1624
|
+
210,
|
|
1625
|
+
86,
|
|
1626
|
+
20,
|
|
1627
|
+
100,
|
|
1628
|
+
253,
|
|
1629
|
+
41,
|
|
1630
|
+
133
|
|
1631
|
+
]
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
"name": "PoolEnabledUpdated",
|
|
1635
|
+
"discriminator": [
|
|
1636
|
+
101,
|
|
1637
|
+
47,
|
|
1638
|
+
3,
|
|
1639
|
+
240,
|
|
1640
|
+
197,
|
|
1641
|
+
181,
|
|
1642
|
+
236,
|
|
1643
|
+
142
|
|
1644
|
+
]
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
"name": "PoolInfo",
|
|
1648
|
+
"discriminator": [
|
|
1649
|
+
207,
|
|
1650
|
+
20,
|
|
1651
|
+
87,
|
|
1652
|
+
97,
|
|
1653
|
+
251,
|
|
1654
|
+
212,
|
|
1655
|
+
234,
|
|
1656
|
+
45
|
|
1657
|
+
]
|
|
1658
|
+
},
|
|
1659
|
+
{
|
|
1660
|
+
"name": "PoolInitialized",
|
|
1661
|
+
"discriminator": [
|
|
1662
|
+
100,
|
|
1663
|
+
118,
|
|
1664
|
+
173,
|
|
1665
|
+
87,
|
|
1666
|
+
12,
|
|
1667
|
+
198,
|
|
1668
|
+
254,
|
|
1669
|
+
229
|
|
1670
|
+
]
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
"name": "PoolMigratedToV5",
|
|
1674
|
+
"discriminator": [
|
|
1675
|
+
95,
|
|
1676
|
+
55,
|
|
1677
|
+
157,
|
|
1678
|
+
61,
|
|
1679
|
+
92,
|
|
1680
|
+
6,
|
|
1681
|
+
79,
|
|
1682
|
+
105
|
|
1683
|
+
]
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
"name": "PoolSolWithdrawn",
|
|
1687
|
+
"discriminator": [
|
|
1688
|
+
82,
|
|
1689
|
+
220,
|
|
1690
|
+
173,
|
|
1691
|
+
175,
|
|
1692
|
+
24,
|
|
1693
|
+
165,
|
|
1694
|
+
172,
|
|
1695
|
+
233
|
|
1696
|
+
]
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
"name": "PoolStateLog",
|
|
1700
|
+
"discriminator": [
|
|
1701
|
+
59,
|
|
1702
|
+
254,
|
|
1703
|
+
237,
|
|
1704
|
+
111,
|
|
1705
|
+
163,
|
|
1706
|
+
10,
|
|
1707
|
+
140,
|
|
1708
|
+
224
|
|
1709
|
+
]
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
"name": "ProtocolAdminTransferCancelled",
|
|
1713
|
+
"discriminator": [
|
|
1714
|
+
46,
|
|
1715
|
+
120,
|
|
1716
|
+
187,
|
|
1717
|
+
57,
|
|
1718
|
+
136,
|
|
1719
|
+
63,
|
|
1720
|
+
89,
|
|
1721
|
+
7
|
|
1722
|
+
]
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
"name": "ProtocolAdminTransferInitiated",
|
|
1726
|
+
"discriminator": [
|
|
1727
|
+
78,
|
|
1728
|
+
207,
|
|
1729
|
+
188,
|
|
1730
|
+
146,
|
|
1731
|
+
26,
|
|
1732
|
+
65,
|
|
1733
|
+
40,
|
|
1734
|
+
167
|
|
1735
|
+
]
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
"name": "ProtocolAdminTransferred",
|
|
1739
|
+
"discriminator": [
|
|
1740
|
+
140,
|
|
1741
|
+
30,
|
|
1742
|
+
55,
|
|
1743
|
+
121,
|
|
1744
|
+
105,
|
|
1745
|
+
75,
|
|
1746
|
+
148,
|
|
1747
|
+
68
|
|
1748
|
+
]
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
"name": "ProtocolFeeRateUpdated",
|
|
1752
|
+
"discriminator": [
|
|
1753
|
+
189,
|
|
1754
|
+
56,
|
|
1755
|
+
7,
|
|
1756
|
+
65,
|
|
1757
|
+
0,
|
|
1758
|
+
95,
|
|
1759
|
+
192,
|
|
1760
|
+
6
|
|
1761
|
+
]
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
"name": "ProtocolFeesCollected",
|
|
1765
|
+
"discriminator": [
|
|
1766
|
+
165,
|
|
1767
|
+
34,
|
|
1768
|
+
125,
|
|
1769
|
+
155,
|
|
1770
|
+
15,
|
|
1771
|
+
86,
|
|
1772
|
+
99,
|
|
1773
|
+
191
|
|
1774
|
+
]
|
|
1775
|
+
},
|
|
1776
|
+
{
|
|
1777
|
+
"name": "RangeManagerConfigSet",
|
|
1778
|
+
"discriminator": [
|
|
1779
|
+
187,
|
|
1780
|
+
59,
|
|
1781
|
+
98,
|
|
1782
|
+
47,
|
|
1783
|
+
108,
|
|
1784
|
+
2,
|
|
1785
|
+
229,
|
|
1786
|
+
152
|
|
1787
|
+
]
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
"name": "RangeManagerSet",
|
|
1791
|
+
"discriminator": [
|
|
1792
|
+
62,
|
|
1793
|
+
152,
|
|
1794
|
+
235,
|
|
1795
|
+
91,
|
|
1796
|
+
195,
|
|
1797
|
+
238,
|
|
1798
|
+
83,
|
|
1799
|
+
202
|
|
1800
|
+
]
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
"name": "RangeManagerUpdated",
|
|
1804
|
+
"discriminator": [
|
|
1805
|
+
132,
|
|
1806
|
+
144,
|
|
1807
|
+
100,
|
|
1808
|
+
144,
|
|
1809
|
+
149,
|
|
1810
|
+
205,
|
|
1811
|
+
212,
|
|
1812
|
+
24
|
|
1813
|
+
]
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
"name": "Swap",
|
|
1817
|
+
"discriminator": [
|
|
1818
|
+
81,
|
|
1819
|
+
108,
|
|
1820
|
+
227,
|
|
1821
|
+
190,
|
|
1822
|
+
205,
|
|
1823
|
+
208,
|
|
1824
|
+
10,
|
|
1825
|
+
196
|
|
1826
|
+
]
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
"name": "SwapFeeRateUpdated",
|
|
1830
|
+
"discriminator": [
|
|
1831
|
+
101,
|
|
1832
|
+
132,
|
|
1833
|
+
24,
|
|
1834
|
+
255,
|
|
1835
|
+
91,
|
|
1836
|
+
253,
|
|
1837
|
+
227,
|
|
1838
|
+
101
|
|
1839
|
+
]
|
|
1840
|
+
},
|
|
1841
|
+
{
|
|
1842
|
+
"name": "SwapsEnabledUpdated",
|
|
1843
|
+
"discriminator": [
|
|
1844
|
+
55,
|
|
1845
|
+
116,
|
|
1846
|
+
118,
|
|
1847
|
+
138,
|
|
1848
|
+
102,
|
|
1849
|
+
26,
|
|
1850
|
+
227,
|
|
1851
|
+
223
|
|
1852
|
+
]
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
"name": "TokenActiveSet",
|
|
1856
|
+
"discriminator": [
|
|
1857
|
+
168,
|
|
1858
|
+
221,
|
|
1859
|
+
25,
|
|
1860
|
+
146,
|
|
1861
|
+
234,
|
|
1862
|
+
230,
|
|
1863
|
+
232,
|
|
1864
|
+
100
|
|
1865
|
+
]
|
|
1866
|
+
}
|
|
1867
|
+
],
|
|
1868
|
+
"errors": [
|
|
1869
|
+
{
|
|
1870
|
+
"code": 6000,
|
|
1871
|
+
"name": "InvalidTokenCount",
|
|
1872
|
+
"msg": "Invalid token count. Must be between 2 and 10"
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
"code": 6001,
|
|
1876
|
+
"name": "InvalidTokenIndex",
|
|
1877
|
+
"msg": "Invalid token index"
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
"code": 6002,
|
|
1881
|
+
"name": "InvalidWeights",
|
|
1882
|
+
"msg": "Invalid weights. Must sum to 10000 (WEIGHT_SCALE)"
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
"code": 6003,
|
|
1886
|
+
"name": "InvalidVirtualBalances",
|
|
1887
|
+
"msg": "Invalid virtual balances. Must be greater than zero"
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
"code": 6004,
|
|
1891
|
+
"name": "InsufficientLiquidity",
|
|
1892
|
+
"msg": "Insufficient liquidity in the pool"
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
"code": 6005,
|
|
1896
|
+
"name": "SlippageExceeded",
|
|
1897
|
+
"msg": "Slippage tolerance exceeded"
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
"code": 6006,
|
|
1901
|
+
"name": "InvalidAmounts",
|
|
1902
|
+
"msg": "Invalid amounts provided"
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
"code": 6007,
|
|
1906
|
+
"name": "InsufficientBptOut",
|
|
1907
|
+
"msg": "Insufficient BPT minted"
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
"code": 6008,
|
|
1911
|
+
"name": "InsufficientTokensOut",
|
|
1912
|
+
"msg": "Insufficient tokens received"
|
|
1913
|
+
},
|
|
1914
|
+
{
|
|
1915
|
+
"code": 6009,
|
|
1916
|
+
"name": "FeeRateMaxExceeded",
|
|
1917
|
+
"msg": "Fee rate exceeds maximum"
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
"code": 6010,
|
|
1921
|
+
"name": "ProtocolFeeRateMaxExceeded",
|
|
1922
|
+
"msg": "Protocol fee rate exceeds maximum"
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
"code": 6011,
|
|
1926
|
+
"name": "MathOverflow",
|
|
1927
|
+
"msg": "Math overflow"
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
"code": 6012,
|
|
1931
|
+
"name": "MathUnderflow",
|
|
1932
|
+
"msg": "Math underflow"
|
|
1933
|
+
},
|
|
1934
|
+
{
|
|
1935
|
+
"code": 6013,
|
|
1936
|
+
"name": "DivisionByZero",
|
|
1937
|
+
"msg": "Division by zero"
|
|
1938
|
+
},
|
|
1939
|
+
{
|
|
1940
|
+
"code": 6014,
|
|
1941
|
+
"name": "TokenMintMismatch",
|
|
1942
|
+
"msg": "Token mint mismatch"
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
"code": 6015,
|
|
1946
|
+
"name": "InvalidTokenDecimals",
|
|
1947
|
+
"msg": "Invalid token decimals"
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
"code": 6016,
|
|
1951
|
+
"name": "AmountOutExceedsBalance",
|
|
1952
|
+
"msg": "Amount out exceeds available balance"
|
|
1953
|
+
},
|
|
1954
|
+
{
|
|
1955
|
+
"code": 6017,
|
|
1956
|
+
"name": "InvalidBptAmount",
|
|
1957
|
+
"msg": "Invalid BPT amount"
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
"code": 6018,
|
|
1961
|
+
"name": "Unauthorized",
|
|
1962
|
+
"msg": "Unauthorized"
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
"code": 6019,
|
|
1966
|
+
"name": "InvalidMint",
|
|
1967
|
+
"msg": "Invalid mint account"
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
"code": 6020,
|
|
1971
|
+
"name": "PoolDisabled",
|
|
1972
|
+
"msg": "Pool is disabled. No operations allowed."
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
"code": 6021,
|
|
1976
|
+
"name": "SwapsDisabled",
|
|
1977
|
+
"msg": "Swaps are disabled for this pool."
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
"code": 6022,
|
|
1981
|
+
"name": "PoolMustBeDisabled",
|
|
1982
|
+
"msg": "Pool must be disabled before debug operations."
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
"code": 6023,
|
|
1986
|
+
"name": "ZeroAmount",
|
|
1987
|
+
"msg": "Amount must be greater than zero"
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
"code": 6024,
|
|
1991
|
+
"name": "ZeroFeeAmount",
|
|
1992
|
+
"msg": "Swap amount is too small: fee rounds to zero"
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"code": 6025,
|
|
1996
|
+
"name": "BannedExtension",
|
|
1997
|
+
"msg": "Token mint has a banned Token-2022 extension"
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
"code": 6026,
|
|
2001
|
+
"name": "TokenProgramMismatch",
|
|
2002
|
+
"msg": "Token program does not match pool's token program"
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
"code": 6027,
|
|
2006
|
+
"name": "UserTokenAccountOwnerMismatch",
|
|
2007
|
+
"msg": "User token account owner mismatch"
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
"code": 6028,
|
|
2011
|
+
"name": "InitialLiquidityTooSmall",
|
|
2012
|
+
"msg": "Initial liquidity too small - pool would be bricked"
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
"code": 6029,
|
|
2016
|
+
"name": "InvalidTokenProgram",
|
|
2017
|
+
"msg": "Invalid token program - must be SPL Token or Token-2022"
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
"code": 6030,
|
|
2021
|
+
"name": "InvalidVault",
|
|
2022
|
+
"msg": "Invalid vault account"
|
|
2023
|
+
},
|
|
2024
|
+
{
|
|
2025
|
+
"code": 6031,
|
|
2026
|
+
"name": "InvalidSourceOwner",
|
|
2027
|
+
"msg": "Source account must be owned by this program"
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
"code": 6032,
|
|
2031
|
+
"name": "WouldBreakRentExempt",
|
|
2032
|
+
"msg": "Withdrawal would break rent exemption"
|
|
2033
|
+
},
|
|
2034
|
+
{
|
|
2035
|
+
"code": 6033,
|
|
2036
|
+
"name": "PoolAdminDisabled",
|
|
2037
|
+
"msg": "Pool admin is disabled"
|
|
2038
|
+
},
|
|
2039
|
+
{
|
|
2040
|
+
"code": 6034,
|
|
2041
|
+
"name": "ProtocolAdminUnset",
|
|
2042
|
+
"msg": "Protocol admin is unset"
|
|
2043
|
+
},
|
|
2044
|
+
{
|
|
2045
|
+
"code": 6035,
|
|
2046
|
+
"name": "NoPendingAdmin",
|
|
2047
|
+
"msg": "No pending admin transfer"
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
"code": 6036,
|
|
2051
|
+
"name": "NotPendingAdmin",
|
|
2052
|
+
"msg": "Signer is not the pending admin"
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"code": 6037,
|
|
2056
|
+
"name": "InvalidPendingAdmin",
|
|
2057
|
+
"msg": "Pending admin cannot be the zero pubkey"
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
"code": 6038,
|
|
2061
|
+
"name": "ProtocolAdminNotTreasury",
|
|
2062
|
+
"msg": "Deprecated: config admin is now pinned by account constraints, not this check"
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
"code": 6039,
|
|
2066
|
+
"name": "RangeManagerDisabled",
|
|
2067
|
+
"msg": "Range manager is not enabled for this pool"
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
"code": 6040,
|
|
2071
|
+
"name": "RangeManagerUnauthorized",
|
|
2072
|
+
"msg": "Signer is not the configured range manager"
|
|
2073
|
+
},
|
|
2074
|
+
{
|
|
2075
|
+
"code": 6041,
|
|
2076
|
+
"name": "RangeManagerUpdateTooFrequent",
|
|
2077
|
+
"msg": "Range manager update too frequent — minimum interval not yet elapsed"
|
|
2078
|
+
},
|
|
2079
|
+
{
|
|
2080
|
+
"code": 6042,
|
|
2081
|
+
"name": "RangeManagerVbChangeTooLarge",
|
|
2082
|
+
"msg": "Range manager virtual balance change exceeds configured percent cap"
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
"code": 6043,
|
|
2086
|
+
"name": "RangeManagerWeightChangeTooLarge",
|
|
2087
|
+
"msg": "Range manager weight change exceeds configured percent cap"
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
"code": 6044,
|
|
2091
|
+
"name": "RangeManagerEmptyUpdate",
|
|
2092
|
+
"msg": "Range manager update must change at least one virtual balance or weight"
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
"code": 6045,
|
|
2096
|
+
"name": "RangeManagerInvalidPct",
|
|
2097
|
+
"msg": "Range manager percent parameter exceeds 10000"
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
"code": 6046,
|
|
2101
|
+
"name": "RangeManagerWeightSumInvalid",
|
|
2102
|
+
"msg": "Resulting weights do not sum to WEIGHT_SCALE after range manager update"
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
"code": 6047,
|
|
2106
|
+
"name": "RangeManagerDuplicateIndex",
|
|
2107
|
+
"msg": "Duplicate token index in range manager update"
|
|
2108
|
+
},
|
|
2109
|
+
{
|
|
2110
|
+
"code": 6048,
|
|
2111
|
+
"name": "MaxSelloffInvalidConfig",
|
|
2112
|
+
"msg": "max_selloff_period_length must be > 0 when max_selloff > 0"
|
|
2113
|
+
},
|
|
2114
|
+
{
|
|
2115
|
+
"code": 6049,
|
|
2116
|
+
"name": "MaxSelloffExceeded",
|
|
2117
|
+
"msg": "Token max-selloff threshold exceeded for current window"
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
"code": 6050,
|
|
2121
|
+
"name": "AltAlreadyInitialized",
|
|
2122
|
+
"msg": "Pool already has an Address Lookup Table initialised"
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
"code": 6051,
|
|
2126
|
+
"name": "AltAddressMismatch",
|
|
2127
|
+
"msg": "ALT address mismatch — re-derived from recent_slot doesn't match passed account"
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
"code": 6052,
|
|
2131
|
+
"name": "InvalidAltProgram",
|
|
2132
|
+
"msg": "Invalid Address Lookup Table program id"
|
|
2133
|
+
},
|
|
2134
|
+
{
|
|
2135
|
+
"code": 6053,
|
|
2136
|
+
"name": "InvalidSurgeFeeConfig",
|
|
2137
|
+
"msg": "Invalid surge fee curve config"
|
|
2138
|
+
},
|
|
2139
|
+
{
|
|
2140
|
+
"code": 6054,
|
|
2141
|
+
"name": "TokenInactive",
|
|
2142
|
+
"msg": "Token is deactivated for swaps on the input side"
|
|
2143
|
+
},
|
|
2144
|
+
{
|
|
2145
|
+
"code": 6055,
|
|
2146
|
+
"name": "UnsupportedExtension",
|
|
2147
|
+
"msg": "Mint has an unsupported Token-2022 extension"
|
|
2148
|
+
},
|
|
2149
|
+
{
|
|
2150
|
+
"code": 6056,
|
|
2151
|
+
"name": "MemoProgramMissing",
|
|
2152
|
+
"msg": "Destination requires a memo; pass the SPL Memo program account"
|
|
2153
|
+
},
|
|
2154
|
+
{
|
|
2155
|
+
"code": 6057,
|
|
2156
|
+
"name": "TransferFeeCalculationMismatch",
|
|
2157
|
+
"msg": "Transfer fee round-trip verification failed"
|
|
2158
|
+
},
|
|
2159
|
+
{
|
|
2160
|
+
"code": 6058,
|
|
2161
|
+
"name": "AmountFullyConsumedByTransferFee",
|
|
2162
|
+
"msg": "Deposit amount is fully consumed by the token transfer fee"
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
"code": 6059,
|
|
2166
|
+
"name": "SeedDepositNotPoolAdmin",
|
|
2167
|
+
"msg": "Only the pool admin may make the pool's first (seed) deposit"
|
|
2168
|
+
},
|
|
2169
|
+
{
|
|
2170
|
+
"code": 6060,
|
|
2171
|
+
"name": "StldTokenExtensionsUnsupported",
|
|
2172
|
+
"msg": "Deprecated: see single-token-liquidity's own TokenExtensionsUnsupported"
|
|
2173
|
+
},
|
|
2174
|
+
{
|
|
2175
|
+
"code": 6061,
|
|
2176
|
+
"name": "RangeManagerStaleValue",
|
|
2177
|
+
"msg": "Range manager update is stale — expected_current does not match stored value"
|
|
2178
|
+
},
|
|
2179
|
+
{
|
|
2180
|
+
"code": 6062,
|
|
2181
|
+
"name": "RangeManagerLeverageBandExceeded",
|
|
2182
|
+
"msg": "Range manager update exceeds the configured leverage band"
|
|
2183
|
+
},
|
|
2184
|
+
{
|
|
2185
|
+
"code": 6063,
|
|
2186
|
+
"name": "RangeManagerOverrideMustDisable",
|
|
2187
|
+
"msg": "Protocol-admin range-manager override may only disable, not appoint"
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
"code": 6064,
|
|
2191
|
+
"name": "InvalidArrayLength",
|
|
2192
|
+
"msg": "Array length does not match the pool's token count"
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
"code": 6065,
|
|
2196
|
+
"name": "FirstDepositRequiresNonzero",
|
|
2197
|
+
"msg": "First deposit must fund at least one token"
|
|
2198
|
+
},
|
|
2199
|
+
{
|
|
2200
|
+
"code": 6066,
|
|
2201
|
+
"name": "TokenLivenessMismatch",
|
|
2202
|
+
"msg": "Deposit would change a token's live/sidelined state"
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
"code": 6067,
|
|
2206
|
+
"name": "DepositTooSmall",
|
|
2207
|
+
"msg": "Deposit is too small to mint any BPT"
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
"code": 6068,
|
|
2211
|
+
"name": "PoolNotSeeded",
|
|
2212
|
+
"msg": "Pool holds no liquidity: every actual_balance is zero"
|
|
2213
|
+
}
|
|
2214
|
+
],
|
|
2215
|
+
"types": [
|
|
2216
|
+
{
|
|
2217
|
+
"name": "AssetConfig",
|
|
2218
|
+
"docs": [
|
|
2219
|
+
"`CubicPool` v4 — per-pool state for a weighted AMM with virtual liquidity.",
|
|
2220
|
+
"",
|
|
2221
|
+
"Storage layout: **Array-of-Structs (AoS)**. Per-token data lives in",
|
|
2222
|
+
"`tokens: [TokenSlot; MAX_TOKENS]`. Each `TokenSlot` carries TWO nested",
|
|
2223
|
+
"sub-structs:",
|
|
2224
|
+
"",
|
|
2225
|
+
"- `config: AssetConfig` — admin-controlled, rarely changes (mint,",
|
|
2226
|
+
"token_program, weight, max_selloff, period).",
|
|
2227
|
+
"- `dynamics: AssetDynamics` — auto-updated by user txs (balances,",
|
|
2228
|
+
"protocol_fees_owed, sliding-window selloff state).",
|
|
2229
|
+
"",
|
|
2230
|
+
"This mirrors Solend / MarginFi / Kamino's `Reserve { config, ... }`",
|
|
2231
|
+
"pattern. Reading per-token data is a single struct lookup; auditors",
|
|
2232
|
+
"see at a glance which fields a user can mutate vs which need pool",
|
|
2233
|
+
"admin authority.",
|
|
2234
|
+
"",
|
|
2235
|
+
"## Storage layout — DO NOT REORDER",
|
|
2236
|
+
"Backends (`onchainPoolFetcher.ts`, indexer) read fields by raw offset.",
|
|
2237
|
+
"Adding fields is OK if appended at the END (before the trailing",
|
|
2238
|
+
"`reserved`) and `reserved` shrinks accordingly. Inserting in the",
|
|
2239
|
+
"middle would require rewriting existing accounts.",
|
|
2240
|
+
"",
|
|
2241
|
+
"## Derived (not stored) state",
|
|
2242
|
+
"- `bpt_mint` — derived as `[BPT_MINT_SEED, pool]` PDA.",
|
|
2243
|
+
"- `bpt_total_supply`— read from `bpt_mint.supply` at runtime.",
|
|
2244
|
+
"- `token_vaults[i]` — derived as ATA(pool, mint, tokens[i].config.token_program).",
|
|
2245
|
+
"- `token_decimals` — read from each mint account at runtime."
|
|
2246
|
+
],
|
|
2247
|
+
"type": {
|
|
2248
|
+
"kind": "struct",
|
|
2249
|
+
"fields": [
|
|
2250
|
+
{
|
|
2251
|
+
"name": "mint",
|
|
2252
|
+
"docs": [
|
|
2253
|
+
"Token mint pubkey for this slot. `Pubkey::default()` past `token_count`."
|
|
2254
|
+
],
|
|
2255
|
+
"type": "pubkey"
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
"name": "token_program",
|
|
2259
|
+
"docs": [
|
|
2260
|
+
"SPL Token or Token-2022 program ID for this token's vault/transfers."
|
|
2261
|
+
],
|
|
2262
|
+
"type": "pubkey"
|
|
2263
|
+
},
|
|
2264
|
+
{
|
|
2265
|
+
"name": "normalized_weight",
|
|
2266
|
+
"docs": [
|
|
2267
|
+
"Normalised weight in basis points (sum across active slots == 10_000)."
|
|
2268
|
+
],
|
|
2269
|
+
"type": "u64"
|
|
2270
|
+
},
|
|
2271
|
+
{
|
|
2272
|
+
"name": "max_selloff_pct",
|
|
2273
|
+
"docs": [
|
|
2274
|
+
"Max cumulative sell volume of this token per sliding window,",
|
|
2275
|
+
"expressed as a **percentage of the token's `virtual_balance`**",
|
|
2276
|
+
"captured at window start, in units of `PERCENT_SCALE` (10_000 =",
|
|
2277
|
+
"100%, so 1000 = 10%; resolution 0.01%). `0` disables the check for",
|
|
2278
|
+
"this token. Must be `<= PERCENT_SCALE`. Set by pool_admin only.",
|
|
2279
|
+
"",
|
|
2280
|
+
"The absolute cap for a window is `floor(max_selloff_pct *",
|
|
2281
|
+
"vb_snapshot / PERCENT_SCALE)`, where `vb_snapshot` is",
|
|
2282
|
+
"`AssetDynamics::selloff_vb_snapshot` (taken at window open). Using a",
|
|
2283
|
+
"per-window snapshot — not the live `virtual_balance` — prevents an",
|
|
2284
|
+
"in-window base-inflation bypass (see `math::max_selloff`)."
|
|
2285
|
+
],
|
|
2286
|
+
"type": "u16"
|
|
2287
|
+
},
|
|
2288
|
+
{
|
|
2289
|
+
"name": "max_selloff_period_length",
|
|
2290
|
+
"docs": [
|
|
2291
|
+
"Length of the sliding window in seconds. Ignored when",
|
|
2292
|
+
"`max_selloff_pct == 0`. Set by pool_admin only."
|
|
2293
|
+
],
|
|
2294
|
+
"type": "u32"
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
"name": "variable_fee_threshold_pct",
|
|
2298
|
+
"docs": [
|
|
2299
|
+
"Variable sell-off **surge fee** curve (per token, `PERCENT_SCALE`",
|
|
2300
|
+
"units; 10_000 = 100%). The fee rises as the token's max-selloff",
|
|
2301
|
+
"window fills and is charged on `amount_out`, routed 100% to the",
|
|
2302
|
+
"protocol bucket (`protocol_fees_owed`), never to LPs. See",
|
|
2303
|
+
"`math::surge_fee`. The fee is active only when `max_selloff_pct > 0`",
|
|
2304
|
+
"(it reads the window fill ratio) AND `fee_slope_high_pct > 0`.",
|
|
2305
|
+
"",
|
|
2306
|
+
"Window fill ratio at which the surge fee starts (below it the fee is",
|
|
2307
|
+
"0). E.g. 8000 = surge begins at 80% window fill."
|
|
2308
|
+
],
|
|
2309
|
+
"type": "u16"
|
|
2310
|
+
},
|
|
2311
|
+
{
|
|
2312
|
+
"name": "variable_fee_slope_low_pct",
|
|
2313
|
+
"docs": [
|
|
2314
|
+
"Surge fee at the threshold (lower point of the curve)."
|
|
2315
|
+
],
|
|
2316
|
+
"type": "u16"
|
|
2317
|
+
},
|
|
2318
|
+
{
|
|
2319
|
+
"name": "variable_fee_slope_high_pct",
|
|
2320
|
+
"docs": [
|
|
2321
|
+
"Surge fee at ~100% window fill (upper point of the curve). Must be",
|
|
2322
|
+
"`>= fee_slope_low_pct` and `<= PERCENT_SCALE`."
|
|
2323
|
+
],
|
|
2324
|
+
"type": "u16"
|
|
2325
|
+
},
|
|
2326
|
+
{
|
|
2327
|
+
"name": "is_active",
|
|
2328
|
+
"docs": [
|
|
2329
|
+
"Per-token kill switch for the **input** side of swaps. When `false`,",
|
|
2330
|
+
"swaps whose INPUT token is this one revert (`TokenInactive`); the",
|
|
2331
|
+
"token can still be bought (as swap output) and liquidity ops are",
|
|
2332
|
+
"unaffected. Defaults to `true` (active). Flipped by `set_token_active`",
|
|
2333
|
+
"(pool-admin or protocol-admin/supervisor). Used to stop accepting a",
|
|
2334
|
+
"compromised token without pausing the whole pool."
|
|
2335
|
+
],
|
|
2336
|
+
"type": "bool"
|
|
2337
|
+
},
|
|
2338
|
+
{
|
|
2339
|
+
"name": "variable_fee_slope_mid_pct",
|
|
2340
|
+
"docs": [
|
|
2341
|
+
"Surge fee at the KINK — the middle of the three points that define the",
|
|
2342
|
+
"curve. Between `variable_fee_threshold_pct` and this point the fee runs",
|
|
2343
|
+
"linearly from `variable_fee_slope_low_pct` to here; beyond it, linearly",
|
|
2344
|
+
"from here to `variable_fee_slope_high_pct` at full window fill.",
|
|
2345
|
+
"",
|
|
2346
|
+
"This is the \"target utilisation\" shape lending protocols use (Evaa,",
|
|
2347
|
+
"Aave, Compound): gentle while the window fills normally, steep once it",
|
|
2348
|
+
"is nearly exhausted. Must satisfy",
|
|
2349
|
+
"`slope_low <= slope_mid <= slope_high` — a fee that fell as the window",
|
|
2350
|
+
"filled would invert the brake."
|
|
2351
|
+
],
|
|
2352
|
+
"type": "u16"
|
|
2353
|
+
},
|
|
2354
|
+
{
|
|
2355
|
+
"name": "variable_fee_kink_pct",
|
|
2356
|
+
"docs": [
|
|
2357
|
+
"Window fill at which the curve kinks, in WHOLE PERCENT (0..=100), not",
|
|
2358
|
+
"`PERCENT_SCALE` units — one byte is all that was left, and 1% is ample",
|
|
2359
|
+
"resolution for a breakpoint.",
|
|
2360
|
+
"",
|
|
2361
|
+
"`0` means \"no kink\": the curve degenerates to a single straight line",
|
|
2362
|
+
"from `slope_low` at the threshold to `slope_high` at full fill, which",
|
|
2363
|
+
"is what every pool written by the previous layout decodes as.",
|
|
2364
|
+
"",
|
|
2365
|
+
"Must sit strictly between the threshold and full fill when set."
|
|
2366
|
+
],
|
|
2367
|
+
"type": "u8"
|
|
2368
|
+
}
|
|
2369
|
+
]
|
|
2370
|
+
}
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
"name": "AssetDynamics",
|
|
2374
|
+
"type": {
|
|
2375
|
+
"kind": "struct",
|
|
2376
|
+
"fields": [
|
|
2377
|
+
{
|
|
2378
|
+
"name": "virtual_balance",
|
|
2379
|
+
"docs": [
|
|
2380
|
+
"Virtual balance (raw token units) used by the cubic invariant",
|
|
2381
|
+
"math. Decoupled from `actual_balance` to enable concentrated",
|
|
2382
|
+
"liquidity. Updated by swap / add_liquidity / remove_liquidity."
|
|
2383
|
+
],
|
|
2384
|
+
"type": "u64"
|
|
2385
|
+
},
|
|
2386
|
+
{
|
|
2387
|
+
"name": "actual_balance",
|
|
2388
|
+
"docs": [
|
|
2389
|
+
"The LP-owned portion of this token's vault, in raw units.",
|
|
2390
|
+
"",
|
|
2391
|
+
"It does NOT equal the vault's `amount`. The invariant is",
|
|
2392
|
+
"`vault.amount == actual_balance + protocol_fees_owed`: protocol fees",
|
|
2393
|
+
"sit in the same vault but are not LP capital, and `collect_protocol_fees`",
|
|
2394
|
+
"pays them out without touching `actual_balance`. Sizing a withdrawal or",
|
|
2395
|
+
"a deposit ratio against the raw vault balance would therefore hand LPs",
|
|
2396
|
+
"the protocol's uncollected fees.",
|
|
2397
|
+
"",
|
|
2398
|
+
"Reads of the vault should either use this field or subtract",
|
|
2399
|
+
"`protocol_fees_owed` explicitly; the two are only equal on a pool whose",
|
|
2400
|
+
"fees have just been collected."
|
|
2401
|
+
],
|
|
2402
|
+
"type": "u64"
|
|
2403
|
+
},
|
|
2404
|
+
{
|
|
2405
|
+
"name": "protocol_fees_owed",
|
|
2406
|
+
"docs": [
|
|
2407
|
+
"Accumulated protocol fees for this token (raw units), awaiting",
|
|
2408
|
+
"`collect_protocol_fees`. Stored separately from `actual_balance`",
|
|
2409
|
+
"so LP value isn't diluted by uncollected fees."
|
|
2410
|
+
],
|
|
2411
|
+
"type": "u64"
|
|
2412
|
+
},
|
|
2413
|
+
{
|
|
2414
|
+
"name": "previous_selloff",
|
|
2415
|
+
"docs": [
|
|
2416
|
+
"Sliding-window rate limiter: amount sold in the PREVIOUS window",
|
|
2417
|
+
"(Cloudflare-style approximation, Solend RateLimiter pattern)."
|
|
2418
|
+
],
|
|
2419
|
+
"type": "u64"
|
|
2420
|
+
},
|
|
2421
|
+
{
|
|
2422
|
+
"name": "current_selloff",
|
|
2423
|
+
"docs": [
|
|
2424
|
+
"Amount sold in the CURRENT window."
|
|
2425
|
+
],
|
|
2426
|
+
"type": "u64"
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
"name": "window_start_timestamp",
|
|
2430
|
+
"docs": [
|
|
2431
|
+
"`Clock::unix_timestamp` when the current window started. Set to",
|
|
2432
|
+
"`now()` at pool init."
|
|
2433
|
+
],
|
|
2434
|
+
"type": "i64"
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
"name": "selloff_vb_snapshot",
|
|
2438
|
+
"docs": [
|
|
2439
|
+
"Snapshot of this token's `virtual_balance` taken when the current",
|
|
2440
|
+
"max-selloff window opened. The window's absolute cap is",
|
|
2441
|
+
"`floor(config.max_selloff_pct * selloff_vb_snapshot / PERCENT_SCALE)`.",
|
|
2442
|
+
"Snapshotting (rather than reading live `virtual_balance`) keeps the",
|
|
2443
|
+
"cap un-inflatable within a window — selling raises the live vb, but",
|
|
2444
|
+
"not this snapshot. `0` ⇒ uninitialised (re-captured on next check)."
|
|
2445
|
+
],
|
|
2446
|
+
"type": "u64"
|
|
2447
|
+
}
|
|
2448
|
+
]
|
|
2449
|
+
}
|
|
2450
|
+
},
|
|
2451
|
+
{
|
|
2452
|
+
"name": "BannedExtensionsUpdated",
|
|
2453
|
+
"docs": [
|
|
2454
|
+
"Emitted by `set_banned_extensions`. Off-chain validators use this to",
|
|
2455
|
+
"refresh the cached blocklist without rereading the config account."
|
|
2456
|
+
],
|
|
2457
|
+
"type": {
|
|
2458
|
+
"kind": "struct",
|
|
2459
|
+
"fields": [
|
|
2460
|
+
{
|
|
2461
|
+
"name": "config",
|
|
2462
|
+
"type": "pubkey"
|
|
2463
|
+
},
|
|
2464
|
+
{
|
|
2465
|
+
"name": "authority",
|
|
2466
|
+
"type": "pubkey"
|
|
2467
|
+
},
|
|
2468
|
+
{
|
|
2469
|
+
"name": "old_value",
|
|
2470
|
+
"type": "u64"
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
"name": "new_value",
|
|
2474
|
+
"type": "u64"
|
|
2475
|
+
},
|
|
2476
|
+
{
|
|
2477
|
+
"name": "timestamp",
|
|
2478
|
+
"type": "i64"
|
|
2479
|
+
},
|
|
2480
|
+
{
|
|
2481
|
+
"name": "old_hard_value",
|
|
2482
|
+
"docs": [
|
|
2483
|
+
"Before/after of the non-overridable floor a pool creator cannot",
|
|
2484
|
+
"clear. Appended (wire append-only)."
|
|
2485
|
+
],
|
|
2486
|
+
"type": "u64"
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
"name": "new_hard_value",
|
|
2490
|
+
"type": "u64"
|
|
2491
|
+
}
|
|
2492
|
+
]
|
|
2493
|
+
}
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
"name": "ConfigInitialized",
|
|
2497
|
+
"docs": [
|
|
2498
|
+
"Emitted at the end of `initialize_config`. Marks a new `CubicPoolConfig`",
|
|
2499
|
+
"account live, with `protocol_admin` pinned to the Treasury PDA.",
|
|
2500
|
+
"",
|
|
2501
|
+
"`initialize_config` creates the account from scratch, so there are no",
|
|
2502
|
+
"\"old\" values to carry — every field is reported as its initial value.",
|
|
2503
|
+
"",
|
|
2504
|
+
"# Fields",
|
|
2505
|
+
"* `config` — the new config PDA pubkey",
|
|
2506
|
+
"* `protocol_admin` — Treasury PDA the config is pinned to",
|
|
2507
|
+
"* `default_protocol_fee_rate` — seeded onto every pool from this config",
|
|
2508
|
+
"* `banned_extensions` — initial Token-2022 extension blocklist",
|
|
2509
|
+
"* `payer` — account that paid rent / signed init",
|
|
2510
|
+
"* `timestamp` — `Clock::unix_timestamp` at init"
|
|
2511
|
+
],
|
|
2512
|
+
"type": {
|
|
2513
|
+
"kind": "struct",
|
|
2514
|
+
"fields": [
|
|
2515
|
+
{
|
|
2516
|
+
"name": "config",
|
|
2517
|
+
"type": "pubkey"
|
|
2518
|
+
},
|
|
2519
|
+
{
|
|
2520
|
+
"name": "protocol_admin",
|
|
2521
|
+
"type": "pubkey"
|
|
2522
|
+
},
|
|
2523
|
+
{
|
|
2524
|
+
"name": "default_protocol_fee_rate",
|
|
2525
|
+
"type": "u16"
|
|
2526
|
+
},
|
|
2527
|
+
{
|
|
2528
|
+
"name": "banned_extensions",
|
|
2529
|
+
"type": "u64"
|
|
2530
|
+
},
|
|
2531
|
+
{
|
|
2532
|
+
"name": "payer",
|
|
2533
|
+
"type": "pubkey"
|
|
2534
|
+
},
|
|
2535
|
+
{
|
|
2536
|
+
"name": "timestamp",
|
|
2537
|
+
"type": "i64"
|
|
2538
|
+
}
|
|
2539
|
+
]
|
|
2540
|
+
}
|
|
2541
|
+
},
|
|
2542
|
+
{
|
|
2543
|
+
"name": "CubicPool",
|
|
2544
|
+
"type": {
|
|
2545
|
+
"kind": "struct",
|
|
2546
|
+
"fields": [
|
|
2547
|
+
{
|
|
2548
|
+
"name": "config",
|
|
2549
|
+
"docs": [
|
|
2550
|
+
"`CubicPoolConfig` this pool inherits governance from. Pinned at",
|
|
2551
|
+
"init, used both as a PDA seed and at runtime in admin-instruction",
|
|
2552
|
+
"constraints (`pool.config == config.key()`)."
|
|
2553
|
+
],
|
|
2554
|
+
"type": "pubkey"
|
|
2555
|
+
},
|
|
2556
|
+
{
|
|
2557
|
+
"name": "bump",
|
|
2558
|
+
"docs": [
|
|
2559
|
+
"Bump seed for the pool PDA. Stored so signer-seed reconstruction is",
|
|
2560
|
+
"O(1) instead of an expensive `find_program_address` per CPI."
|
|
2561
|
+
],
|
|
2562
|
+
"type": "u8"
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
"name": "token_count",
|
|
2566
|
+
"docs": [
|
|
2567
|
+
"Number of active tokens in the pool, in [MIN_TOKENS, MAX_TOKENS] =",
|
|
2568
|
+
"[2, 10]. Slots beyond `token_count` are zeroed and ignored."
|
|
2569
|
+
],
|
|
2570
|
+
"type": "u8"
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
"name": "pool_id",
|
|
2574
|
+
"docs": [
|
|
2575
|
+
"User-chosen 64-bit salt baked into the PDA seeds, allowing multiple",
|
|
2576
|
+
"pools per config without re-deploying. Unique per (config, pool_id)."
|
|
2577
|
+
],
|
|
2578
|
+
"type": "u64"
|
|
2579
|
+
},
|
|
2580
|
+
{
|
|
2581
|
+
"name": "swap_fee_rate",
|
|
2582
|
+
"docs": [
|
|
2583
|
+
"Swap fee in hundredths of a basis point (precision",
|
|
2584
|
+
"`SWAP_FEE_PRECISION` = 1_000_000). 100_000 = 10% (current cap)."
|
|
2585
|
+
],
|
|
2586
|
+
"type": "u32"
|
|
2587
|
+
},
|
|
2588
|
+
{
|
|
2589
|
+
"name": "protocol_fee_rate",
|
|
2590
|
+
"docs": [
|
|
2591
|
+
"Share of each swap fee taken by the protocol, in basis points",
|
|
2592
|
+
"(precision `PROTOCOL_FEE_PRECISION` = 10_000). 5_000 = 50% (cap)."
|
|
2593
|
+
],
|
|
2594
|
+
"type": "u16"
|
|
2595
|
+
},
|
|
2596
|
+
{
|
|
2597
|
+
"name": "created_at",
|
|
2598
|
+
"docs": [
|
|
2599
|
+
"Pool creation `Clock::unix_timestamp`. Informational only."
|
|
2600
|
+
],
|
|
2601
|
+
"type": "i64"
|
|
2602
|
+
},
|
|
2603
|
+
{
|
|
2604
|
+
"name": "pool_enabled",
|
|
2605
|
+
"docs": [
|
|
2606
|
+
"Master kill switch — when `false`, swaps and add/remove liquidity",
|
|
2607
|
+
"all revert. Only `protocol_admin` can flip this."
|
|
2608
|
+
],
|
|
2609
|
+
"type": "bool"
|
|
2610
|
+
},
|
|
2611
|
+
{
|
|
2612
|
+
"name": "swaps_enabled",
|
|
2613
|
+
"docs": [
|
|
2614
|
+
"Trading switch — `false` blocks swaps but still allows LP",
|
|
2615
|
+
"add/remove. Either `pool_admin` or `config.protocol_admin` can flip."
|
|
2616
|
+
],
|
|
2617
|
+
"type": "bool"
|
|
2618
|
+
},
|
|
2619
|
+
{
|
|
2620
|
+
"name": "pool_admin",
|
|
2621
|
+
"docs": [
|
|
2622
|
+
"Per-pool admin. Owns: rotate swap_fee_rate, toggle swaps_enabled,",
|
|
2623
|
+
"set range_manager, set max_selloff, transfer/disable itself."
|
|
2624
|
+
],
|
|
2625
|
+
"type": "pubkey"
|
|
2626
|
+
},
|
|
2627
|
+
{
|
|
2628
|
+
"name": "pending_pool_admin",
|
|
2629
|
+
"docs": [
|
|
2630
|
+
"Pending successor for `pool_admin` during a 2-step transfer."
|
|
2631
|
+
],
|
|
2632
|
+
"type": "pubkey"
|
|
2633
|
+
},
|
|
2634
|
+
{
|
|
2635
|
+
"name": "range_manager",
|
|
2636
|
+
"docs": [
|
|
2637
|
+
"Pubkey allowed to call `range_manager_update`. `Pubkey::default()`",
|
|
2638
|
+
"⇒ no manager set."
|
|
2639
|
+
],
|
|
2640
|
+
"type": "pubkey"
|
|
2641
|
+
},
|
|
2642
|
+
{
|
|
2643
|
+
"name": "range_manager_enabled",
|
|
2644
|
+
"docs": [
|
|
2645
|
+
"`false` ⇒ all `range_manager_update` calls revert."
|
|
2646
|
+
],
|
|
2647
|
+
"type": "bool"
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
"name": "range_manager_max_vb_change_pct",
|
|
2651
|
+
"docs": [
|
|
2652
|
+
"Max per-update change to a token's `virtual_balance`, as a",
|
|
2653
|
+
"percentage of its current value, in `PERCENT_SCALE` units",
|
|
2654
|
+
"(10_000 = 100%; 500 = 5%). Enforced per token in",
|
|
2655
|
+
"`range_manager_update`."
|
|
2656
|
+
],
|
|
2657
|
+
"type": "u16"
|
|
2658
|
+
},
|
|
2659
|
+
{
|
|
2660
|
+
"name": "range_manager_max_weight_change_pct",
|
|
2661
|
+
"docs": [
|
|
2662
|
+
"Max per-update change to a token's `normalized_weight`, same",
|
|
2663
|
+
"`PERCENT_SCALE` units."
|
|
2664
|
+
],
|
|
2665
|
+
"type": "u16"
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
"name": "range_manager_min_update_interval_secs",
|
|
2669
|
+
"type": "u32"
|
|
2670
|
+
},
|
|
2671
|
+
{
|
|
2672
|
+
"name": "range_manager_last_updated",
|
|
2673
|
+
"type": "i64"
|
|
2674
|
+
},
|
|
2675
|
+
{
|
|
2676
|
+
"name": "tokens",
|
|
2677
|
+
"docs": [
|
|
2678
|
+
"All per-token state. Slot `i` is for the i-th token. Slots past",
|
|
2679
|
+
"`token_count` are zero-initialised and ignored."
|
|
2680
|
+
],
|
|
2681
|
+
"type": {
|
|
2682
|
+
"array": [
|
|
2683
|
+
{
|
|
2684
|
+
"defined": {
|
|
2685
|
+
"name": "TokenSlot"
|
|
2686
|
+
}
|
|
2687
|
+
},
|
|
2688
|
+
10
|
|
2689
|
+
]
|
|
2690
|
+
}
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
"name": "lookup_table",
|
|
2694
|
+
"docs": [
|
|
2695
|
+
"Per-pool Address Lookup Table address. Holds pool-scoped accounts",
|
|
2696
|
+
"(pool PDA, BPT mint, vaults, mints, token programs) so client SDKs",
|
|
2697
|
+
"can build VersionedTransactions for `add_liquidity` / `remove_liquidity`",
|
|
2698
|
+
"without hitting the 1232-byte legacy-tx ceiling on multi-token pools.",
|
|
2699
|
+
"",
|
|
2700
|
+
"`Pubkey::default()` ⇒ ALT not yet initialised. SDK falls back to",
|
|
2701
|
+
"legacy tx (will only work for small pools). Set by `initialize_pool_alt`,",
|
|
2702
|
+
"frozen on-chain so depositors don't worry about authority abuse."
|
|
2703
|
+
],
|
|
2704
|
+
"type": "pubkey"
|
|
2705
|
+
},
|
|
2706
|
+
{
|
|
2707
|
+
"name": "banned_extensions",
|
|
2708
|
+
"docs": [
|
|
2709
|
+
"Token-2022 extension blocklist that was applied to THIS pool's tokens",
|
|
2710
|
+
"at creation, in the same bit layout as",
|
|
2711
|
+
"`CubicPoolConfig.banned_extensions` (bit `i` set ⇒ extension type `i`",
|
|
2712
|
+
"is forbidden). Chosen by the pool **creator** at init: if they passed",
|
|
2713
|
+
"an explicit override it is stored verbatim; otherwise the parent",
|
|
2714
|
+
"config's default was copied here.",
|
|
2715
|
+
"",
|
|
2716
|
+
"Recorded for transparency so indexers / depositors can see exactly",
|
|
2717
|
+
"which extension policy a pool's tokens were vetted against. It is a",
|
|
2718
|
+
"snapshot only — the pool's token set is fixed at creation, so changing",
|
|
2719
|
+
"this value later would not re-validate anything.",
|
|
2720
|
+
"",
|
|
2721
|
+
"NOTE (security): the creator chooses this bitmap freely ABOVE the",
|
|
2722
|
+
"protocol floor — `constants::HARD_BANNED_EXTENSIONS`",
|
|
2723
|
+
"(`PermanentDelegate`, `TransferHook`) is OR-ed in at creation and",
|
|
2724
|
+
"cannot be cleared, so no pool can admit a mint that reaches vault",
|
|
2725
|
+
"custody. Everything else is the creator's call, so LPs should still",
|
|
2726
|
+
"read this field and decide whether they trust the remaining policy",
|
|
2727
|
+
"before depositing. Pre-existing (pre-upgrade) pools read `0` here",
|
|
2728
|
+
"until `migrate_to_v5` backfills them from the parent config."
|
|
2729
|
+
],
|
|
2730
|
+
"type": "u64"
|
|
2731
|
+
},
|
|
2732
|
+
{
|
|
2733
|
+
"name": "range_manager_max_leverage_bps",
|
|
2734
|
+
"docs": [
|
|
2735
|
+
"Absolute ceiling on `virtual_balance / actual_balance` that the range",
|
|
2736
|
+
"manager may leave a token at, in basis points (10_000 = 1.0×). `0`",
|
|
2737
|
+
"disables the band.",
|
|
2738
|
+
"",
|
|
2739
|
+
"The per-update percentage caps velocity, not distance: measured",
|
|
2740
|
+
"against the live value each call, 5% steps compound to ~2.65× in 20",
|
|
2741
|
+
"updates and ~131× in 100, so a manager — or a malfunctioning bot —",
|
|
2742
|
+
"can walk the pool price arbitrarily far using only individually legal",
|
|
2743
|
+
"moves. This band is the distance limit.",
|
|
2744
|
+
"",
|
|
2745
|
+
"Anchored to `actual_balance` rather than to a captured snapshot on",
|
|
2746
|
+
"purpose: real reserves only move when capital actually enters or",
|
|
2747
|
+
"leaves, so the baseline cannot go stale the way a stored snapshot",
|
|
2748
|
+
"does. Tokens with `actual_balance == 0` (sidelined) are exempt —",
|
|
2749
|
+
"there is no real capital to anchor against.",
|
|
2750
|
+
"",
|
|
2751
|
+
"Appended at the END (before `reserved`) per the layout rule above, so",
|
|
2752
|
+
"every pre-existing field keeps its byte offset. Pre-upgrade pools",
|
|
2753
|
+
"decode this as `0` (band disabled), which is the back-compatible",
|
|
2754
|
+
"reading."
|
|
2755
|
+
],
|
|
2756
|
+
"type": "u32"
|
|
2757
|
+
},
|
|
2758
|
+
{
|
|
2759
|
+
"name": "range_manager_min_leverage_bps",
|
|
2760
|
+
"docs": [
|
|
2761
|
+
"Lower half of the range manager's absolute envelope: the SMALLEST",
|
|
2762
|
+
"`virtual_balance / actual_balance` ratio it may leave a token at, in",
|
|
2763
|
+
"`PERCENT_SCALE` units. `0` disables the floor.",
|
|
2764
|
+
"",
|
|
2765
|
+
"The ceiling alone was not an envelope. Output is priced off VIRTUAL",
|
|
2766
|
+
"balances, so DEPRESSING a token's virtual balance makes the pool",
|
|
2767
|
+
"believe it holds less than it does, and a sale into that token moves",
|
|
2768
|
+
"the price far more than it should — the seller takes the other side's",
|
|
2769
|
+
"real reserves at a fabricated rate. Fifty individually-legal 5% steps",
|
|
2770
|
+
"took a 1M/1M pool's virtual balance down to ~77k in testing, after",
|
|
2771
|
+
"which selling 100k returned ~565k instead of ~91k. Every step passed",
|
|
2772
|
+
"the ceiling, because the ceiling only ever looks upward.",
|
|
2773
|
+
"",
|
|
2774
|
+
"Checked on the same terms as the ceiling: only over the slots a call",
|
|
2775
|
+
"actually writes, and skipped for sidelined tokens (`actual_balance ==",
|
|
2776
|
+
"0`), which have no capital to anchor a ratio against."
|
|
2777
|
+
],
|
|
2778
|
+
"type": "u32"
|
|
2779
|
+
},
|
|
2780
|
+
{
|
|
2781
|
+
"name": "reserved",
|
|
2782
|
+
"docs": [
|
|
2783
|
+
"Forward-compat padding for pool-level fields. Shrank 24 → 20 when",
|
|
2784
|
+
"`range_manager_max_leverage_bps` was carved out of it, then 20 → 16 for",
|
|
2785
|
+
"`range_manager_min_leverage_bps`, keeping `LEN` at the",
|
|
2786
|
+
"mainnet-compatible 1683."
|
|
2787
|
+
],
|
|
2788
|
+
"type": {
|
|
2789
|
+
"array": [
|
|
2790
|
+
"u8",
|
|
2791
|
+
16
|
|
2792
|
+
]
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
]
|
|
2796
|
+
}
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
"name": "CubicPoolConfig",
|
|
2800
|
+
"docs": [
|
|
2801
|
+
"`CubicPoolConfig` — protocol-level governance for every pool created",
|
|
2802
|
+
"against this account.",
|
|
2803
|
+
"",
|
|
2804
|
+
"One config can host many pools (each pool stores `config: Pubkey`).",
|
|
2805
|
+
"Per-pool admin (level-1: rotates `swap_fee_rate`, toggles `swaps_enabled`)",
|
|
2806
|
+
"lives on `CubicPool::pool_admin`. This config carries only the",
|
|
2807
|
+
"protocol-level admin (level-2) plus protocol-wide defaults."
|
|
2808
|
+
],
|
|
2809
|
+
"type": {
|
|
2810
|
+
"kind": "struct",
|
|
2811
|
+
"fields": [
|
|
2812
|
+
{
|
|
2813
|
+
"name": "protocol_admin",
|
|
2814
|
+
"docs": [
|
|
2815
|
+
"Protocol-level admin. Allowed to: pause pools, change",
|
|
2816
|
+
"`protocol_fee_rate`, collect protocol fees, drain via",
|
|
2817
|
+
"`debug_withdraw_liquidity`, update `banned_extensions`, withdraw",
|
|
2818
|
+
"SOL from program-owned accounts, and rotate itself via the",
|
|
2819
|
+
"pending/accept flow. Set to a designated authority (typically the",
|
|
2820
|
+
"Treasury PDA of the `protocol-admin` program) at config init."
|
|
2821
|
+
],
|
|
2822
|
+
"type": "pubkey"
|
|
2823
|
+
},
|
|
2824
|
+
{
|
|
2825
|
+
"name": "pending_protocol_admin",
|
|
2826
|
+
"docs": [
|
|
2827
|
+
"Pending successor for `protocol_admin` during a 2-step transfer.",
|
|
2828
|
+
"`Pubkey::default()` ⇒ no transfer in flight."
|
|
2829
|
+
],
|
|
2830
|
+
"type": "pubkey"
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
"name": "default_protocol_fee_rate",
|
|
2834
|
+
"docs": [
|
|
2835
|
+
"Default `protocol_fee_rate` (in basis points, max 5000 = 50%) seeded",
|
|
2836
|
+
"onto every new pool created against this config. Pools may diverge",
|
|
2837
|
+
"later via `set_protocol_fee_rate`."
|
|
2838
|
+
],
|
|
2839
|
+
"type": "u16"
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
"name": "banned_extensions",
|
|
2843
|
+
"docs": [
|
|
2844
|
+
"Bitmap of banned Token-2022 extension types. Bit N set ⇒ extension",
|
|
2845
|
+
"type N is rejected at pool init. Maintained by `protocol_admin` via",
|
|
2846
|
+
"`set_banned_extensions`. Defaults to `DEFAULT_BANNED_EXTENSIONS`",
|
|
2847
|
+
"(TransferFee, ConfidentialTransfer, NonTransferable, …)."
|
|
2848
|
+
],
|
|
2849
|
+
"type": "u64"
|
|
2850
|
+
},
|
|
2851
|
+
{
|
|
2852
|
+
"name": "hard_banned_extensions",
|
|
2853
|
+
"docs": [
|
|
2854
|
+
"Extension bits that **no pool creator may clear**, whatever",
|
|
2855
|
+
"`banned_extensions_override` they pass to `initialize_cubic_pool`.",
|
|
2856
|
+
"OR-ed into the effective bitmap at pool creation.",
|
|
2857
|
+
"",
|
|
2858
|
+
"`banned_extensions` above is only a *default* — a creator passing",
|
|
2859
|
+
"`Some(0)` un-bans everything, which would let a mint with",
|
|
2860
|
+
"`PermanentDelegate` (issuer can empty the vault) or an armed",
|
|
2861
|
+
"`TransferHook` (issuer can make every exit revert) into pool custody,",
|
|
2862
|
+
"with the loss landing on whoever supplied the other side.",
|
|
2863
|
+
"",
|
|
2864
|
+
"Seeded from `constants::HARD_BANNED_EXTENSIONS` at config creation",
|
|
2865
|
+
"and movable only by `protocol_admin`. It is governance state rather",
|
|
2866
|
+
"than a compile-time constant on purpose: several regulated",
|
|
2867
|
+
"stablecoins (PYUSD, USDG, AUSD) ship `PermanentDelegate` for",
|
|
2868
|
+
"compliance seizure, so listing them is a deliberate protocol",
|
|
2869
|
+
"decision about trusting a named issuer — not something a pool",
|
|
2870
|
+
"creator may self-authorise, and not something a hardcoded constant",
|
|
2871
|
+
"should decide for every deployment.",
|
|
2872
|
+
"",
|
|
2873
|
+
"Pre-upgrade configs decode this as `0`; `initialize_config` seeds it",
|
|
2874
|
+
"for new ones, and `set_banned_extensions` can set it explicitly."
|
|
2875
|
+
],
|
|
2876
|
+
"type": "u64"
|
|
2877
|
+
},
|
|
2878
|
+
{
|
|
2879
|
+
"name": "reserved",
|
|
2880
|
+
"docs": [
|
|
2881
|
+
"Forward-compatibility padding so future fields can be added without",
|
|
2882
|
+
"migrating existing config accounts. Shrank 120 → 112 when",
|
|
2883
|
+
"`hard_banned_extensions` was carved out of the tail."
|
|
2884
|
+
],
|
|
2885
|
+
"type": {
|
|
2886
|
+
"array": [
|
|
2887
|
+
"u8",
|
|
2888
|
+
112
|
|
2889
|
+
]
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
]
|
|
2893
|
+
}
|
|
2894
|
+
},
|
|
2895
|
+
{
|
|
2896
|
+
"name": "DebugLiquidityWithdrawn",
|
|
2897
|
+
"docs": [
|
|
2898
|
+
"Emitted by `debug_withdraw_liquidity`. Listening for this event is the",
|
|
2899
|
+
"canonical way for off-chain monitors to know that a pool has",
|
|
2900
|
+
"transitioned to the \"bricked\" state — `actual_balances` and",
|
|
2901
|
+
"`virtual_balances` no longer match vault holdings after this fires."
|
|
2902
|
+
],
|
|
2903
|
+
"type": {
|
|
2904
|
+
"kind": "struct",
|
|
2905
|
+
"fields": [
|
|
2906
|
+
{
|
|
2907
|
+
"name": "pool",
|
|
2908
|
+
"type": "pubkey"
|
|
2909
|
+
},
|
|
2910
|
+
{
|
|
2911
|
+
"name": "authority",
|
|
2912
|
+
"type": "pubkey"
|
|
2913
|
+
},
|
|
2914
|
+
{
|
|
2915
|
+
"name": "token_amounts",
|
|
2916
|
+
"type": {
|
|
2917
|
+
"vec": "u64"
|
|
2918
|
+
}
|
|
2919
|
+
},
|
|
2920
|
+
{
|
|
2921
|
+
"name": "timestamp",
|
|
2922
|
+
"type": "i64"
|
|
2923
|
+
}
|
|
2924
|
+
]
|
|
2925
|
+
}
|
|
2926
|
+
},
|
|
2927
|
+
{
|
|
2928
|
+
"name": "LiquidityAdded",
|
|
2929
|
+
"docs": [
|
|
2930
|
+
"Emitted by `add_liquidity` after BPT is minted.",
|
|
2931
|
+
"",
|
|
2932
|
+
"# Fields",
|
|
2933
|
+
"* `token_amounts` — what the user actually deposited (raw units, in",
|
|
2934
|
+
"pool order)",
|
|
2935
|
+
"* `bpt_amount` — BPT minted to the user"
|
|
2936
|
+
],
|
|
2937
|
+
"type": {
|
|
2938
|
+
"kind": "struct",
|
|
2939
|
+
"fields": [
|
|
2940
|
+
{
|
|
2941
|
+
"name": "pool",
|
|
2942
|
+
"type": "pubkey"
|
|
2943
|
+
},
|
|
2944
|
+
{
|
|
2945
|
+
"name": "user",
|
|
2946
|
+
"type": "pubkey"
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
"name": "token_amounts",
|
|
2950
|
+
"type": {
|
|
2951
|
+
"vec": "u64"
|
|
2952
|
+
}
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
"name": "bpt_amount",
|
|
2956
|
+
"type": "u64"
|
|
2957
|
+
},
|
|
2958
|
+
{
|
|
2959
|
+
"name": "timestamp",
|
|
2960
|
+
"type": "i64"
|
|
2961
|
+
}
|
|
2962
|
+
]
|
|
2963
|
+
}
|
|
2964
|
+
},
|
|
2965
|
+
{
|
|
2966
|
+
"name": "LiquidityRemoved",
|
|
2967
|
+
"docs": [
|
|
2968
|
+
"Emitted by `remove_liquidity` after BPT is burned. `bpt_amount` is the",
|
|
2969
|
+
"**effective** burn (capped to `total_supply - MINIMUM_INITIAL_BPT`),",
|
|
2970
|
+
"not the original request — clients reading this know exactly how much",
|
|
2971
|
+
"supply changed."
|
|
2972
|
+
],
|
|
2973
|
+
"type": {
|
|
2974
|
+
"kind": "struct",
|
|
2975
|
+
"fields": [
|
|
2976
|
+
{
|
|
2977
|
+
"name": "pool",
|
|
2978
|
+
"type": "pubkey"
|
|
2979
|
+
},
|
|
2980
|
+
{
|
|
2981
|
+
"name": "user",
|
|
2982
|
+
"type": "pubkey"
|
|
2983
|
+
},
|
|
2984
|
+
{
|
|
2985
|
+
"name": "bpt_amount",
|
|
2986
|
+
"type": "u64"
|
|
2987
|
+
},
|
|
2988
|
+
{
|
|
2989
|
+
"name": "token_amounts",
|
|
2990
|
+
"type": {
|
|
2991
|
+
"vec": "u64"
|
|
2992
|
+
}
|
|
2993
|
+
},
|
|
2994
|
+
{
|
|
2995
|
+
"name": "timestamp",
|
|
2996
|
+
"type": "i64"
|
|
2997
|
+
}
|
|
2998
|
+
]
|
|
2999
|
+
}
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
"name": "MaxSelloffSet",
|
|
3003
|
+
"docs": [
|
|
3004
|
+
"Emitted by `set_max_selloff`. `max_selloff_pct` and",
|
|
3005
|
+
"`max_selloff_period_length` are the post-update arrays of length",
|
|
3006
|
+
"`token_count`. `max_selloff_pct[i]` is a percent of token i's virtual",
|
|
3007
|
+
"balance in `PERCENT_SCALE` units (10_000 = 100%); `0` disables the",
|
|
3008
|
+
"check for token i."
|
|
3009
|
+
],
|
|
3010
|
+
"type": {
|
|
3011
|
+
"kind": "struct",
|
|
3012
|
+
"fields": [
|
|
3013
|
+
{
|
|
3014
|
+
"name": "pool",
|
|
3015
|
+
"type": "pubkey"
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
"name": "authority",
|
|
3019
|
+
"type": "pubkey"
|
|
3020
|
+
},
|
|
3021
|
+
{
|
|
3022
|
+
"name": "max_selloff_pct",
|
|
3023
|
+
"type": {
|
|
3024
|
+
"vec": "u16"
|
|
3025
|
+
}
|
|
3026
|
+
},
|
|
3027
|
+
{
|
|
3028
|
+
"name": "max_selloff_period_length",
|
|
3029
|
+
"type": {
|
|
3030
|
+
"vec": "u32"
|
|
3031
|
+
}
|
|
3032
|
+
},
|
|
3033
|
+
{
|
|
3034
|
+
"name": "fee_threshold_pct",
|
|
3035
|
+
"docs": [
|
|
3036
|
+
"Surge-fee curve, per token (PERCENT_SCALE units)."
|
|
3037
|
+
],
|
|
3038
|
+
"type": {
|
|
3039
|
+
"vec": "u16"
|
|
3040
|
+
}
|
|
3041
|
+
},
|
|
3042
|
+
{
|
|
3043
|
+
"name": "fee_slope_low_pct",
|
|
3044
|
+
"type": {
|
|
3045
|
+
"vec": "u16"
|
|
3046
|
+
}
|
|
3047
|
+
},
|
|
3048
|
+
{
|
|
3049
|
+
"name": "fee_slope_high_pct",
|
|
3050
|
+
"type": {
|
|
3051
|
+
"vec": "u16"
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
"name": "timestamp",
|
|
3056
|
+
"type": "i64"
|
|
3057
|
+
},
|
|
3058
|
+
{
|
|
3059
|
+
"name": "old_max_selloff_pct",
|
|
3060
|
+
"docs": [
|
|
3061
|
+
"Pre-update arrays (same length/order as the `*_pct` arrays above)",
|
|
3062
|
+
"for each of the five mutated per-token fields. Appended (wire",
|
|
3063
|
+
"append-only) so indexers get the full before/after of the policy."
|
|
3064
|
+
],
|
|
3065
|
+
"type": {
|
|
3066
|
+
"vec": "u16"
|
|
3067
|
+
}
|
|
3068
|
+
},
|
|
3069
|
+
{
|
|
3070
|
+
"name": "old_max_selloff_period_length",
|
|
3071
|
+
"type": {
|
|
3072
|
+
"vec": "u32"
|
|
3073
|
+
}
|
|
3074
|
+
},
|
|
3075
|
+
{
|
|
3076
|
+
"name": "old_fee_threshold_pct",
|
|
3077
|
+
"type": {
|
|
3078
|
+
"vec": "u16"
|
|
3079
|
+
}
|
|
3080
|
+
},
|
|
3081
|
+
{
|
|
3082
|
+
"name": "old_fee_slope_low_pct",
|
|
3083
|
+
"type": {
|
|
3084
|
+
"vec": "u16"
|
|
3085
|
+
}
|
|
3086
|
+
},
|
|
3087
|
+
{
|
|
3088
|
+
"name": "old_fee_slope_high_pct",
|
|
3089
|
+
"type": {
|
|
3090
|
+
"vec": "u16"
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
]
|
|
3094
|
+
}
|
|
3095
|
+
},
|
|
3096
|
+
{
|
|
3097
|
+
"name": "MaxSelloffWindowAdvanced",
|
|
3098
|
+
"docs": [
|
|
3099
|
+
"Emitted from inside `swap` whenever the sliding-window check for",
|
|
3100
|
+
"`token_in_index` runs — this is the per-swap max-selloff WINDOW-FILL log.",
|
|
3101
|
+
"Window fill = `effective_selloff / max_selloff_cap` (0..1). Carries the",
|
|
3102
|
+
"resolved absolute cap and the vb-snapshot it was resolved against, plus",
|
|
3103
|
+
"the raw window components (previous/current selloff, window_start).",
|
|
3104
|
+
"",
|
|
3105
|
+
"The static config `max_selloff_pct` is intentionally NOT included here",
|
|
3106
|
+
"(it does not change during a swap) — it is logged by `MaxSelloffSet`",
|
|
3107
|
+
"when the policy changes, and `cap = pct * vb_snapshot / PERCENT_SCALE`."
|
|
3108
|
+
],
|
|
3109
|
+
"type": {
|
|
3110
|
+
"kind": "struct",
|
|
3111
|
+
"fields": [
|
|
3112
|
+
{
|
|
3113
|
+
"name": "pool",
|
|
3114
|
+
"type": "pubkey"
|
|
3115
|
+
},
|
|
3116
|
+
{
|
|
3117
|
+
"name": "token_index",
|
|
3118
|
+
"type": "u8"
|
|
3119
|
+
},
|
|
3120
|
+
{
|
|
3121
|
+
"name": "effective_selloff",
|
|
3122
|
+
"type": "u64"
|
|
3123
|
+
},
|
|
3124
|
+
{
|
|
3125
|
+
"name": "max_selloff_cap",
|
|
3126
|
+
"type": "u64"
|
|
3127
|
+
},
|
|
3128
|
+
{
|
|
3129
|
+
"name": "vb_snapshot",
|
|
3130
|
+
"type": "u64"
|
|
3131
|
+
},
|
|
3132
|
+
{
|
|
3133
|
+
"name": "previous_selloff",
|
|
3134
|
+
"type": "u64"
|
|
3135
|
+
},
|
|
3136
|
+
{
|
|
3137
|
+
"name": "current_selloff",
|
|
3138
|
+
"type": "u64"
|
|
3139
|
+
},
|
|
3140
|
+
{
|
|
3141
|
+
"name": "window_start_timestamp",
|
|
3142
|
+
"type": "i64"
|
|
3143
|
+
},
|
|
3144
|
+
{
|
|
3145
|
+
"name": "timestamp",
|
|
3146
|
+
"type": "i64"
|
|
3147
|
+
}
|
|
3148
|
+
]
|
|
3149
|
+
}
|
|
3150
|
+
},
|
|
3151
|
+
{
|
|
3152
|
+
"name": "PoolAdminDisabled",
|
|
3153
|
+
"type": {
|
|
3154
|
+
"kind": "struct",
|
|
3155
|
+
"fields": [
|
|
3156
|
+
{
|
|
3157
|
+
"name": "pool",
|
|
3158
|
+
"type": "pubkey"
|
|
3159
|
+
},
|
|
3160
|
+
{
|
|
3161
|
+
"name": "old_admin",
|
|
3162
|
+
"type": "pubkey"
|
|
3163
|
+
},
|
|
3164
|
+
{
|
|
3165
|
+
"name": "timestamp",
|
|
3166
|
+
"type": "i64"
|
|
3167
|
+
}
|
|
3168
|
+
]
|
|
3169
|
+
}
|
|
3170
|
+
},
|
|
3171
|
+
{
|
|
3172
|
+
"name": "PoolAdminTransferCancelled",
|
|
3173
|
+
"type": {
|
|
3174
|
+
"kind": "struct",
|
|
3175
|
+
"fields": [
|
|
3176
|
+
{
|
|
3177
|
+
"name": "pool",
|
|
3178
|
+
"type": "pubkey"
|
|
3179
|
+
},
|
|
3180
|
+
{
|
|
3181
|
+
"name": "admin",
|
|
3182
|
+
"type": "pubkey"
|
|
3183
|
+
},
|
|
3184
|
+
{
|
|
3185
|
+
"name": "cancelled_pending",
|
|
3186
|
+
"type": "pubkey"
|
|
3187
|
+
},
|
|
3188
|
+
{
|
|
3189
|
+
"name": "timestamp",
|
|
3190
|
+
"type": "i64"
|
|
3191
|
+
}
|
|
3192
|
+
]
|
|
3193
|
+
}
|
|
3194
|
+
},
|
|
3195
|
+
{
|
|
3196
|
+
"name": "PoolAdminTransferInitiated",
|
|
3197
|
+
"type": {
|
|
3198
|
+
"kind": "struct",
|
|
3199
|
+
"fields": [
|
|
3200
|
+
{
|
|
3201
|
+
"name": "pool",
|
|
3202
|
+
"type": "pubkey"
|
|
3203
|
+
},
|
|
3204
|
+
{
|
|
3205
|
+
"name": "current_admin",
|
|
3206
|
+
"type": "pubkey"
|
|
3207
|
+
},
|
|
3208
|
+
{
|
|
3209
|
+
"name": "pending_admin",
|
|
3210
|
+
"type": "pubkey"
|
|
3211
|
+
},
|
|
3212
|
+
{
|
|
3213
|
+
"name": "timestamp",
|
|
3214
|
+
"type": "i64"
|
|
3215
|
+
}
|
|
3216
|
+
]
|
|
3217
|
+
}
|
|
3218
|
+
},
|
|
3219
|
+
{
|
|
3220
|
+
"name": "PoolAdminTransferred",
|
|
3221
|
+
"type": {
|
|
3222
|
+
"kind": "struct",
|
|
3223
|
+
"fields": [
|
|
3224
|
+
{
|
|
3225
|
+
"name": "pool",
|
|
3226
|
+
"type": "pubkey"
|
|
3227
|
+
},
|
|
3228
|
+
{
|
|
3229
|
+
"name": "old_admin",
|
|
3230
|
+
"type": "pubkey"
|
|
3231
|
+
},
|
|
3232
|
+
{
|
|
3233
|
+
"name": "new_admin",
|
|
3234
|
+
"type": "pubkey"
|
|
3235
|
+
},
|
|
3236
|
+
{
|
|
3237
|
+
"name": "timestamp",
|
|
3238
|
+
"type": "i64"
|
|
3239
|
+
}
|
|
3240
|
+
]
|
|
3241
|
+
}
|
|
3242
|
+
},
|
|
3243
|
+
{
|
|
3244
|
+
"name": "PoolAltInitialized",
|
|
3245
|
+
"docs": [
|
|
3246
|
+
"Emitted by `initialize_pool_alt` once the ALT is created, extended",
|
|
3247
|
+
"with all pool-scoped addresses, and frozen. Off-chain SDK / indexer",
|
|
3248
|
+
"uses this as the signal that v0 transactions are usable for this pool."
|
|
3249
|
+
],
|
|
3250
|
+
"type": {
|
|
3251
|
+
"kind": "struct",
|
|
3252
|
+
"fields": [
|
|
3253
|
+
{
|
|
3254
|
+
"name": "pool",
|
|
3255
|
+
"docs": [
|
|
3256
|
+
"Pool PDA."
|
|
3257
|
+
],
|
|
3258
|
+
"type": "pubkey"
|
|
3259
|
+
},
|
|
3260
|
+
{
|
|
3261
|
+
"name": "lookup_table",
|
|
3262
|
+
"docs": [
|
|
3263
|
+
"Address Lookup Table account created."
|
|
3264
|
+
],
|
|
3265
|
+
"type": "pubkey"
|
|
3266
|
+
},
|
|
3267
|
+
{
|
|
3268
|
+
"name": "authority",
|
|
3269
|
+
"docs": [
|
|
3270
|
+
"Wallet that authored creation (matches `pool.pool_admin` at the",
|
|
3271
|
+
"time of the call). After freeze the ALT has no authority."
|
|
3272
|
+
],
|
|
3273
|
+
"type": "pubkey"
|
|
3274
|
+
},
|
|
3275
|
+
{
|
|
3276
|
+
"name": "address_count",
|
|
3277
|
+
"docs": [
|
|
3278
|
+
"Number of addresses written into the ALT."
|
|
3279
|
+
],
|
|
3280
|
+
"type": "u8"
|
|
3281
|
+
},
|
|
3282
|
+
{
|
|
3283
|
+
"name": "timestamp",
|
|
3284
|
+
"docs": [
|
|
3285
|
+
"`Clock::unix_timestamp` at initialisation."
|
|
3286
|
+
],
|
|
3287
|
+
"type": "i64"
|
|
3288
|
+
}
|
|
3289
|
+
]
|
|
3290
|
+
}
|
|
3291
|
+
},
|
|
3292
|
+
{
|
|
3293
|
+
"name": "PoolEnabledUpdated",
|
|
3294
|
+
"docs": [
|
|
3295
|
+
"Emitted by `set_pool_enabled`."
|
|
3296
|
+
],
|
|
3297
|
+
"type": {
|
|
3298
|
+
"kind": "struct",
|
|
3299
|
+
"fields": [
|
|
3300
|
+
{
|
|
3301
|
+
"name": "pool",
|
|
3302
|
+
"type": "pubkey"
|
|
3303
|
+
},
|
|
3304
|
+
{
|
|
3305
|
+
"name": "authority",
|
|
3306
|
+
"type": "pubkey"
|
|
3307
|
+
},
|
|
3308
|
+
{
|
|
3309
|
+
"name": "old_value",
|
|
3310
|
+
"type": "bool"
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
"name": "new_value",
|
|
3314
|
+
"type": "bool"
|
|
3315
|
+
},
|
|
3316
|
+
{
|
|
3317
|
+
"name": "timestamp",
|
|
3318
|
+
"type": "i64"
|
|
3319
|
+
}
|
|
3320
|
+
]
|
|
3321
|
+
}
|
|
3322
|
+
},
|
|
3323
|
+
{
|
|
3324
|
+
"name": "PoolInfo",
|
|
3325
|
+
"docs": [
|
|
3326
|
+
"Read-only view event emitted by the simulation-only `get_pool_info`",
|
|
3327
|
+
"instruction. Off-chain clients call `simulate({ commitment: ... })`",
|
|
3328
|
+
"and parse this event from the returned logs. Strictly more verbose",
|
|
3329
|
+
"than `PoolStateLog` (also includes derived addresses)."
|
|
3330
|
+
],
|
|
3331
|
+
"type": {
|
|
3332
|
+
"kind": "struct",
|
|
3333
|
+
"fields": [
|
|
3334
|
+
{
|
|
3335
|
+
"name": "pool",
|
|
3336
|
+
"type": "pubkey"
|
|
3337
|
+
},
|
|
3338
|
+
{
|
|
3339
|
+
"name": "config",
|
|
3340
|
+
"type": "pubkey"
|
|
3341
|
+
},
|
|
3342
|
+
{
|
|
3343
|
+
"name": "bpt_mint",
|
|
3344
|
+
"type": "pubkey"
|
|
3345
|
+
},
|
|
3346
|
+
{
|
|
3347
|
+
"name": "token_count",
|
|
3348
|
+
"type": "u8"
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
"name": "pool_id",
|
|
3352
|
+
"type": "u64"
|
|
3353
|
+
},
|
|
3354
|
+
{
|
|
3355
|
+
"name": "tokens",
|
|
3356
|
+
"type": {
|
|
3357
|
+
"vec": "pubkey"
|
|
3358
|
+
}
|
|
3359
|
+
},
|
|
3360
|
+
{
|
|
3361
|
+
"name": "token_vaults",
|
|
3362
|
+
"type": {
|
|
3363
|
+
"vec": "pubkey"
|
|
3364
|
+
}
|
|
3365
|
+
},
|
|
3366
|
+
{
|
|
3367
|
+
"name": "normalized_weights",
|
|
3368
|
+
"type": {
|
|
3369
|
+
"vec": "u64"
|
|
3370
|
+
}
|
|
3371
|
+
},
|
|
3372
|
+
{
|
|
3373
|
+
"name": "virtual_balances",
|
|
3374
|
+
"type": {
|
|
3375
|
+
"vec": "u64"
|
|
3376
|
+
}
|
|
3377
|
+
},
|
|
3378
|
+
{
|
|
3379
|
+
"name": "actual_balances",
|
|
3380
|
+
"type": {
|
|
3381
|
+
"vec": "u64"
|
|
3382
|
+
}
|
|
3383
|
+
},
|
|
3384
|
+
{
|
|
3385
|
+
"name": "protocol_fees_owed",
|
|
3386
|
+
"type": {
|
|
3387
|
+
"vec": "u64"
|
|
3388
|
+
}
|
|
3389
|
+
},
|
|
3390
|
+
{
|
|
3391
|
+
"name": "swap_fee_rate",
|
|
3392
|
+
"type": "u32"
|
|
3393
|
+
},
|
|
3394
|
+
{
|
|
3395
|
+
"name": "protocol_fee_rate",
|
|
3396
|
+
"type": "u16"
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
"name": "pool_enabled",
|
|
3400
|
+
"type": "bool"
|
|
3401
|
+
},
|
|
3402
|
+
{
|
|
3403
|
+
"name": "swaps_enabled",
|
|
3404
|
+
"type": "bool"
|
|
3405
|
+
},
|
|
3406
|
+
{
|
|
3407
|
+
"name": "token_programs",
|
|
3408
|
+
"type": {
|
|
3409
|
+
"vec": "pubkey"
|
|
3410
|
+
}
|
|
3411
|
+
},
|
|
3412
|
+
{
|
|
3413
|
+
"name": "timestamp",
|
|
3414
|
+
"type": "i64"
|
|
3415
|
+
}
|
|
3416
|
+
]
|
|
3417
|
+
}
|
|
3418
|
+
},
|
|
3419
|
+
{
|
|
3420
|
+
"name": "PoolInitialized",
|
|
3421
|
+
"docs": [
|
|
3422
|
+
"Emitted at the end of `initialize_cubic_pool`. Marks a new pool live.",
|
|
3423
|
+
"",
|
|
3424
|
+
"# Fields",
|
|
3425
|
+
"* `pool` — pool PDA pubkey",
|
|
3426
|
+
"* `config` — parent config pubkey",
|
|
3427
|
+
"* `token_count` — active tokens (2..=10)",
|
|
3428
|
+
"* `bpt_mint` — BPT mint PDA pubkey",
|
|
3429
|
+
"* `timestamp` — `Clock::unix_timestamp` at init",
|
|
3430
|
+
"* `banned_extensions` — the effective Token-2022 extension blocklist the",
|
|
3431
|
+
"creator's tokens were vetted against (override, or the config default)."
|
|
3432
|
+
],
|
|
3433
|
+
"type": {
|
|
3434
|
+
"kind": "struct",
|
|
3435
|
+
"fields": [
|
|
3436
|
+
{
|
|
3437
|
+
"name": "pool",
|
|
3438
|
+
"type": "pubkey"
|
|
3439
|
+
},
|
|
3440
|
+
{
|
|
3441
|
+
"name": "config",
|
|
3442
|
+
"type": "pubkey"
|
|
3443
|
+
},
|
|
3444
|
+
{
|
|
3445
|
+
"name": "token_count",
|
|
3446
|
+
"type": "u8"
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
"name": "bpt_mint",
|
|
3450
|
+
"type": "pubkey"
|
|
3451
|
+
},
|
|
3452
|
+
{
|
|
3453
|
+
"name": "timestamp",
|
|
3454
|
+
"type": "i64"
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
"name": "banned_extensions",
|
|
3458
|
+
"docs": [
|
|
3459
|
+
"Appended (wire append-only): effective per-pool banned-extensions bitmap."
|
|
3460
|
+
],
|
|
3461
|
+
"type": "u64"
|
|
3462
|
+
}
|
|
3463
|
+
]
|
|
3464
|
+
}
|
|
3465
|
+
},
|
|
3466
|
+
{
|
|
3467
|
+
"name": "PoolMigratedToV5",
|
|
3468
|
+
"docs": [
|
|
3469
|
+
"Emitted by `migrate_to_v5`. Marks an in-place storage migration that",
|
|
3470
|
+
"re-interprets the (same-size, 1683-byte) v4 account under a newer field",
|
|
3471
|
+
"layout: the bytes that previously held `max_selloff: u64` /",
|
|
3472
|
+
"`max_selloff_period_length: u32` / `reserved` now decode as",
|
|
3473
|
+
"`max_selloff_pct` + the surge-fee curve + `is_active`. The only field",
|
|
3474
|
+
"that needs a value rewrite is `is_active` — pre-migration it decodes as",
|
|
3475
|
+
"`false` (old `reserved[0] == 0`), so the migration flips every active",
|
|
3476
|
+
"token's `is_active` back to `true` (the intended default)."
|
|
3477
|
+
],
|
|
3478
|
+
"type": {
|
|
3479
|
+
"kind": "struct",
|
|
3480
|
+
"fields": [
|
|
3481
|
+
{
|
|
3482
|
+
"name": "pool",
|
|
3483
|
+
"type": "pubkey"
|
|
3484
|
+
},
|
|
3485
|
+
{
|
|
3486
|
+
"name": "authority",
|
|
3487
|
+
"type": "pubkey"
|
|
3488
|
+
},
|
|
3489
|
+
{
|
|
3490
|
+
"name": "token_count",
|
|
3491
|
+
"type": "u8"
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
"name": "reactivated",
|
|
3495
|
+
"docs": [
|
|
3496
|
+
"How many token slots were flipped from inactive→active (0 ⇒ pool was",
|
|
3497
|
+
"already migrated / created post-upgrade — idempotent no-op)."
|
|
3498
|
+
],
|
|
3499
|
+
"type": "u8"
|
|
3500
|
+
},
|
|
3501
|
+
{
|
|
3502
|
+
"name": "timestamp",
|
|
3503
|
+
"type": "i64"
|
|
3504
|
+
}
|
|
3505
|
+
]
|
|
3506
|
+
}
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
"name": "PoolSolWithdrawn",
|
|
3510
|
+
"docs": [
|
|
3511
|
+
"Emitted by `withdraw_sol` when SOL is recovered from a cubic-pool-owned",
|
|
3512
|
+
"account."
|
|
3513
|
+
],
|
|
3514
|
+
"type": {
|
|
3515
|
+
"kind": "struct",
|
|
3516
|
+
"fields": [
|
|
3517
|
+
{
|
|
3518
|
+
"name": "source",
|
|
3519
|
+
"type": "pubkey"
|
|
3520
|
+
},
|
|
3521
|
+
{
|
|
3522
|
+
"name": "authority",
|
|
3523
|
+
"type": "pubkey"
|
|
3524
|
+
},
|
|
3525
|
+
{
|
|
3526
|
+
"name": "recipient",
|
|
3527
|
+
"type": "pubkey"
|
|
3528
|
+
},
|
|
3529
|
+
{
|
|
3530
|
+
"name": "amount",
|
|
3531
|
+
"type": "u64"
|
|
3532
|
+
},
|
|
3533
|
+
{
|
|
3534
|
+
"name": "timestamp",
|
|
3535
|
+
"type": "i64"
|
|
3536
|
+
}
|
|
3537
|
+
]
|
|
3538
|
+
}
|
|
3539
|
+
},
|
|
3540
|
+
{
|
|
3541
|
+
"name": "PoolStateLog",
|
|
3542
|
+
"docs": [
|
|
3543
|
+
"Mutating-instruction state snapshot consumed by the backend indexer to",
|
|
3544
|
+
"keep its denormalised pool table in sync without an additional account",
|
|
3545
|
+
"fetch. Emitted by `swap`, `add_liquidity`, and `remove_liquidity`.",
|
|
3546
|
+
"",
|
|
3547
|
+
"NOTE: BPT total supply is intentionally NOT included — it is redundant",
|
|
3548
|
+
"with the BPT mint account (which indexers already stream) and was a",
|
|
3549
|
+
"misleading hardcoded `0` on `swap`. Read supply from the mint at the",
|
|
3550
|
+
"tx slot instead."
|
|
3551
|
+
],
|
|
3552
|
+
"type": {
|
|
3553
|
+
"kind": "struct",
|
|
3554
|
+
"fields": [
|
|
3555
|
+
{
|
|
3556
|
+
"name": "pool",
|
|
3557
|
+
"type": "pubkey"
|
|
3558
|
+
},
|
|
3559
|
+
{
|
|
3560
|
+
"name": "virtual_balances",
|
|
3561
|
+
"type": {
|
|
3562
|
+
"vec": "u64"
|
|
3563
|
+
}
|
|
3564
|
+
},
|
|
3565
|
+
{
|
|
3566
|
+
"name": "actual_balances",
|
|
3567
|
+
"type": {
|
|
3568
|
+
"vec": "u64"
|
|
3569
|
+
}
|
|
3570
|
+
},
|
|
3571
|
+
{
|
|
3572
|
+
"name": "protocol_fees_owed",
|
|
3573
|
+
"type": {
|
|
3574
|
+
"vec": "u64"
|
|
3575
|
+
}
|
|
3576
|
+
},
|
|
3577
|
+
{
|
|
3578
|
+
"name": "timestamp",
|
|
3579
|
+
"type": "i64"
|
|
3580
|
+
}
|
|
3581
|
+
]
|
|
3582
|
+
}
|
|
3583
|
+
},
|
|
3584
|
+
{
|
|
3585
|
+
"name": "ProtocolAdminTransferCancelled",
|
|
3586
|
+
"type": {
|
|
3587
|
+
"kind": "struct",
|
|
3588
|
+
"fields": [
|
|
3589
|
+
{
|
|
3590
|
+
"name": "config",
|
|
3591
|
+
"type": "pubkey"
|
|
3592
|
+
},
|
|
3593
|
+
{
|
|
3594
|
+
"name": "admin",
|
|
3595
|
+
"type": "pubkey"
|
|
3596
|
+
},
|
|
3597
|
+
{
|
|
3598
|
+
"name": "cancelled_pending",
|
|
3599
|
+
"type": "pubkey"
|
|
3600
|
+
},
|
|
3601
|
+
{
|
|
3602
|
+
"name": "timestamp",
|
|
3603
|
+
"type": "i64"
|
|
3604
|
+
}
|
|
3605
|
+
]
|
|
3606
|
+
}
|
|
3607
|
+
},
|
|
3608
|
+
{
|
|
3609
|
+
"name": "ProtocolAdminTransferInitiated",
|
|
3610
|
+
"type": {
|
|
3611
|
+
"kind": "struct",
|
|
3612
|
+
"fields": [
|
|
3613
|
+
{
|
|
3614
|
+
"name": "config",
|
|
3615
|
+
"type": "pubkey"
|
|
3616
|
+
},
|
|
3617
|
+
{
|
|
3618
|
+
"name": "current_admin",
|
|
3619
|
+
"type": "pubkey"
|
|
3620
|
+
},
|
|
3621
|
+
{
|
|
3622
|
+
"name": "pending_admin",
|
|
3623
|
+
"type": "pubkey"
|
|
3624
|
+
},
|
|
3625
|
+
{
|
|
3626
|
+
"name": "timestamp",
|
|
3627
|
+
"type": "i64"
|
|
3628
|
+
}
|
|
3629
|
+
]
|
|
3630
|
+
}
|
|
3631
|
+
},
|
|
3632
|
+
{
|
|
3633
|
+
"name": "ProtocolAdminTransferred",
|
|
3634
|
+
"type": {
|
|
3635
|
+
"kind": "struct",
|
|
3636
|
+
"fields": [
|
|
3637
|
+
{
|
|
3638
|
+
"name": "config",
|
|
3639
|
+
"type": "pubkey"
|
|
3640
|
+
},
|
|
3641
|
+
{
|
|
3642
|
+
"name": "old_admin",
|
|
3643
|
+
"type": "pubkey"
|
|
3644
|
+
},
|
|
3645
|
+
{
|
|
3646
|
+
"name": "new_admin",
|
|
3647
|
+
"type": "pubkey"
|
|
3648
|
+
},
|
|
3649
|
+
{
|
|
3650
|
+
"name": "timestamp",
|
|
3651
|
+
"type": "i64"
|
|
3652
|
+
}
|
|
3653
|
+
]
|
|
3654
|
+
}
|
|
3655
|
+
},
|
|
3656
|
+
{
|
|
3657
|
+
"name": "ProtocolFeeRateUpdated",
|
|
3658
|
+
"docs": [
|
|
3659
|
+
"Emitted by `set_protocol_fee_rate`."
|
|
3660
|
+
],
|
|
3661
|
+
"type": {
|
|
3662
|
+
"kind": "struct",
|
|
3663
|
+
"fields": [
|
|
3664
|
+
{
|
|
3665
|
+
"name": "pool",
|
|
3666
|
+
"type": "pubkey"
|
|
3667
|
+
},
|
|
3668
|
+
{
|
|
3669
|
+
"name": "old_rate",
|
|
3670
|
+
"type": "u16"
|
|
3671
|
+
},
|
|
3672
|
+
{
|
|
3673
|
+
"name": "new_rate",
|
|
3674
|
+
"type": "u16"
|
|
3675
|
+
},
|
|
3676
|
+
{
|
|
3677
|
+
"name": "timestamp",
|
|
3678
|
+
"type": "i64"
|
|
3679
|
+
},
|
|
3680
|
+
{
|
|
3681
|
+
"name": "authority",
|
|
3682
|
+
"docs": [
|
|
3683
|
+
"Protocol admin (Treasury PDA) that changed the rate. Appended."
|
|
3684
|
+
],
|
|
3685
|
+
"type": "pubkey"
|
|
3686
|
+
}
|
|
3687
|
+
]
|
|
3688
|
+
}
|
|
3689
|
+
},
|
|
3690
|
+
{
|
|
3691
|
+
"name": "ProtocolFeesCollected",
|
|
3692
|
+
"docs": [
|
|
3693
|
+
"Emitted by `collect_protocol_fees` once per call (one event covers all",
|
|
3694
|
+
"tokens, with zero-amounts kept in `token_amounts` to preserve order)."
|
|
3695
|
+
],
|
|
3696
|
+
"type": {
|
|
3697
|
+
"kind": "struct",
|
|
3698
|
+
"fields": [
|
|
3699
|
+
{
|
|
3700
|
+
"name": "pool",
|
|
3701
|
+
"type": "pubkey"
|
|
3702
|
+
},
|
|
3703
|
+
{
|
|
3704
|
+
"name": "authority",
|
|
3705
|
+
"type": "pubkey"
|
|
3706
|
+
},
|
|
3707
|
+
{
|
|
3708
|
+
"name": "token_amounts",
|
|
3709
|
+
"type": {
|
|
3710
|
+
"vec": "u64"
|
|
3711
|
+
}
|
|
3712
|
+
},
|
|
3713
|
+
{
|
|
3714
|
+
"name": "timestamp",
|
|
3715
|
+
"type": "i64"
|
|
3716
|
+
}
|
|
3717
|
+
]
|
|
3718
|
+
}
|
|
3719
|
+
},
|
|
3720
|
+
{
|
|
3721
|
+
"name": "RangeManagerConfigSet",
|
|
3722
|
+
"docs": [
|
|
3723
|
+
"Emitted by `set_range_manager_config`. Carries the full effective",
|
|
3724
|
+
"envelope so off-chain indexers don't need to re-fetch the pool."
|
|
3725
|
+
],
|
|
3726
|
+
"type": {
|
|
3727
|
+
"kind": "struct",
|
|
3728
|
+
"fields": [
|
|
3729
|
+
{
|
|
3730
|
+
"name": "pool",
|
|
3731
|
+
"type": "pubkey"
|
|
3732
|
+
},
|
|
3733
|
+
{
|
|
3734
|
+
"name": "authority",
|
|
3735
|
+
"type": "pubkey"
|
|
3736
|
+
},
|
|
3737
|
+
{
|
|
3738
|
+
"name": "max_vb_change_pct",
|
|
3739
|
+
"docs": [
|
|
3740
|
+
"New percent-of-current-value change caps, in `PERCENT_SCALE` units",
|
|
3741
|
+
"(10_000 = 100%)."
|
|
3742
|
+
],
|
|
3743
|
+
"type": "u16"
|
|
3744
|
+
},
|
|
3745
|
+
{
|
|
3746
|
+
"name": "max_weight_change_pct",
|
|
3747
|
+
"type": "u16"
|
|
3748
|
+
},
|
|
3749
|
+
{
|
|
3750
|
+
"name": "min_update_interval_secs",
|
|
3751
|
+
"type": "u32"
|
|
3752
|
+
},
|
|
3753
|
+
{
|
|
3754
|
+
"name": "timestamp",
|
|
3755
|
+
"type": "i64"
|
|
3756
|
+
},
|
|
3757
|
+
{
|
|
3758
|
+
"name": "old_max_vb_change_pct",
|
|
3759
|
+
"docs": [
|
|
3760
|
+
"Pre-update values of the three fields above. Appended (wire",
|
|
3761
|
+
"append-only) so indexers get the full before/after."
|
|
3762
|
+
],
|
|
3763
|
+
"type": "u16"
|
|
3764
|
+
},
|
|
3765
|
+
{
|
|
3766
|
+
"name": "old_max_weight_change_pct",
|
|
3767
|
+
"type": "u16"
|
|
3768
|
+
},
|
|
3769
|
+
{
|
|
3770
|
+
"name": "old_min_update_interval_secs",
|
|
3771
|
+
"type": "u32"
|
|
3772
|
+
},
|
|
3773
|
+
{
|
|
3774
|
+
"name": "old_max_leverage_bps",
|
|
3775
|
+
"docs": [
|
|
3776
|
+
"Absolute `virtual/actual` band the manager must stay inside, in bps",
|
|
3777
|
+
"(`0` = disabled). Appended (wire append-only)."
|
|
3778
|
+
],
|
|
3779
|
+
"type": "u32"
|
|
3780
|
+
},
|
|
3781
|
+
{
|
|
3782
|
+
"name": "new_max_leverage_bps",
|
|
3783
|
+
"type": "u32"
|
|
3784
|
+
}
|
|
3785
|
+
]
|
|
3786
|
+
}
|
|
3787
|
+
},
|
|
3788
|
+
{
|
|
3789
|
+
"name": "RangeManagerSet",
|
|
3790
|
+
"docs": [
|
|
3791
|
+
"Emitted by `set_range_manager`. Both the pubkey and the enabled flag",
|
|
3792
|
+
"are bundled into a single event. `new_manager == Pubkey::default()`",
|
|
3793
|
+
"AND `enabled = false` is the \"fully disabled\" state."
|
|
3794
|
+
],
|
|
3795
|
+
"type": {
|
|
3796
|
+
"kind": "struct",
|
|
3797
|
+
"fields": [
|
|
3798
|
+
{
|
|
3799
|
+
"name": "pool",
|
|
3800
|
+
"type": "pubkey"
|
|
3801
|
+
},
|
|
3802
|
+
{
|
|
3803
|
+
"name": "authority",
|
|
3804
|
+
"type": "pubkey"
|
|
3805
|
+
},
|
|
3806
|
+
{
|
|
3807
|
+
"name": "old_manager",
|
|
3808
|
+
"type": "pubkey"
|
|
3809
|
+
},
|
|
3810
|
+
{
|
|
3811
|
+
"name": "new_manager",
|
|
3812
|
+
"type": "pubkey"
|
|
3813
|
+
},
|
|
3814
|
+
{
|
|
3815
|
+
"name": "enabled",
|
|
3816
|
+
"docs": [
|
|
3817
|
+
"New value of `range_manager_enabled` (kept for back-compat; the",
|
|
3818
|
+
"`old_enabled`/`new_enabled` pair below carries the full before/after)."
|
|
3819
|
+
],
|
|
3820
|
+
"type": "bool"
|
|
3821
|
+
},
|
|
3822
|
+
{
|
|
3823
|
+
"name": "timestamp",
|
|
3824
|
+
"type": "i64"
|
|
3825
|
+
},
|
|
3826
|
+
{
|
|
3827
|
+
"name": "old_enabled",
|
|
3828
|
+
"docs": [
|
|
3829
|
+
"Before/after of `range_manager_enabled`. Appended (wire append-only)."
|
|
3830
|
+
],
|
|
3831
|
+
"type": "bool"
|
|
3832
|
+
},
|
|
3833
|
+
{
|
|
3834
|
+
"name": "new_enabled",
|
|
3835
|
+
"type": "bool"
|
|
3836
|
+
}
|
|
3837
|
+
]
|
|
3838
|
+
}
|
|
3839
|
+
},
|
|
3840
|
+
{
|
|
3841
|
+
"name": "RangeManagerUpdated",
|
|
3842
|
+
"docs": [
|
|
3843
|
+
"Emitted by `range_manager_update` after every check passes and state",
|
|
3844
|
+
"is committed. `vb_indices` / `vb_new_values` and `weight_indices` /",
|
|
3845
|
+
"`weight_new_values` are aligned slices (may be empty)."
|
|
3846
|
+
],
|
|
3847
|
+
"type": {
|
|
3848
|
+
"kind": "struct",
|
|
3849
|
+
"fields": [
|
|
3850
|
+
{
|
|
3851
|
+
"name": "pool",
|
|
3852
|
+
"type": "pubkey"
|
|
3853
|
+
},
|
|
3854
|
+
{
|
|
3855
|
+
"name": "manager",
|
|
3856
|
+
"type": "pubkey"
|
|
3857
|
+
},
|
|
3858
|
+
{
|
|
3859
|
+
"name": "vb_indices",
|
|
3860
|
+
"type": "bytes"
|
|
3861
|
+
},
|
|
3862
|
+
{
|
|
3863
|
+
"name": "vb_new_values",
|
|
3864
|
+
"type": {
|
|
3865
|
+
"vec": "u64"
|
|
3866
|
+
}
|
|
3867
|
+
},
|
|
3868
|
+
{
|
|
3869
|
+
"name": "weight_indices",
|
|
3870
|
+
"type": "bytes"
|
|
3871
|
+
},
|
|
3872
|
+
{
|
|
3873
|
+
"name": "weight_new_values",
|
|
3874
|
+
"type": {
|
|
3875
|
+
"vec": "u64"
|
|
3876
|
+
}
|
|
3877
|
+
},
|
|
3878
|
+
{
|
|
3879
|
+
"name": "timestamp",
|
|
3880
|
+
"type": "i64"
|
|
3881
|
+
}
|
|
3882
|
+
]
|
|
3883
|
+
}
|
|
3884
|
+
},
|
|
3885
|
+
{
|
|
3886
|
+
"name": "SelloffParams",
|
|
3887
|
+
"docs": [
|
|
3888
|
+
"Per-token sell-off policy. One entry per active token (in pool order).",
|
|
3889
|
+
"",
|
|
3890
|
+
"All `_pct` fields are in `PERCENT_SCALE` units (10_000 = 100%)."
|
|
3891
|
+
],
|
|
3892
|
+
"type": {
|
|
3893
|
+
"kind": "struct",
|
|
3894
|
+
"fields": [
|
|
3895
|
+
{
|
|
3896
|
+
"name": "max_selloff_pct",
|
|
3897
|
+
"docs": [
|
|
3898
|
+
"Max cumulative sell volume per window, as a percent of the token's",
|
|
3899
|
+
"virtual balance (snapshot at window open). `0` disables the cap",
|
|
3900
|
+
"AND the surge fee for this token. Must be `<= PERCENT_SCALE`."
|
|
3901
|
+
],
|
|
3902
|
+
"type": "u16"
|
|
3903
|
+
},
|
|
3904
|
+
{
|
|
3905
|
+
"name": "period_length",
|
|
3906
|
+
"docs": [
|
|
3907
|
+
"Sliding-window length in seconds. Must be `> 0` when",
|
|
3908
|
+
"`max_selloff_pct > 0`."
|
|
3909
|
+
],
|
|
3910
|
+
"type": "u32"
|
|
3911
|
+
},
|
|
3912
|
+
{
|
|
3913
|
+
"name": "fee_threshold_pct",
|
|
3914
|
+
"docs": [
|
|
3915
|
+
"Surge fee: window-fill ratio at which the fee starts (below it the",
|
|
3916
|
+
"fee is 0). Must be `< PERCENT_SCALE` when `fee_slope_high_pct > 0`."
|
|
3917
|
+
],
|
|
3918
|
+
"type": "u16"
|
|
3919
|
+
},
|
|
3920
|
+
{
|
|
3921
|
+
"name": "fee_slope_low_pct",
|
|
3922
|
+
"docs": [
|
|
3923
|
+
"Surge fee at the threshold (lower curve point)."
|
|
3924
|
+
],
|
|
3925
|
+
"type": "u16"
|
|
3926
|
+
},
|
|
3927
|
+
{
|
|
3928
|
+
"name": "fee_slope_high_pct",
|
|
3929
|
+
"docs": [
|
|
3930
|
+
"Surge fee at ~100% window fill (upper curve point). `0` disables the",
|
|
3931
|
+
"surge fee. Must be `>= fee_slope_mid_pct` and `<= PERCENT_SCALE`."
|
|
3932
|
+
],
|
|
3933
|
+
"type": "u16"
|
|
3934
|
+
},
|
|
3935
|
+
{
|
|
3936
|
+
"name": "fee_slope_mid_pct",
|
|
3937
|
+
"docs": [
|
|
3938
|
+
"Surge fee at the KINK — the middle of the three points.",
|
|
3939
|
+
"",
|
|
3940
|
+
"Appended at the END of this struct, not slotted next to the other two",
|
|
3941
|
+
"slope fields: Borsh encodes instruction arguments positionally, so",
|
|
3942
|
+
"inserting mid-struct would silently reinterpret every later field for",
|
|
3943
|
+
"clients built against the previous IDL.",
|
|
3944
|
+
"",
|
|
3945
|
+
"Must satisfy `fee_slope_low_pct <= fee_slope_mid_pct <=",
|
|
3946
|
+
"fee_slope_high_pct`."
|
|
3947
|
+
],
|
|
3948
|
+
"type": "u16"
|
|
3949
|
+
},
|
|
3950
|
+
{
|
|
3951
|
+
"name": "fee_kink_pct",
|
|
3952
|
+
"docs": [
|
|
3953
|
+
"Window fill at which the curve kinks, in WHOLE PERCENT (0..=100).",
|
|
3954
|
+
"",
|
|
3955
|
+
"`0` means \"no kink\": one straight line from `fee_slope_low_pct` at the",
|
|
3956
|
+
"threshold to `fee_slope_high_pct` at full fill. When non-zero it must",
|
|
3957
|
+
"sit STRICTLY between the threshold and full fill — a kink at either",
|
|
3958
|
+
"end degenerates one of the two segments to zero width."
|
|
3959
|
+
],
|
|
3960
|
+
"type": "u8"
|
|
3961
|
+
}
|
|
3962
|
+
]
|
|
3963
|
+
}
|
|
3964
|
+
},
|
|
3965
|
+
{
|
|
3966
|
+
"name": "Swap",
|
|
3967
|
+
"docs": [
|
|
3968
|
+
"Emitted by `swap` after the trade executes.",
|
|
3969
|
+
"",
|
|
3970
|
+
"# Fields",
|
|
3971
|
+
"* `pool` — pool PDA",
|
|
3972
|
+
"* `user` — signer that initiated the swap",
|
|
3973
|
+
"* `token_in/out` — mint pubkeys of the two legs",
|
|
3974
|
+
"* `amount_in/out` — raw token units (pre-fee on input side)",
|
|
3975
|
+
"* `fee_amount` — total swap fee (raw units, in token_in)",
|
|
3976
|
+
"* `protocol_fee_amount`— share of `fee_amount` that went to the",
|
|
3977
|
+
"protocol-fees-owed bucket (raw units, in token_in)",
|
|
3978
|
+
"* `timestamp` — `Clock::unix_timestamp`"
|
|
3979
|
+
],
|
|
3980
|
+
"type": {
|
|
3981
|
+
"kind": "struct",
|
|
3982
|
+
"fields": [
|
|
3983
|
+
{
|
|
3984
|
+
"name": "pool",
|
|
3985
|
+
"type": "pubkey"
|
|
3986
|
+
},
|
|
3987
|
+
{
|
|
3988
|
+
"name": "user",
|
|
3989
|
+
"type": "pubkey"
|
|
3990
|
+
},
|
|
3991
|
+
{
|
|
3992
|
+
"name": "token_in",
|
|
3993
|
+
"type": "pubkey"
|
|
3994
|
+
},
|
|
3995
|
+
{
|
|
3996
|
+
"name": "token_out",
|
|
3997
|
+
"type": "pubkey"
|
|
3998
|
+
},
|
|
3999
|
+
{
|
|
4000
|
+
"name": "amount_in",
|
|
4001
|
+
"type": "u64"
|
|
4002
|
+
},
|
|
4003
|
+
{
|
|
4004
|
+
"name": "amount_out",
|
|
4005
|
+
"docs": [
|
|
4006
|
+
"Amount the user RECEIVES — net of the variable sell-off surge fee."
|
|
4007
|
+
],
|
|
4008
|
+
"type": "u64"
|
|
4009
|
+
},
|
|
4010
|
+
{
|
|
4011
|
+
"name": "fee_amount",
|
|
4012
|
+
"docs": [
|
|
4013
|
+
"Total base swap fee (raw units, in token_in)."
|
|
4014
|
+
],
|
|
4015
|
+
"type": "u64"
|
|
4016
|
+
},
|
|
4017
|
+
{
|
|
4018
|
+
"name": "protocol_fee_amount",
|
|
4019
|
+
"docs": [
|
|
4020
|
+
"Protocol share of the base swap fee (raw units, in token_in)."
|
|
4021
|
+
],
|
|
4022
|
+
"type": "u64"
|
|
4023
|
+
},
|
|
4024
|
+
{
|
|
4025
|
+
"name": "timestamp",
|
|
4026
|
+
"type": "i64"
|
|
4027
|
+
},
|
|
4028
|
+
{
|
|
4029
|
+
"name": "surge_fee_amount",
|
|
4030
|
+
"docs": [
|
|
4031
|
+
"Variable sell-off surge fee taken from the OUTPUT token and routed",
|
|
4032
|
+
"100% to the protocol bucket. `0` in the common case.",
|
|
4033
|
+
"",
|
|
4034
|
+
"Borsh encodes positionally, so every field added after the original",
|
|
4035
|
+
"`timestamp` tail must stay AFTER it — otherwise an indexer decoding a",
|
|
4036
|
+
"pre-upgrade event with the new IDL misreads every following field."
|
|
4037
|
+
],
|
|
4038
|
+
"type": "u64"
|
|
4039
|
+
}
|
|
4040
|
+
]
|
|
4041
|
+
}
|
|
4042
|
+
},
|
|
4043
|
+
{
|
|
4044
|
+
"name": "SwapFeeRateUpdated",
|
|
4045
|
+
"docs": [
|
|
4046
|
+
"Emitted by `set_swap_fee_rate`. Carries both old and new for cheap",
|
|
4047
|
+
"audit reconstruction without re-reading prior state."
|
|
4048
|
+
],
|
|
4049
|
+
"type": {
|
|
4050
|
+
"kind": "struct",
|
|
4051
|
+
"fields": [
|
|
4052
|
+
{
|
|
4053
|
+
"name": "pool",
|
|
4054
|
+
"type": "pubkey"
|
|
4055
|
+
},
|
|
4056
|
+
{
|
|
4057
|
+
"name": "old_rate",
|
|
4058
|
+
"type": "u32"
|
|
4059
|
+
},
|
|
4060
|
+
{
|
|
4061
|
+
"name": "new_rate",
|
|
4062
|
+
"type": "u32"
|
|
4063
|
+
},
|
|
4064
|
+
{
|
|
4065
|
+
"name": "timestamp",
|
|
4066
|
+
"type": "i64"
|
|
4067
|
+
},
|
|
4068
|
+
{
|
|
4069
|
+
"name": "authority",
|
|
4070
|
+
"docs": [
|
|
4071
|
+
"Pool admin that changed the rate. Appended (wire-format append-only)."
|
|
4072
|
+
],
|
|
4073
|
+
"type": "pubkey"
|
|
4074
|
+
}
|
|
4075
|
+
]
|
|
4076
|
+
}
|
|
4077
|
+
},
|
|
4078
|
+
{
|
|
4079
|
+
"name": "SwapsEnabledUpdated",
|
|
4080
|
+
"docs": [
|
|
4081
|
+
"Emitted by `set_swaps_enabled`."
|
|
4082
|
+
],
|
|
4083
|
+
"type": {
|
|
4084
|
+
"kind": "struct",
|
|
4085
|
+
"fields": [
|
|
4086
|
+
{
|
|
4087
|
+
"name": "pool",
|
|
4088
|
+
"type": "pubkey"
|
|
4089
|
+
},
|
|
4090
|
+
{
|
|
4091
|
+
"name": "authority",
|
|
4092
|
+
"type": "pubkey"
|
|
4093
|
+
},
|
|
4094
|
+
{
|
|
4095
|
+
"name": "old_value",
|
|
4096
|
+
"type": "bool"
|
|
4097
|
+
},
|
|
4098
|
+
{
|
|
4099
|
+
"name": "new_value",
|
|
4100
|
+
"type": "bool"
|
|
4101
|
+
},
|
|
4102
|
+
{
|
|
4103
|
+
"name": "timestamp",
|
|
4104
|
+
"type": "i64"
|
|
4105
|
+
}
|
|
4106
|
+
]
|
|
4107
|
+
}
|
|
4108
|
+
},
|
|
4109
|
+
{
|
|
4110
|
+
"name": "TokenActiveSet",
|
|
4111
|
+
"docs": [
|
|
4112
|
+
"Emitted by `set_token_active`. Carries the token index, the old/new",
|
|
4113
|
+
"`is_active` flag, and the authority that flipped it."
|
|
4114
|
+
],
|
|
4115
|
+
"type": {
|
|
4116
|
+
"kind": "struct",
|
|
4117
|
+
"fields": [
|
|
4118
|
+
{
|
|
4119
|
+
"name": "pool",
|
|
4120
|
+
"type": "pubkey"
|
|
4121
|
+
},
|
|
4122
|
+
{
|
|
4123
|
+
"name": "authority",
|
|
4124
|
+
"type": "pubkey"
|
|
4125
|
+
},
|
|
4126
|
+
{
|
|
4127
|
+
"name": "token_index",
|
|
4128
|
+
"type": "u8"
|
|
4129
|
+
},
|
|
4130
|
+
{
|
|
4131
|
+
"name": "old_value",
|
|
4132
|
+
"type": "bool"
|
|
4133
|
+
},
|
|
4134
|
+
{
|
|
4135
|
+
"name": "new_value",
|
|
4136
|
+
"type": "bool"
|
|
4137
|
+
},
|
|
4138
|
+
{
|
|
4139
|
+
"name": "timestamp",
|
|
4140
|
+
"type": "i64"
|
|
4141
|
+
}
|
|
4142
|
+
]
|
|
4143
|
+
}
|
|
4144
|
+
},
|
|
4145
|
+
{
|
|
4146
|
+
"name": "TokenChange",
|
|
4147
|
+
"docs": [
|
|
4148
|
+
"Single change entry: \"I believe slot `index` currently holds",
|
|
4149
|
+
"`expected_current`; set it to `new_value`\".",
|
|
4150
|
+
"",
|
|
4151
|
+
"`expected_current` is a compare-and-swap guard, not decoration. The",
|
|
4152
|
+
"manager computes `new_value` off-chain against whatever it last observed,",
|
|
4153
|
+
"then submits a transaction that lands some slots later. Without the",
|
|
4154
|
+
"guard the write is unconditional, so any swap or liquidity operation that",
|
|
4155
|
+
"landed in between is silently reset — and that window is a property of",
|
|
4156
|
+
"Solana's read-then-submit latency, not of operator care, so a careful",
|
|
4157
|
+
"manager cannot avoid it. Anyone able to time a swap into the gap can have",
|
|
4158
|
+
"its price effect erased."
|
|
4159
|
+
],
|
|
4160
|
+
"type": {
|
|
4161
|
+
"kind": "struct",
|
|
4162
|
+
"fields": [
|
|
4163
|
+
{
|
|
4164
|
+
"name": "index",
|
|
4165
|
+
"type": "u8"
|
|
4166
|
+
},
|
|
4167
|
+
{
|
|
4168
|
+
"name": "expected_current",
|
|
4169
|
+
"type": "u64"
|
|
4170
|
+
},
|
|
4171
|
+
{
|
|
4172
|
+
"name": "new_value",
|
|
4173
|
+
"type": "u64"
|
|
4174
|
+
}
|
|
4175
|
+
]
|
|
4176
|
+
}
|
|
4177
|
+
},
|
|
4178
|
+
{
|
|
4179
|
+
"name": "TokenSlot",
|
|
4180
|
+
"type": {
|
|
4181
|
+
"kind": "struct",
|
|
4182
|
+
"fields": [
|
|
4183
|
+
{
|
|
4184
|
+
"name": "config",
|
|
4185
|
+
"type": {
|
|
4186
|
+
"defined": {
|
|
4187
|
+
"name": "AssetConfig"
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4190
|
+
},
|
|
4191
|
+
{
|
|
4192
|
+
"name": "dynamics",
|
|
4193
|
+
"type": {
|
|
4194
|
+
"defined": {
|
|
4195
|
+
"name": "AssetDynamics"
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
}
|
|
4199
|
+
]
|
|
4200
|
+
}
|
|
4201
|
+
}
|
|
4202
|
+
]
|
|
4203
|
+
}
|