@drift-labs/vaults-sdk 0.1.422 → 0.1.424

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.
@@ -142,34 +142,6 @@ export type DriftVaults = {
142
142
  }
143
143
  ];
144
144
  },
145
- {
146
- name: 'updateVaultProtocol';
147
- accounts: [
148
- {
149
- name: 'vault';
150
- isMut: true;
151
- isSigner: false;
152
- },
153
- {
154
- name: 'protocol';
155
- isMut: false;
156
- isSigner: true;
157
- },
158
- {
159
- name: 'vaultProtocol';
160
- isMut: true;
161
- isSigner: false;
162
- }
163
- ];
164
- args: [
165
- {
166
- name: 'params';
167
- type: {
168
- defined: 'UpdateVaultProtocolParams';
169
- };
170
- }
171
- ];
172
- },
173
145
  {
174
146
  name: 'updateVault';
175
147
  accounts: [
@@ -929,155 +901,6 @@ export type DriftVaults = {
929
901
  }
930
902
  ];
931
903
  args: [];
932
- },
933
- {
934
- name: 'protocolRequestWithdraw';
935
- accounts: [
936
- {
937
- name: 'vault';
938
- isMut: true;
939
- isSigner: false;
940
- },
941
- {
942
- name: 'vaultProtocol';
943
- isMut: true;
944
- isSigner: false;
945
- },
946
- {
947
- name: 'protocol';
948
- isMut: false;
949
- isSigner: true;
950
- },
951
- {
952
- name: 'driftUserStats';
953
- isMut: false;
954
- isSigner: false;
955
- },
956
- {
957
- name: 'driftUser';
958
- isMut: false;
959
- isSigner: false;
960
- },
961
- {
962
- name: 'driftState';
963
- isMut: false;
964
- isSigner: false;
965
- }
966
- ];
967
- args: [
968
- {
969
- name: 'withdrawAmount';
970
- type: 'u64';
971
- },
972
- {
973
- name: 'withdrawUnit';
974
- type: {
975
- defined: 'WithdrawUnit';
976
- };
977
- }
978
- ];
979
- },
980
- {
981
- name: 'protocolCancelWithdrawRequest';
982
- accounts: [
983
- {
984
- name: 'vault';
985
- isMut: true;
986
- isSigner: false;
987
- },
988
- {
989
- name: 'vaultProtocol';
990
- isMut: true;
991
- isSigner: false;
992
- },
993
- {
994
- name: 'protocol';
995
- isMut: false;
996
- isSigner: true;
997
- },
998
- {
999
- name: 'driftUserStats';
1000
- isMut: false;
1001
- isSigner: false;
1002
- },
1003
- {
1004
- name: 'driftUser';
1005
- isMut: false;
1006
- isSigner: false;
1007
- },
1008
- {
1009
- name: 'driftState';
1010
- isMut: false;
1011
- isSigner: false;
1012
- }
1013
- ];
1014
- args: [];
1015
- },
1016
- {
1017
- name: 'protocolWithdraw';
1018
- accounts: [
1019
- {
1020
- name: 'vault';
1021
- isMut: true;
1022
- isSigner: false;
1023
- },
1024
- {
1025
- name: 'vaultProtocol';
1026
- isMut: true;
1027
- isSigner: false;
1028
- },
1029
- {
1030
- name: 'protocol';
1031
- isMut: false;
1032
- isSigner: true;
1033
- },
1034
- {
1035
- name: 'vaultTokenAccount';
1036
- isMut: true;
1037
- isSigner: false;
1038
- },
1039
- {
1040
- name: 'driftUserStats';
1041
- isMut: true;
1042
- isSigner: false;
1043
- },
1044
- {
1045
- name: 'driftUser';
1046
- isMut: true;
1047
- isSigner: false;
1048
- },
1049
- {
1050
- name: 'driftState';
1051
- isMut: false;
1052
- isSigner: false;
1053
- },
1054
- {
1055
- name: 'driftSpotMarketVault';
1056
- isMut: true;
1057
- isSigner: false;
1058
- },
1059
- {
1060
- name: 'driftSigner';
1061
- isMut: false;
1062
- isSigner: false;
1063
- },
1064
- {
1065
- name: 'userTokenAccount';
1066
- isMut: true;
1067
- isSigner: false;
1068
- },
1069
- {
1070
- name: 'driftProgram';
1071
- isMut: false;
1072
- isSigner: false;
1073
- },
1074
- {
1075
- name: 'tokenProgram';
1076
- isMut: false;
1077
- isSigner: false;
1078
- }
1079
- ];
1080
- args: [];
1081
904
  }
