@drift-labs/vaults-sdk 0.1.461 → 0.1.463
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/lib/accounts/vaultAccount.d.ts +6 -1
- package/lib/accounts/vaultAccount.js +115 -0
- package/lib/addresses.d.ts +1 -0
- package/lib/addresses.js +7 -0
- package/lib/math/vaultDepositor.d.ts +11 -2
- package/lib/math/vaultDepositor.js +20 -2
- package/lib/types/drift_vaults.d.ts +587 -24
- package/lib/types/drift_vaults.js +587 -24
- package/lib/types/types.d.ts +77 -1
- package/lib/vaultClient.d.ts +52 -3
- package/lib/vaultClient.js +400 -42
- package/package.json +1 -1
- package/src/accounts/vaultAccount.ts +163 -2
- package/src/addresses.ts +13 -0
- package/src/idl/drift_vaults.json +598 -24
- package/src/math/vaultDepositor.ts +36 -4
- package/src/types/drift_vaults.ts +1231 -105
- package/src/types/types.ts +94 -1
- package/src/vaultClient.ts +532 -42
|
@@ -83,6 +83,89 @@ exports.IDL = {
|
|
|
83
83
|
},
|
|
84
84
|
],
|
|
85
85
|
},
|
|
86
|
+
{
|
|
87
|
+
name: 'initializeVaultWithProtocol',
|
|
88
|
+
accounts: [
|
|
89
|
+
{
|
|
90
|
+
name: 'vault',
|
|
91
|
+
isMut: true,
|
|
92
|
+
isSigner: false,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'vaultProtocol',
|
|
96
|
+
isMut: true,
|
|
97
|
+
isSigner: false,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'tokenAccount',
|
|
101
|
+
isMut: true,
|
|
102
|
+
isSigner: false,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'driftUserStats',
|
|
106
|
+
isMut: true,
|
|
107
|
+
isSigner: false,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'driftUser',
|
|
111
|
+
isMut: true,
|
|
112
|
+
isSigner: false,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'driftState',
|
|
116
|
+
isMut: true,
|
|
117
|
+
isSigner: false,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'driftSpotMarket',
|
|
121
|
+
isMut: false,
|
|
122
|
+
isSigner: false,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'driftSpotMarketMint',
|
|
126
|
+
isMut: false,
|
|
127
|
+
isSigner: false,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'manager',
|
|
131
|
+
isMut: false,
|
|
132
|
+
isSigner: true,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'payer',
|
|
136
|
+
isMut: true,
|
|
137
|
+
isSigner: true,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'rent',
|
|
141
|
+
isMut: false,
|
|
142
|
+
isSigner: false,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'systemProgram',
|
|
146
|
+
isMut: false,
|
|
147
|
+
isSigner: false,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'driftProgram',
|
|
151
|
+
isMut: false,
|
|
152
|
+
isSigner: false,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'tokenProgram',
|
|
156
|
+
isMut: false,
|
|
157
|
+
isSigner: false,
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
args: [
|
|
161
|
+
{
|
|
162
|
+
name: 'params',
|
|
163
|
+
type: {
|
|
164
|
+
defined: 'VaultWithProtocolParams',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
86
169
|
{
|
|
87
170
|
name: 'updateDelegate',
|
|
88
171
|
accounts: [
|
|
@@ -145,6 +228,34 @@ exports.IDL = {
|
|
|
145
228
|
},
|
|
146
229
|
],
|
|
147
230
|
},
|
|
231
|
+
{
|
|
232
|
+
name: 'updateVaultProtocol',
|
|
233
|
+
accounts: [
|
|
234
|
+
{
|
|
235
|
+
name: 'vault',
|
|
236
|
+
isMut: true,
|
|
237
|
+
isSigner: false,
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'protocol',
|
|
241
|
+
isMut: false,
|
|
242
|
+
isSigner: true,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: 'vaultProtocol',
|
|
246
|
+
isMut: true,
|
|
247
|
+
isSigner: false,
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
args: [
|
|
251
|
+
{
|
|
252
|
+
name: 'params',
|
|
253
|
+
type: {
|
|
254
|
+
defined: 'UpdateVaultProtocolParams',
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
},
|
|
148
259
|
{
|
|
149
260
|
name: 'updateVault',
|
|
150
261
|
accounts: [
|
|
@@ -905,6 +1016,155 @@ exports.IDL = {
|
|
|
905
1016
|
],
|
|
906
1017
|
args: [],
|
|
907
1018
|
},
|
|
1019
|
+
{
|
|
1020
|
+
name: 'protocolRequestWithdraw',
|
|
1021
|
+
accounts: [
|
|
1022
|
+
{
|
|
1023
|
+
name: 'vault',
|
|
1024
|
+
isMut: true,
|
|
1025
|
+
isSigner: false,
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
name: 'vaultProtocol',
|
|
1029
|
+
isMut: true,
|
|
1030
|
+
isSigner: false,
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
name: 'protocol',
|
|
1034
|
+
isMut: false,
|
|
1035
|
+
isSigner: true,
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
name: 'driftUserStats',
|
|
1039
|
+
isMut: false,
|
|
1040
|
+
isSigner: false,
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
name: 'driftUser',
|
|
1044
|
+
isMut: false,
|
|
1045
|
+
isSigner: false,
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
name: 'driftState',
|
|
1049
|
+
isMut: false,
|
|
1050
|
+
isSigner: false,
|
|
1051
|
+
},
|
|
1052
|
+
],
|
|
1053
|
+
args: [
|
|
1054
|
+
{
|
|
1055
|
+
name: 'withdrawAmount',
|
|
1056
|
+
type: 'u64',
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
name: 'withdrawUnit',
|
|
1060
|
+
type: {
|
|
1061
|
+
defined: 'WithdrawUnit',
|
|
1062
|
+
},
|
|
1063
|
+
},
|
|
1064
|
+
],
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
name: 'protocolCancelWithdrawRequest',
|
|
1068
|
+
accounts: [
|
|
1069
|
+
{
|
|
1070
|
+
name: 'vault',
|
|
1071
|
+
isMut: true,
|
|
1072
|
+
isSigner: false,
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
name: 'vaultProtocol',
|
|
1076
|
+
isMut: true,
|
|
1077
|
+
isSigner: false,
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
name: 'protocol',
|
|
1081
|
+
isMut: false,
|
|
1082
|
+
isSigner: true,
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
name: 'driftUserStats',
|
|
1086
|
+
isMut: false,
|
|
1087
|
+
isSigner: false,
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
name: 'driftUser',
|
|
1091
|
+
isMut: false,
|
|
1092
|
+
isSigner: false,
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
name: 'driftState',
|
|
1096
|
+
isMut: false,
|
|
1097
|
+
isSigner: false,
|
|
1098
|
+
},
|
|
1099
|
+
],
|
|
1100
|
+
args: [],
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
name: 'protocolWithdraw',
|
|
1104
|
+
accounts: [
|
|
1105
|
+
{
|
|
1106
|
+
name: 'vault',
|
|
1107
|
+
isMut: true,
|
|
1108
|
+
isSigner: false,
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
name: 'vaultProtocol',
|
|
1112
|
+
isMut: true,
|
|
1113
|
+
isSigner: false,
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
name: 'protocol',
|
|
1117
|
+
isMut: false,
|
|
1118
|
+
isSigner: true,
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
name: 'vaultTokenAccount',
|
|
1122
|
+
isMut: true,
|
|
1123
|
+
isSigner: false,
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
name: 'driftUserStats',
|
|
1127
|
+
isMut: true,
|
|
1128
|
+
isSigner: false,
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
name: 'driftUser',
|
|
1132
|
+
isMut: true,
|
|
1133
|
+
isSigner: false,
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
name: 'driftState',
|
|
1137
|
+
isMut: false,
|
|
1138
|
+
isSigner: false,
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
name: 'driftSpotMarketVault',
|
|
1142
|
+
isMut: true,
|
|
1143
|
+
isSigner: false,
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
name: 'driftSigner',
|
|
1147
|
+
isMut: false,
|
|
1148
|
+
isSigner: false,
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
name: 'userTokenAccount',
|
|
1152
|
+
isMut: true,
|
|
1153
|
+
isSigner: false,
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
name: 'driftProgram',
|
|
1157
|
+
isMut: false,
|
|
1158
|
+
isSigner: false,
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
name: 'tokenProgram',
|
|
1162
|
+
isMut: false,
|
|
1163
|
+
isSigner: false,
|
|
1164
|
+
},
|
|
1165
|
+
],
|
|
1166
|
+
args: [],
|
|
1167
|
+
},
|
|
908
1168
|
],
|
|
909
1169
|
accounts: [
|
|
910
1170
|
{
|
|
@@ -994,6 +1254,82 @@ exports.IDL = {
|
|
|
994
1254
|
],
|
|
995
1255
|
},
|
|
996
1256
|
},
|
|
1257
|
+
{
|
|
1258
|
+
name: 'vaultProtocol',
|
|
1259
|
+
type: {
|
|
1260
|
+
kind: 'struct',
|
|
1261
|
+
fields: [
|
|
1262
|
+
{
|
|
1263
|
+
name: 'protocol',
|
|
1264
|
+
docs: [
|
|
1265
|
+
'The protocol, company, or entity that services the product using this vault.',
|
|
1266
|
+
'The protocol is not allowed to deposit into the vault but can profit share and collect annual fees just like the manager.',
|
|
1267
|
+
],
|
|
1268
|
+
type: 'publicKey',
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
name: 'protocolProfitAndFeeShares',
|
|
1272
|
+
docs: [
|
|
1273
|
+
'The shares from profit share and annual fee unclaimed by the protocol.',
|
|
1274
|
+
],
|
|
1275
|
+
type: 'u128',
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
name: 'protocolFee',
|
|
1279
|
+
docs: [
|
|
1280
|
+
'The annual fee charged on deposits by the protocol (traditional hedge funds typically charge 2% per year on assets under management).',
|
|
1281
|
+
"Unlike the management fee this can't be negative.",
|
|
1282
|
+
],
|
|
1283
|
+
type: 'u64',
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
name: 'protocolTotalWithdraws',
|
|
1287
|
+
docs: ['Total withdraws for the protocol'],
|
|
1288
|
+
type: 'u64',
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
name: 'protocolTotalFee',
|
|
1292
|
+
docs: [
|
|
1293
|
+
'Total fee charged by the protocol (annual management fee + profit share).',
|
|
1294
|
+
"Unlike the management fee this can't be negative.",
|
|
1295
|
+
],
|
|
1296
|
+
type: 'u64',
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
name: 'protocolTotalProfitShare',
|
|
1300
|
+
docs: ['Total profit share charged by the protocol'],
|
|
1301
|
+
type: 'u64',
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
name: 'lastProtocolWithdrawRequest',
|
|
1305
|
+
type: {
|
|
1306
|
+
defined: 'WithdrawRequest',
|
|
1307
|
+
},
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
name: 'protocolProfitShare',
|
|
1311
|
+
docs: [
|
|
1312
|
+
'Percentage the protocol charges on all profits realized by depositors: PERCENTAGE_PRECISION',
|
|
1313
|
+
],
|
|
1314
|
+
type: 'u32',
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
name: 'bump',
|
|
1318
|
+
type: 'u8',
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
name: 'version',
|
|
1322
|
+
type: 'u8',
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
name: 'padding',
|
|
1326
|
+
type: {
|
|
1327
|
+
array: ['u8', 2],
|
|
1328
|
+
},
|
|
1329
|
+
},
|
|
1330
|
+
],
|
|
1331
|
+
},
|
|
1332
|
+
},
|
|
997
1333
|
{
|
|
998
1334
|
name: 'vault',
|
|
999
1335
|
type: {
|
|
@@ -1043,7 +1379,7 @@ exports.IDL = {
|
|
|
1043
1379
|
name: 'delegate',
|
|
1044
1380
|
docs: [
|
|
1045
1381
|
'The vaults designated delegate for drift user account',
|
|
1046
|
-
'
|
|
1382
|
+
'can differ from actual user delegate if vault is in liquidation',
|
|
1047
1383
|
],
|
|
1048
1384
|
type: 'publicKey',
|
|
1049
1385
|
},
|
|
@@ -1055,97 +1391,104 @@ exports.IDL = {
|
|
|
1055
1391
|
{
|
|
1056
1392
|
name: 'userShares',
|
|
1057
1393
|
docs: [
|
|
1058
|
-
'
|
|
1394
|
+
'The sum of all shares held by the users (vault depositors)',
|
|
1059
1395
|
],
|
|
1060
1396
|
type: 'u128',
|
|
1061
1397
|
},
|
|
1062
1398
|
{
|
|
1063
1399
|
name: 'totalShares',
|
|
1064
|
-
docs: [
|
|
1400
|
+
docs: [
|
|
1401
|
+
'The sum of all shares: deposits from users, manager deposits, manager profit/fee, and protocol profit/fee.',
|
|
1402
|
+
'The manager deposits are total_shares - user_shares - protocol_profit_and_fee_shares.',
|
|
1403
|
+
],
|
|
1065
1404
|
type: 'u128',
|
|
1066
1405
|
},
|
|
1067
1406
|
{
|
|
1068
1407
|
name: 'lastFeeUpdateTs',
|
|
1069
|
-
docs: ['
|
|
1408
|
+
docs: ['Last fee update unix timestamp'],
|
|
1070
1409
|
type: 'i64',
|
|
1071
1410
|
},
|
|
1072
1411
|
{
|
|
1073
1412
|
name: 'liquidationStartTs',
|
|
1074
|
-
docs: ['When the liquidation
|
|
1413
|
+
docs: ['When the liquidation starts'],
|
|
1075
1414
|
type: 'i64',
|
|
1076
1415
|
},
|
|
1077
1416
|
{
|
|
1078
1417
|
name: 'redeemPeriod',
|
|
1079
1418
|
docs: [
|
|
1080
|
-
'
|
|
1419
|
+
'The period (in seconds) that a vault depositor must wait after requesting a withdrawal to finalize withdrawal.',
|
|
1420
|
+
'Currently, the maximum is 90 days.',
|
|
1081
1421
|
],
|
|
1082
1422
|
type: 'i64',
|
|
1083
1423
|
},
|
|
1084
1424
|
{
|
|
1085
1425
|
name: 'totalWithdrawRequested',
|
|
1086
|
-
docs: ['
|
|
1426
|
+
docs: ['The sum of all outstanding withdraw requests'],
|
|
1087
1427
|
type: 'u64',
|
|
1088
1428
|
},
|
|
1089
1429
|
{
|
|
1090
1430
|
name: 'maxTokens',
|
|
1091
1431
|
docs: [
|
|
1092
|
-
'
|
|
1432
|
+
'Max token capacity, once hit/passed vault will reject new deposits (updatable)',
|
|
1093
1433
|
],
|
|
1094
1434
|
type: 'u64',
|
|
1095
1435
|
},
|
|
1096
1436
|
{
|
|
1097
1437
|
name: 'managementFee',
|
|
1098
|
-
docs: [
|
|
1438
|
+
docs: [
|
|
1439
|
+
'The annual fee charged on deposits by the manager.',
|
|
1440
|
+
'Traditional funds typically charge 2% per year on assets under management.',
|
|
1441
|
+
],
|
|
1099
1442
|
type: 'i64',
|
|
1100
1443
|
},
|
|
1101
1444
|
{
|
|
1102
1445
|
name: 'initTs',
|
|
1103
|
-
docs: ['
|
|
1446
|
+
docs: ['Timestamp vault initialized'],
|
|
1104
1447
|
type: 'i64',
|
|
1105
1448
|
},
|
|
1106
1449
|
{
|
|
1107
1450
|
name: 'netDeposits',
|
|
1108
|
-
docs: ['
|
|
1451
|
+
docs: ['The net deposits for the vault'],
|
|
1109
1452
|
type: 'i64',
|
|
1110
1453
|
},
|
|
1111
1454
|
{
|
|
1112
1455
|
name: 'managerNetDeposits',
|
|
1113
|
-
docs: ['
|
|
1456
|
+
docs: ['The net deposits for the manager'],
|
|
1114
1457
|
type: 'i64',
|
|
1115
1458
|
},
|
|
1116
1459
|
{
|
|
1117
1460
|
name: 'totalDeposits',
|
|
1118
|
-
docs: ['
|
|
1461
|
+
docs: ['Total deposits'],
|
|
1119
1462
|
type: 'u64',
|
|
1120
1463
|
},
|
|
1121
1464
|
{
|
|
1122
1465
|
name: 'totalWithdraws',
|
|
1123
|
-
docs: ['
|
|
1466
|
+
docs: ['Total withdraws'],
|
|
1124
1467
|
type: 'u64',
|
|
1125
1468
|
},
|
|
1126
1469
|
{
|
|
1127
1470
|
name: 'managerTotalDeposits',
|
|
1128
|
-
docs: ['
|
|
1471
|
+
docs: ['Total deposits for the manager'],
|
|
1129
1472
|
type: 'u64',
|
|
1130
1473
|
},
|
|
1131
1474
|
{
|
|
1132
1475
|
name: 'managerTotalWithdraws',
|
|
1133
|
-
docs: ['
|
|
1476
|
+
docs: ['Total withdraws for the manager'],
|
|
1134
1477
|
type: 'u64',
|
|
1135
1478
|
},
|
|
1136
1479
|
{
|
|
1137
1480
|
name: 'managerTotalFee',
|
|
1138
|
-
docs: ['
|
|
1481
|
+
docs: ['Total management fee accrued by the manager'],
|
|
1139
1482
|
type: 'i64',
|
|
1140
1483
|
},
|
|
1141
1484
|
{
|
|
1142
1485
|
name: 'managerTotalProfitShare',
|
|
1143
|
-
docs: ['
|
|
1486
|
+
docs: ['Total profit share accrued by the manager'],
|
|
1144
1487
|
type: 'u64',
|
|
1145
1488
|
},
|
|
1146
1489
|
{
|
|
1147
1490
|
name: 'minDepositAmount',
|
|
1148
|
-
docs: ['
|
|
1491
|
+
docs: ['The minimum deposit amount'],
|
|
1149
1492
|
type: 'u64',
|
|
1150
1493
|
},
|
|
1151
1494
|
{
|
|
@@ -1157,21 +1500,21 @@ exports.IDL = {
|
|
|
1157
1500
|
{
|
|
1158
1501
|
name: 'sharesBase',
|
|
1159
1502
|
docs: [
|
|
1160
|
-
'
|
|
1503
|
+
'The base 10 exponent of the shares (given massive share inflation can occur at near zero vault equity)',
|
|
1161
1504
|
],
|
|
1162
1505
|
type: 'u32',
|
|
1163
1506
|
},
|
|
1164
1507
|
{
|
|
1165
1508
|
name: 'profitShare',
|
|
1166
1509
|
docs: [
|
|
1167
|
-
|
|
1510
|
+
'Percentage the manager charges on all profits realized by depositors: PERCENTAGE_PRECISION',
|
|
1168
1511
|
],
|
|
1169
1512
|
type: 'u32',
|
|
1170
1513
|
},
|
|
1171
1514
|
{
|
|
1172
1515
|
name: 'hurdleRate',
|
|
1173
1516
|
docs: [
|
|
1174
|
-
'
|
|
1517
|
+
'Vault manager only collect incentive fees during periods when returns are higher than this amount: PERCENTAGE_PRECISION',
|
|
1175
1518
|
],
|
|
1176
1519
|
type: 'u32',
|
|
1177
1520
|
},
|
|
@@ -1189,13 +1532,24 @@ exports.IDL = {
|
|
|
1189
1532
|
},
|
|
1190
1533
|
{
|
|
1191
1534
|
name: 'permissioned',
|
|
1192
|
-
docs: ['Whether
|
|
1535
|
+
docs: ['Whether anybody can be a depositor'],
|
|
1193
1536
|
type: 'bool',
|
|
1194
1537
|
},
|
|
1538
|
+
{
|
|
1539
|
+
name: 'vaultProtocol',
|
|
1540
|
+
docs: ['The optional [`VaultProtocol`] account.'],
|
|
1541
|
+
type: 'bool',
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
name: 'padding1',
|
|
1545
|
+
type: {
|
|
1546
|
+
array: ['u8', 7],
|
|
1547
|
+
},
|
|
1548
|
+
},
|
|
1195
1549
|
{
|
|
1196
1550
|
name: 'padding',
|
|
1197
1551
|
type: {
|
|
1198
|
-
array: ['u64',
|
|
1552
|
+
array: ['u64', 7],
|
|
1199
1553
|
},
|
|
1200
1554
|
},
|
|
1201
1555
|
],
|
|
@@ -1203,6 +1557,78 @@ exports.IDL = {
|
|
|
1203
1557
|
},
|
|
1204
1558
|
],
|
|
1205
1559
|
types: [
|
|
1560
|
+
{
|
|
1561
|
+
name: 'VaultWithProtocolParams',
|
|
1562
|
+
type: {
|
|
1563
|
+
kind: 'struct',
|
|
1564
|
+
fields: [
|
|
1565
|
+
{
|
|
1566
|
+
name: 'name',
|
|
1567
|
+
type: {
|
|
1568
|
+
array: ['u8', 32],
|
|
1569
|
+
},
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
name: 'redeemPeriod',
|
|
1573
|
+
type: 'i64',
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
name: 'maxTokens',
|
|
1577
|
+
type: 'u64',
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
name: 'managementFee',
|
|
1581
|
+
type: 'i64',
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
name: 'minDepositAmount',
|
|
1585
|
+
type: 'u64',
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
name: 'profitShare',
|
|
1589
|
+
type: 'u32',
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
name: 'hurdleRate',
|
|
1593
|
+
type: 'u32',
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
name: 'spotMarketIndex',
|
|
1597
|
+
type: 'u16',
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
name: 'permissioned',
|
|
1601
|
+
type: 'bool',
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
name: 'vaultProtocol',
|
|
1605
|
+
type: {
|
|
1606
|
+
defined: 'VaultProtocolParams',
|
|
1607
|
+
},
|
|
1608
|
+
},
|
|
1609
|
+
],
|
|
1610
|
+
},
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
name: 'VaultProtocolParams',
|
|
1614
|
+
type: {
|
|
1615
|
+
kind: 'struct',
|
|
1616
|
+
fields: [
|
|
1617
|
+
{
|
|
1618
|
+
name: 'protocol',
|
|
1619
|
+
type: 'publicKey',
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
name: 'protocolFee',
|
|
1623
|
+
type: 'u64',
|
|
1624
|
+
},
|
|
1625
|
+
{
|
|
1626
|
+
name: 'protocolProfitShare',
|
|
1627
|
+
type: 'u32',
|
|
1628
|
+
},
|
|
1629
|
+
],
|
|
1630
|
+
},
|
|
1631
|
+
},
|
|
1206
1632
|
{
|
|
1207
1633
|
name: 'VaultParams',
|
|
1208
1634
|
type: {
|
|
@@ -1249,6 +1675,26 @@ exports.IDL = {
|
|
|
1249
1675
|
],
|
|
1250
1676
|
},
|
|
1251
1677
|
},
|
|
1678
|
+
{
|
|
1679
|
+
name: 'UpdateVaultProtocolParams',
|
|
1680
|
+
type: {
|
|
1681
|
+
kind: 'struct',
|
|
1682
|
+
fields: [
|
|
1683
|
+
{
|
|
1684
|
+
name: 'protocolFee',
|
|
1685
|
+
type: {
|
|
1686
|
+
option: 'u64',
|
|
1687
|
+
},
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
name: 'protocolProfitShare',
|
|
1691
|
+
type: {
|
|
1692
|
+
option: 'u32',
|
|
1693
|
+
},
|
|
1694
|
+
},
|
|
1695
|
+
],
|
|
1696
|
+
},
|
|
1697
|
+
},
|
|
1252
1698
|
{
|
|
1253
1699
|
name: 'UpdateVaultParams',
|
|
1254
1700
|
type: {
|
|
@@ -1473,6 +1919,118 @@ exports.IDL = {
|
|
|
1473
1919
|
},
|
|
1474
1920
|
],
|
|
1475
1921
|
},
|
|
1922
|
+
{
|
|
1923
|
+
name: 'VaultDepositorV1Record',
|
|
1924
|
+
fields: [
|
|
1925
|
+
{
|
|
1926
|
+
name: 'ts',
|
|
1927
|
+
type: 'i64',
|
|
1928
|
+
index: false,
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
name: 'vault',
|
|
1932
|
+
type: 'publicKey',
|
|
1933
|
+
index: false,
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
name: 'depositorAuthority',
|
|
1937
|
+
type: 'publicKey',
|
|
1938
|
+
index: false,
|
|
1939
|
+
},
|
|
1940
|
+
{
|
|
1941
|
+
name: 'action',
|
|
1942
|
+
type: {
|
|
1943
|
+
defined: 'VaultDepositorAction',
|
|
1944
|
+
},
|
|
1945
|
+
index: false,
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
name: 'amount',
|
|
1949
|
+
type: 'u64',
|
|
1950
|
+
index: false,
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
name: 'spotMarketIndex',
|
|
1954
|
+
type: 'u16',
|
|
1955
|
+
index: false,
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
name: 'vaultSharesBefore',
|
|
1959
|
+
type: 'u128',
|
|
1960
|
+
index: false,
|
|
1961
|
+
},
|
|
1962
|
+
{
|
|
1963
|
+
name: 'vaultSharesAfter',
|
|
1964
|
+
type: 'u128',
|
|
1965
|
+
index: false,
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
name: 'vaultEquityBefore',
|
|
1969
|
+
type: 'u64',
|
|
1970
|
+
index: false,
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
name: 'userVaultSharesBefore',
|
|
1974
|
+
type: 'u128',
|
|
1975
|
+
index: false,
|
|
1976
|
+
},
|
|
1977
|
+
{
|
|
1978
|
+
name: 'totalVaultSharesBefore',
|
|
1979
|
+
type: 'u128',
|
|
1980
|
+
index: false,
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
name: 'userVaultSharesAfter',
|
|
1984
|
+
type: 'u128',
|
|
1985
|
+
index: false,
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
name: 'totalVaultSharesAfter',
|
|
1989
|
+
type: 'u128',
|
|
1990
|
+
index: false,
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
name: 'protocolSharesBefore',
|
|
1994
|
+
type: 'u128',
|
|
1995
|
+
index: false,
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
name: 'protocolSharesAfter',
|
|
1999
|
+
type: 'u128',
|
|
2000
|
+
index: false,
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
name: 'protocolProfitShare',
|
|
2004
|
+
type: 'u64',
|
|
2005
|
+
index: false,
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
name: 'protocolFee',
|
|
2009
|
+
type: 'i64',
|
|
2010
|
+
index: false,
|
|
2011
|
+
},
|
|
2012
|
+
{
|
|
2013
|
+
name: 'protocolFeeShares',
|
|
2014
|
+
type: 'i64',
|
|
2015
|
+
index: false,
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
name: 'managerProfitShare',
|
|
2019
|
+
type: 'u64',
|
|
2020
|
+
index: false,
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
name: 'managementFee',
|
|
2024
|
+
type: 'i64',
|
|
2025
|
+
index: false,
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
name: 'managementFeeShares',
|
|
2029
|
+
type: 'i64',
|
|
2030
|
+
index: false,
|
|
2031
|
+
},
|
|
2032
|
+
],
|
|
2033
|
+
},
|
|
1476
2034
|
],
|
|
1477
2035
|
errors: [
|
|
1478
2036
|
{
|
|
@@ -1585,5 +2143,10 @@ exports.IDL = {
|
|
|
1585
2143
|
name: 'OngoingLiquidation',
|
|
1586
2144
|
msg: 'OngoingLiquidation',
|
|
1587
2145
|
},
|
|
2146
|
+
{
|
|
2147
|
+
code: 6022,
|
|
2148
|
+
name: 'VaultProtocolMissing',
|
|
2149
|
+
msg: 'VaultProtocolMissing',
|
|
2150
|
+
},
|
|
1588
2151
|
],
|
|
1589
2152
|
};
|