1082
905
  ];
1083
906
  accounts: [
@@ -1168,85 +991,6 @@ export type DriftVaults = {
1168
991
  ];
1169
992
  };
1170
993
  },
1171
- {
1172
- name: 'vaultProtocol';
1173
- type: {
1174
- kind: 'struct';
1175
- fields: [
1176
- {
1177
- name: 'protocol';
1178
- docs: [
1179
- 'The protocol, company, or entity that services the product using this vault.',
1180
- 'The protocol is not allowed to deposit into the vault but can profit share and collect annual fees just like the manager.'
1181
- ];
1182
- type: 'publicKey';
1183
- },
1184
- {
1185
- name: 'protocolProfitAndFeeShares';
1186
- docs: [
1187
- 'The shares from profit share and annual fee unclaimed by the protocol.'
1188
- ];
1189
- type: 'u128';
1190
- },
1191
- {
1192
- name: 'protocolFee';
1193
- docs: [
1194
- 'The annual fee charged on deposits by the protocol (traditional hedge funds typically charge 2% per year on assets under management).',
1195
- "Unlike the management fee this can't be negative."
1196
- ];
1197
- type: 'u64';
1198
- },
1199
- {
1200
- name: 'protocolTotalWithdraws';
1201
- docs: ['Total withdraws for the protocol'];
1202
- type: 'u64';
1203
- },
1204
- {
1205
- name: 'protocolTotalFee';
1206
- docs: [
1207
- 'Total fee charged by the protocol (annual management fee + profit share).',
1208
- "Unlike the management fee this can't be negative."
1209
- ];
1210
- type: 'u64';
1211
- },
1212
- {
1213
- name: 'protocolTotalProfitShare';
1214
- docs: ['Total profit share charged by the protocol'];
1215
- type: 'u64';
1216
- },
1217
- {
1218
- name: 'lastProtocolWithdrawRequest';
1219
- type: {
1220
- defined: 'WithdrawRequest';
1221
- };
1222
- },
1223
- {
1224
- name: 'protocolProfitShare';
1225
- docs: [
1226
- 'Percentage the protocol charges on all profits realized by depositors: PERCENTAGE_PRECISION'
1227
- ];
1228
- type: 'u32';
1229
- },
1230
- {
1231
- name: 'bump';
1232
- type: 'u8';
1233
- },
1234
- {
1235
- name: 'version';
1236
- type: 'u8';
1237
- },
1238
- {
1239
- name: 'padding';
1240
- docs: [
1241
- '[`VaultProtocol`] is 117 bytes with padding to 120 bytes to make it a multiple of 8.'
1242
- ];
1243
- type: {
1244
- array: ['u8', 2];
1245
- };
1246
- }
1247
- ];
1248
- };
1249
- },
1250
994
  {
1251
995
  name: 'vault';
1252
996
  type: {
@@ -1296,7 +1040,7 @@ export type DriftVaults = {
1296
1040
  name: 'delegate';
1297
1041
  docs: [
1298
1042
  'The vaults designated delegate for drift user account',
1299
- 'can differ from actual user delegate if vault is in liquidation'
1043
+ 'Can differ from actual user delegate if vault is in liquidation'
1300
1044
  ];
1301
1045
  type: 'publicKey';
1302
1046
  },
@@ -1308,104 +1052,97 @@ export type DriftVaults = {
1308
1052
  {
1309
1053
  name: 'userShares';
1310
1054
  docs: [
1311
- 'The sum of all shares held by the users (vault depositors)'
1055
+ 'the sum of all shares held by the users (vault depositors)'
1312
1056
  ];
1313
1057
  type: 'u128';
1314
1058
  },
1315
1059
  {
1316
1060
  name: 'totalShares';
1317
- docs: [
1318
- 'The sum of all shares: deposits from users, manager deposits, manager profit/fee, and protocol profit/fee.',
1319
- 'The manager deposits are total_shares - user_shares - protocol_profit_and_fee_shares.'
1320
- ];
1061
+ docs: ['the sum of all shares (including vault manager)'];
1321
1062
  type: 'u128';
1322
1063
  },
1323
1064
  {
1324
1065
  name: 'lastFeeUpdateTs';
1325
- docs: ['Last fee update unix timestamp'];
1066
+ docs: ['last fee update unix timestamp'];
1326
1067
  type: 'i64';
1327
1068
  },
1328
1069
  {
1329
1070
  name: 'liquidationStartTs';
1330
- docs: ['When the liquidation starts'];
1071
+ docs: ['When the liquidation start'];
1331
1072
  type: 'i64';
1332
1073
  },
1333
1074
  {
1334
1075
  name: 'redeemPeriod';
1335
1076
  docs: [
1336
- 'The period (in seconds) that a vault depositor must wait after requesting a withdrawal to finalize withdrawal.',
1337
- 'Currently, the maximum is 90 days.'
1077
+ 'the period (in seconds) that a vault depositor must wait after requesting a withdraw to complete withdraw'
1338
1078
  ];
1339
1079
  type: 'i64';
1340
1080
  },
1341
1081
  {
1342
1082
  name: 'totalWithdrawRequested';
1343
- docs: ['The sum of all outstanding withdraw requests'];
1083
+ docs: ['the sum of all outstanding withdraw requests'];
1344
1084
  type: 'u64';
1345
1085
  },
1346
1086
  {
1347
1087
  name: 'maxTokens';
1348
1088
  docs: [
1349
- 'Max token capacity, once hit/passed vault will reject new deposits (updatable)'
1089
+ 'max token capacity, once hit/passed vault will reject new deposits (updateable)'
1350
1090
  ];
1351
1091
  type: 'u64';
1352
1092
  },
1353
1093
  {
1354
1094
  name: 'managementFee';
1355
- docs: [
1356
- 'The annual fee charged on deposits by the manager.',
1357
- 'Traditional funds typically charge 2% per year on assets under management.'
1358
- ];
1095
+ docs: ['manager fee'];
1359
1096
  type: 'i64';
1360
1097
  },
1361
1098
  {
1362
1099
  name: 'initTs';
1363
- docs: ['Timestamp vault initialized'];
1100
+ docs: ['timestamp vault initialized'];
1364
1101
  type: 'i64';
1365
1102
  },
1366
1103
  {
1367
1104
  name: 'netDeposits';
1368
- docs: ['The net deposits for the vault'];
1105
+ docs: ['the net deposits for the vault'];
1369
1106
  type: 'i64';
1370
1107
  },
1371
1108
  {
1372
1109
  name: 'managerNetDeposits';
1373
- docs: ['The net deposits for the manager'];
1110
+ docs: ['the net deposits for the vault manager'];
1374
1111
  type: 'i64';
1375
1112
  },
1376
1113
  {
1377
1114
  name: 'totalDeposits';
1378
- docs: ['Total deposits'];
1115
+ docs: ['total deposits'];
1379
1116
  type: 'u64';
1380
1117
  },
1381
1118
  {
1382
1119
  name: 'totalWithdraws';
1383
- docs: ['Total withdraws'];
1120
+ docs: ['total withdraws'];
1384
1121
  type: 'u64';
1385
1122
  },
1386
1123
  {
1387
1124
  name: 'managerTotalDeposits';
1388
- docs: ['Total deposits for the manager'];
1125
+ docs: ['total deposits for the vault manager'];
1389
1126
  type: 'u64';
1390
1127
  },
1391
1128
  {
1392
1129
  name: 'managerTotalWithdraws';
1393
- docs: ['Total withdraws for the manager'];
1130
+ docs: ['total withdraws for the vault manager'];
1394
1131
  type: 'u64';
1395
1132
  },
1396
1133
  {
1397
1134
  name: 'managerTotalFee';
1398
- docs: ['Total management fee accrued by the manager'];
1135
+ docs: ['total mgmt fee charged by vault manager'];
1399
1136
  type: 'i64';
1400
1137
  },
1401
1138
  {
1402
1139
  name: 'managerTotalProfitShare';
1403
- docs: ['Total profit share accrued by the manager'];
1140
+ docs: ['total profit share charged by vault manager'];
1404
1141
  type: 'u64';
1405
1142
  },
1406
1143
  {
1407
1144
  name: 'minDepositAmount';
1408
- docs: ['The minimum deposit amount'];
1145
+ docs: ['the minimum deposit amount'];
1409
1146
  type: 'u64';
1410
1147
  },
1411
1148
  {
@@ -1417,21 +1154,21 @@ export type DriftVaults = {
1417
1154
  {
1418
1155
  name: 'sharesBase';
1419
1156
  docs: [
1420
- 'The base 10 exponent of the shares (given massive share inflation can occur at near zero vault equity)'
1157
+ 'the base 10 exponent of the shares (given massive share inflation can occur at near zero vault equity)'
1421
1158
  ];
1422
1159
  type: 'u32';
1423
1160
  },
1424
1161
  {
1425
1162
  name: 'profitShare';
1426
1163
  docs: [
1427
- 'Percentage the manager charges on all profits realized by depositors: PERCENTAGE_PRECISION'
1164
+ "percentage of gains for vault admin upon depositor's realize/withdraw: PERCENTAGE_PRECISION"
1428
1165
  ];
1429
1166
  type: 'u32';
1430
1167
  },
1431
1168
  {
1432
1169
  name: 'hurdleRate';
1433
1170
  docs: [
1434
- 'Vault manager only collect incentive fees during periods when returns are higher than this amount: PERCENTAGE_PRECISION'
1171
+ 'vault admin only collect incentive fees during periods when returns are higher than this amount: PERCENTAGE_PRECISION'
1435
1172
  ];
1436
1173
  type: 'u32';
1437
1174
  },
@@ -1449,21 +1186,13 @@ export type DriftVaults = {
1449
1186
  },
1450
1187
  {
1451
1188
  name: 'permissioned';
1452
- docs: ['Whether anybody can be a depositor'];
1189
+ docs: ['Whether or not anybody can be a depositor'];
1453
1190
  type: 'bool';
1454
1191
  },
1455
- {
1456
- name: 'vaultProtocol';
1457
- docs: [
1458
- 'The optional [`VaultProtocol`] account.',
1459
- 'If this is the default Pubkey (system program id) then it is "none".'
1460
- ];
1461
- type: 'publicKey';
1462
- },
1463
1192
  {
1464
1193
  name: 'padding';
1465
1194
  type: {
1466
- array: ['u64', 4];
1195
+ array: ['u64', 8];
1467
1196
  };
1468
1197
  }
1469
1198
  ];
@@ -1513,54 +1242,6 @@ export type DriftVaults = {
1513
1242
  {
1514
1243
  name: 'permissioned';
1515
1244
  type: 'bool';
1516
- },
1517
- {
1518
- name: 'vaultProtocol';
1519
- type: {
1520
- option: {
1521
- defined: 'VaultProtocolParams';
1522
- };
1523
- };
1524
- }
1525
- ];
1526
- };
1527
- },
1528
- {
1529
- name: 'VaultProtocolParams';
1530
- type: {
1531
- kind: 'struct';
1532
- fields: [
1533
- {
1534
- name: 'protocol';
1535
- type: 'publicKey';
1536
- },
1537
- {
1538
- name: 'protocolFee';
1539
- type: 'u64';
1540
- },
1541
- {
1542
- name: 'protocolProfitShare';
1543
- type: 'u32';
1544
- }
1545
- ];
1546
- };
1547
- },
1548
- {
1549
- name: 'UpdateVaultProtocolParams';
1550
- type: {
1551
- kind: 'struct';
1552
- fields: [
1553
- {
1554
- name: 'protocolFee';
1555
- type: {
1556
- option: 'u64';
1557
- };
1558
- },
1559
- {
1560
- name: 'protocolProfitShare';
1561
- type: {
1562
- option: 'u32';
1563
- };
1564
1245
  }
1565
1246
  ];
1566
1247
  };
@@ -1788,108 +1469,6 @@ export type DriftVaults = {
1788
1469
  index: false;
1789
1470
  }
1790
1471
  ];
1791
- },
1792
- {
1793
- name: 'VaultDepositorV1Record';
1794
- fields: [
1795
- {
1796
- name: 'ts';
1797
- type: 'i64';
1798
- index: false;
1799
- },
1800
- {
1801
- name: 'vault';
1802
- type: 'publicKey';
1803
- index: false;
1804
- },
1805
- {
1806
- name: 'depositorAuthority';
1807
- type: 'publicKey';
1808
- index: false;
1809
- },
1810
- {
1811
- name: 'action';
1812
- type: {
1813
- defined: 'VaultDepositorAction';
1814
- };
1815
- index: false;
1816
- },
1817
- {
1818
- name: 'amount';
1819
- type: 'u64';
1820
- index: false;
1821
- },
1822
- {
1823
- name: 'spotMarketIndex';
1824
- type: 'u16';
1825
- index: false;
1826
- },
1827
- {
1828
- name: 'vaultSharesBefore';
1829
- type: 'u128';
1830
- index: false;
1831
- },
1832
- {
1833
- name: 'vaultSharesAfter';
1834
- type: 'u128';
1835
- index: false;
1836
- },
1837
- {
1838
- name: 'vaultEquityBefore';
1839
- type: 'u64';
1840
- index: false;
1841
- },
1842
- {
1843
- name: 'userVaultSharesBefore';
1844
- type: 'u128';
1845
- index: false;
1846
- },
1847
- {
1848
- name: 'totalVaultSharesBefore';
1849
- type: 'u128';
1850
- index: false;
1851
- },
1852
- {
1853
- name: 'userVaultSharesAfter';
1854
- type: 'u128';
1855
- index: false;
1856
- },
1857
- {
1858
- name: 'totalVaultSharesAfter';
1859
- type: 'u128';
1860
- index: false;
1861
- },
1862
- {
1863
- name: 'protocolProfitShare';
1864
- type: 'u64';
1865
- index: false;
1866
- },
1867
- {
1868
- name: 'protocolFee';
1869
- type: 'i64';
1870
- index: false;
1871
- },
1872
- {
1873
- name: 'protocolFeeShares';
1874
- type: 'i64';
1875
- index: false;
1876
- },
1877
- {
1878
- name: 'managerProfitShare';
1879
- type: 'u64';
1880
- index: false;
1881
- },
1882
- {
1883
- name: 'managementFee';
1884
- type: 'i64';
1885
- index: false;
1886
- },
1887
- {
1888
- name: 'managementFeeShares';
1889
- type: 'i64';
1890
- index: false;
1891
- }
1892
- ];
1893
1472
  }
1894
1473
  ];
1895
1474
  errors: [
@@ -2002,11 +1581,6 @@ export type DriftVaults = {
2002
1581
  code: 6021;
2003
1582
  name: 'OngoingLiquidation';
2004
1583
  msg: 'OngoingLiquidation';
2005
- },
2006
- {
2007
- code: 6022;
2008
- name: 'VaultProtocolMissing';
2009
- msg: 'VaultProtocolMissing';
2010
1584
  }
2011
1585
  ];
2012
1586
  };