@drift-labs/vaults-sdk 0.1.482 → 0.1.484
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/bun.lockb +0 -0
- package/lib/types/types.d.ts +2 -2
- package/package.json +2 -2
- package/src/idl/drift_vaults.json +131 -820
- package/src/types/types.ts +2 -2
package/bun.lockb
CHANGED
|
Binary file
|
package/lib/types/types.d.ts
CHANGED
|
@@ -109,8 +109,8 @@ export type VaultDepositor = {
|
|
|
109
109
|
cumulativeProfitShareAmount: BN;
|
|
110
110
|
vaultSharesBase: number;
|
|
111
111
|
profitShareFeePaid: BN;
|
|
112
|
-
padding1: number;
|
|
113
|
-
padding: BN[];
|
|
112
|
+
padding1: number | number[];
|
|
113
|
+
padding: number[] | BN[];
|
|
114
114
|
};
|
|
115
115
|
export type VaultProtocol = {
|
|
116
116
|
protocol: PublicKey;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/vaults-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.484",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"directories": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@coral-xyz/anchor": "0.28.0",
|
|
11
11
|
"@drift-labs/competitions-sdk": "0.2.386",
|
|
12
|
-
"@drift-labs/sdk": "2.96.0-beta.
|
|
12
|
+
"@drift-labs/sdk": "2.96.0-beta.26",
|
|
13
13
|
"@solana/web3.js": "1.92.3",
|
|
14
14
|
"commander": "^11.0.0",
|
|
15
15
|
"dotenv": "^16.3.1",
|
|
@@ -80,89 +80,6 @@
|
|
|
80
80
|
}
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
{
|
|
84
|
-
"name": "initializeVaultWithProtocol",
|
|
85
|
-
"accounts": [
|
|
86
|
-
{
|
|
87
|
-
"name": "vault",
|
|
88
|
-
"isMut": true,
|
|
89
|
-
"isSigner": false
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"name": "vaultProtocol",
|
|
93
|
-
"isMut": true,
|
|
94
|
-
"isSigner": false
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"name": "tokenAccount",
|
|
98
|
-
"isMut": true,
|
|
99
|
-
"isSigner": false
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"name": "driftUserStats",
|
|
103
|
-
"isMut": true,
|
|
104
|
-
"isSigner": false
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"name": "driftUser",
|
|
108
|
-
"isMut": true,
|
|
109
|
-
"isSigner": false
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"name": "driftState",
|
|
113
|
-
"isMut": true,
|
|
114
|
-
"isSigner": false
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"name": "driftSpotMarket",
|
|
118
|
-
"isMut": false,
|
|
119
|
-
"isSigner": false
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "driftSpotMarketMint",
|
|
123
|
-
"isMut": false,
|
|
124
|
-
"isSigner": false
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"name": "manager",
|
|
128
|
-
"isMut": false,
|
|
129
|
-
"isSigner": true
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"name": "payer",
|
|
133
|
-
"isMut": true,
|
|
134
|
-
"isSigner": true
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"name": "rent",
|
|
138
|
-
"isMut": false,
|
|
139
|
-
"isSigner": false
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"name": "systemProgram",
|
|
143
|
-
"isMut": false,
|
|
144
|
-
"isSigner": false
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "driftProgram",
|
|
148
|
-
"isMut": false,
|
|
149
|
-
"isSigner": false
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"name": "tokenProgram",
|
|
153
|
-
"isMut": false,
|
|
154
|
-
"isSigner": false
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
"args": [
|
|
158
|
-
{
|
|
159
|
-
"name": "params",
|
|
160
|
-
"type": {
|
|
161
|
-
"defined": "VaultWithProtocolParams"
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
83
|
{
|
|
167
84
|
"name": "updateDelegate",
|
|
168
85
|
"accounts": [
|
|
@@ -225,34 +142,6 @@
|
|
|
225
142
|
}
|
|
226
143
|
]
|
|
227
144
|
},
|
|
228
|
-
{
|
|
229
|
-
"name": "updateVaultProtocol",
|
|
230
|
-
"accounts": [
|
|
231
|
-
{
|
|
232
|
-
"name": "vault",
|
|
233
|
-
"isMut": true,
|
|
234
|
-
"isSigner": false
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
"name": "protocol",
|
|
238
|
-
"isMut": false,
|
|
239
|
-
"isSigner": true
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"name": "vaultProtocol",
|
|
243
|
-
"isMut": true,
|
|
244
|
-
"isSigner": false
|
|
245
|
-
}
|
|
246
|
-
],
|
|
247
|
-
"args": [
|
|
248
|
-
{
|
|
249
|
-
"name": "params",
|
|
250
|
-
"type": {
|
|
251
|
-
"defined": "UpdateVaultProtocolParams"
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
},
|
|
256
145
|
{
|
|
257
146
|
"name": "updateVault",
|
|
258
147
|
"accounts": [
|
|
@@ -900,456 +789,112 @@
|
|
|
900
789
|
}
|
|
901
790
|
],
|
|
902
791
|
"args": []
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
"name": "driftCompetitionsProgram",
|
|
1010
|
-
"isMut": false,
|
|
1011
|
-
"isSigner": false
|
|
1012
|
-
}
|
|
1013
|
-
],
|
|
1014
|
-
"args": []
|
|
1015
|
-
},
|
|
1016
|
-
{
|
|
1017
|
-
"name": "protocolRequestWithdraw",
|
|
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": "driftUserStats",
|
|
1036
|
-
"isMut": false,
|
|
1037
|
-
"isSigner": false
|
|
1038
|
-
},
|
|
1039
|
-
{
|
|
1040
|
-
"name": "driftUser",
|
|
1041
|
-
"isMut": false,
|
|
1042
|
-
"isSigner": false
|
|
1043
|
-
},
|
|
1044
|
-
{
|
|
1045
|
-
"name": "driftState",
|
|
1046
|
-
"isMut": false,
|
|
1047
|
-
"isSigner": false
|
|
1048
|
-
}
|
|
1049
|
-
],
|
|
1050
|
-
"args": [
|
|
1051
|
-
{
|
|
1052
|
-
"name": "withdrawAmount",
|
|
1053
|
-
"type": "u64"
|
|
1054
|
-
},
|
|
1055
|
-
{
|
|
1056
|
-
"name": "withdrawUnit",
|
|
1057
|
-
"type": {
|
|
1058
|
-
"defined": "WithdrawUnit"
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
]
|
|
1062
|
-
},
|
|
1063
|
-
{
|
|
1064
|
-
"name": "protocolCancelWithdrawRequest",
|
|
1065
|
-
"accounts": [
|
|
1066
|
-
{
|
|
1067
|
-
"name": "vault",
|
|
1068
|
-
"isMut": true,
|
|
1069
|
-
"isSigner": false
|
|
1070
|
-
},
|
|
1071
|
-
{
|
|
1072
|
-
"name": "vaultProtocol",
|
|
1073
|
-
"isMut": true,
|
|
1074
|
-
"isSigner": false
|
|
1075
|
-
},
|
|
1076
|
-
{
|
|
1077
|
-
"name": "protocol",
|
|
1078
|
-
"isMut": false,
|
|
1079
|
-
"isSigner": true
|
|
1080
|
-
},
|
|
1081
|
-
{
|
|
1082
|
-
"name": "driftUserStats",
|
|
1083
|
-
"isMut": false,
|
|
1084
|
-
"isSigner": false
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
"name": "driftUser",
|
|
1088
|
-
"isMut": false,
|
|
1089
|
-
"isSigner": false
|
|
1090
|
-
},
|
|
1091
|
-
{
|
|
1092
|
-
"name": "driftState",
|
|
1093
|
-
"isMut": false,
|
|
1094
|
-
"isSigner": false
|
|
1095
|
-
}
|
|
1096
|
-
],
|
|
1097
|
-
"args": []
|
|
1098
|
-
},
|
|
1099
|
-
{
|
|
1100
|
-
"name": "protocolWithdraw",
|
|
1101
|
-
"accounts": [
|
|
1102
|
-
{
|
|
1103
|
-
"name": "vault",
|
|
1104
|
-
"isMut": true,
|
|
1105
|
-
"isSigner": false
|
|
1106
|
-
},
|
|
1107
|
-
{
|
|
1108
|
-
"name": "vaultProtocol",
|
|
1109
|
-
"isMut": true,
|
|
1110
|
-
"isSigner": false
|
|
1111
|
-
},
|
|
1112
|
-
{
|
|
1113
|
-
"name": "protocol",
|
|
1114
|
-
"isMut": false,
|
|
1115
|
-
"isSigner": true
|
|
1116
|
-
},
|
|
1117
|
-
{
|
|
1118
|
-
"name": "vaultTokenAccount",
|
|
1119
|
-
"isMut": true,
|
|
1120
|
-
"isSigner": false
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
"name": "driftUserStats",
|
|
1124
|
-
"isMut": true,
|
|
1125
|
-
"isSigner": false
|
|
1126
|
-
},
|
|
1127
|
-
{
|
|
1128
|
-
"name": "driftUser",
|
|
1129
|
-
"isMut": true,
|
|
1130
|
-
"isSigner": false
|
|
1131
|
-
},
|
|
1132
|
-
{
|
|
1133
|
-
"name": "driftState",
|
|
1134
|
-
"isMut": false,
|
|
1135
|
-
"isSigner": false
|
|
1136
|
-
},
|
|
1137
|
-
{
|
|
1138
|
-
"name": "driftSpotMarketVault",
|
|
1139
|
-
"isMut": true,
|
|
1140
|
-
"isSigner": false
|
|
1141
|
-
},
|
|
1142
|
-
{
|
|
1143
|
-
"name": "driftSigner",
|
|
1144
|
-
"isMut": false,
|
|
1145
|
-
"isSigner": false
|
|
1146
|
-
},
|
|
1147
|
-
{
|
|
1148
|
-
"name": "userTokenAccount",
|
|
1149
|
-
"isMut": true,
|
|
1150
|
-
"isSigner": false
|
|
1151
|
-
},
|
|
1152
|
-
{
|
|
1153
|
-
"name": "driftProgram",
|
|
1154
|
-
"isMut": false,
|
|
1155
|
-
"isSigner": false
|
|
1156
|
-
},
|
|
1157
|
-
{
|
|
1158
|
-
"name": "tokenProgram",
|
|
1159
|
-
"isMut": false,
|
|
1160
|
-
"isSigner": false
|
|
1161
|
-
}
|
|
1162
|
-
],
|
|
1163
|
-
"args": []
|
|
1164
|
-
}
|
|
1165
|
-
],
|
|
1166
|
-
"accounts": [
|
|
1167
|
-
{
|
|
1168
|
-
"name": "VaultDepositor",
|
|
1169
|
-
"type": {
|
|
1170
|
-
"kind": "struct",
|
|
1171
|
-
"fields": [
|
|
1172
|
-
{
|
|
1173
|
-
"name": "vault",
|
|
1174
|
-
"docs": [
|
|
1175
|
-
"The vault deposited into"
|
|
1176
|
-
],
|
|
1177
|
-
"type": "publicKey"
|
|
1178
|
-
},
|
|
1179
|
-
{
|
|
1180
|
-
"name": "pubkey",
|
|
1181
|
-
"docs": [
|
|
1182
|
-
"The vault depositor account's pubkey. It is a pda of vault and authority"
|
|
1183
|
-
],
|
|
1184
|
-
"type": "publicKey"
|
|
1185
|
-
},
|
|
1186
|
-
{
|
|
1187
|
-
"name": "authority",
|
|
1188
|
-
"docs": [
|
|
1189
|
-
"The authority is the address w permission to deposit/withdraw"
|
|
1190
|
-
],
|
|
1191
|
-
"type": "publicKey"
|
|
1192
|
-
},
|
|
1193
|
-
{
|
|
1194
|
-
"name": "vaultShares",
|
|
1195
|
-
"docs": [
|
|
1196
|
-
"share of vault owned by this depositor. vault_shares / vault.total_shares is depositor's ownership of vault_equity"
|
|
1197
|
-
],
|
|
1198
|
-
"type": "u128"
|
|
1199
|
-
},
|
|
1200
|
-
{
|
|
1201
|
-
"name": "lastWithdrawRequest",
|
|
1202
|
-
"docs": [
|
|
1203
|
-
"last withdraw request"
|
|
1204
|
-
],
|
|
1205
|
-
"type": {
|
|
1206
|
-
"defined": "WithdrawRequest"
|
|
1207
|
-
}
|
|
1208
|
-
},
|
|
1209
|
-
{
|
|
1210
|
-
"name": "lastValidTs",
|
|
1211
|
-
"docs": [
|
|
1212
|
-
"creation ts of vault depositor"
|
|
1213
|
-
],
|
|
1214
|
-
"type": "i64"
|
|
1215
|
-
},
|
|
1216
|
-
{
|
|
1217
|
-
"name": "netDeposits",
|
|
1218
|
-
"docs": [
|
|
1219
|
-
"lifetime net deposits of vault depositor for the vault"
|
|
1220
|
-
],
|
|
1221
|
-
"type": "i64"
|
|
1222
|
-
},
|
|
1223
|
-
{
|
|
1224
|
-
"name": "totalDeposits",
|
|
1225
|
-
"docs": [
|
|
1226
|
-
"lifetime total deposits"
|
|
1227
|
-
],
|
|
1228
|
-
"type": "u64"
|
|
1229
|
-
},
|
|
1230
|
-
{
|
|
1231
|
-
"name": "totalWithdraws",
|
|
1232
|
-
"docs": [
|
|
1233
|
-
"lifetime total withdraws"
|
|
1234
|
-
],
|
|
1235
|
-
"type": "u64"
|
|
1236
|
-
},
|
|
1237
|
-
{
|
|
1238
|
-
"name": "cumulativeProfitShareAmount",
|
|
1239
|
-
"docs": [
|
|
1240
|
-
"the token amount of gains the vault depositor has paid performance fees on"
|
|
1241
|
-
],
|
|
1242
|
-
"type": "i64"
|
|
1243
|
-
},
|
|
1244
|
-
{
|
|
1245
|
-
"name": "profitShareFeePaid",
|
|
1246
|
-
"type": "u64"
|
|
1247
|
-
},
|
|
1248
|
-
{
|
|
1249
|
-
"name": "vaultSharesBase",
|
|
1250
|
-
"docs": [
|
|
1251
|
-
"the exponent for vault_shares decimal places"
|
|
1252
|
-
],
|
|
1253
|
-
"type": "u32"
|
|
1254
|
-
},
|
|
1255
|
-
{
|
|
1256
|
-
"name": "padding1",
|
|
1257
|
-
"type": "u32"
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
"name": "padding",
|
|
1261
|
-
"type": {
|
|
1262
|
-
"array": [
|
|
1263
|
-
"u64",
|
|
1264
|
-
8
|
|
1265
|
-
]
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
]
|
|
1269
|
-
}
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
"name": "VaultProtocol",
|
|
1273
|
-
"type": {
|
|
1274
|
-
"kind": "struct",
|
|
1275
|
-
"fields": [
|
|
1276
|
-
{
|
|
1277
|
-
"name": "protocol",
|
|
1278
|
-
"docs": [
|
|
1279
|
-
"The protocol, company, or entity that services the product using this vault.",
|
|
1280
|
-
"The protocol is not allowed to deposit into the vault but can profit share and collect annual fees just like the manager."
|
|
1281
|
-
],
|
|
1282
|
-
"type": "publicKey"
|
|
1283
|
-
},
|
|
1284
|
-
{
|
|
1285
|
-
"name": "protocolProfitAndFeeShares",
|
|
1286
|
-
"docs": [
|
|
1287
|
-
"The shares from profit share and annual fee unclaimed by the protocol."
|
|
1288
|
-
],
|
|
1289
|
-
"type": "u128"
|
|
1290
|
-
},
|
|
1291
|
-
{
|
|
1292
|
-
"name": "protocolFee",
|
|
1293
|
-
"docs": [
|
|
1294
|
-
"The annual fee charged on deposits by the protocol (traditional hedge funds typically charge 2% per year on assets under management).",
|
|
1295
|
-
"Unlike the management fee this can't be negative."
|
|
1296
|
-
],
|
|
1297
|
-
"type": "u64"
|
|
1298
|
-
},
|
|
1299
|
-
{
|
|
1300
|
-
"name": "protocolTotalWithdraws",
|
|
1301
|
-
"docs": [
|
|
1302
|
-
"Total withdraws for the protocol"
|
|
1303
|
-
],
|
|
1304
|
-
"type": "u64"
|
|
1305
|
-
},
|
|
1306
|
-
{
|
|
1307
|
-
"name": "protocolTotalFee",
|
|
1308
|
-
"docs": [
|
|
1309
|
-
"Total fee charged by the protocol (annual management fee + profit share).",
|
|
1310
|
-
"Unlike the management fee this can't be negative."
|
|
1311
|
-
],
|
|
1312
|
-
"type": "u64"
|
|
1313
|
-
},
|
|
1314
|
-
{
|
|
1315
|
-
"name": "protocolTotalProfitShare",
|
|
1316
|
-
"docs": [
|
|
1317
|
-
"Total profit share charged by the protocol"
|
|
1318
|
-
],
|
|
1319
|
-
"type": "u64"
|
|
1320
|
-
},
|
|
1321
|
-
{
|
|
1322
|
-
"name": "lastProtocolWithdrawRequest",
|
|
1323
|
-
"type": {
|
|
1324
|
-
"defined": "WithdrawRequest"
|
|
1325
|
-
}
|
|
1326
|
-
},
|
|
1327
|
-
{
|
|
1328
|
-
"name": "protocolProfitShare",
|
|
1329
|
-
"docs": [
|
|
1330
|
-
"Percentage the protocol charges on all profits realized by depositors: PERCENTAGE_PRECISION"
|
|
1331
|
-
],
|
|
1332
|
-
"type": "u32"
|
|
1333
|
-
},
|
|
1334
|
-
{
|
|
1335
|
-
"name": "bump",
|
|
1336
|
-
"type": "u8"
|
|
1337
|
-
},
|
|
1338
|
-
{
|
|
1339
|
-
"name": "version",
|
|
1340
|
-
"type": "u8"
|
|
1341
|
-
},
|
|
1342
|
-
{
|
|
1343
|
-
"name": "padding",
|
|
1344
|
-
"type": {
|
|
1345
|
-
"array": [
|
|
1346
|
-
"u8",
|
|
1347
|
-
2
|
|
1348
|
-
]
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
]
|
|
1352
|
-
}
|
|
792
|
+
}
|
|
793
|
+
],
|
|
794
|
+
"accounts": [
|
|
795
|
+
{
|
|
796
|
+
"name": "VaultDepositor",
|
|
797
|
+
"type": {
|
|
798
|
+
"kind": "struct",
|
|
799
|
+
"fields": [
|
|
800
|
+
{
|
|
801
|
+
"name": "vault",
|
|
802
|
+
"docs": [
|
|
803
|
+
"The vault deposited into"
|
|
804
|
+
],
|
|
805
|
+
"type": "publicKey"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"name": "pubkey",
|
|
809
|
+
"docs": [
|
|
810
|
+
"The vault depositor account's pubkey. It is a pda of vault and authority"
|
|
811
|
+
],
|
|
812
|
+
"type": "publicKey"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"name": "authority",
|
|
816
|
+
"docs": [
|
|
817
|
+
"The authority is the address w permission to deposit/withdraw"
|
|
818
|
+
],
|
|
819
|
+
"type": "publicKey"
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"name": "vaultShares",
|
|
823
|
+
"docs": [
|
|
824
|
+
"share of vault owned by this depositor. vault_shares / vault.total_shares is depositor's ownership of vault_equity"
|
|
825
|
+
],
|
|
826
|
+
"type": "u128"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
"name": "lastWithdrawRequest",
|
|
830
|
+
"docs": [
|
|
831
|
+
"last withdraw request"
|
|
832
|
+
],
|
|
833
|
+
"type": {
|
|
834
|
+
"defined": "WithdrawRequest"
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"name": "lastValidTs",
|
|
839
|
+
"docs": [
|
|
840
|
+
"creation ts of vault depositor"
|
|
841
|
+
],
|
|
842
|
+
"type": "i64"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
"name": "netDeposits",
|
|
846
|
+
"docs": [
|
|
847
|
+
"lifetime net deposits of vault depositor for the vault"
|
|
848
|
+
],
|
|
849
|
+
"type": "i64"
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"name": "totalDeposits",
|
|
853
|
+
"docs": [
|
|
854
|
+
"lifetime total deposits"
|
|
855
|
+
],
|
|
856
|
+
"type": "u64"
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"name": "totalWithdraws",
|
|
860
|
+
"docs": [
|
|
861
|
+
"lifetime total withdraws"
|
|
862
|
+
],
|
|
863
|
+
"type": "u64"
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"name": "cumulativeProfitShareAmount",
|
|
867
|
+
"docs": [
|
|
868
|
+
"the token amount of gains the vault depositor has paid performance fees on"
|
|
869
|
+
],
|
|
870
|
+
"type": "i64"
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"name": "profitShareFeePaid",
|
|
874
|
+
"type": "u64"
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
"name": "vaultSharesBase",
|
|
878
|
+
"docs": [
|
|
879
|
+
"the exponent for vault_shares decimal places"
|
|
880
|
+
],
|
|
881
|
+
"type": "u32"
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"name": "padding1",
|
|
885
|
+
"type": "u32"
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
"name": "padding",
|
|
889
|
+
"type": {
|
|
890
|
+
"array": [
|
|
891
|
+
"u64",
|
|
892
|
+
8
|
|
893
|
+
]
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
]
|
|
897
|
+
}
|
|
1353
898
|
},
|
|
1354
899
|
{
|
|
1355
900
|
"name": "Vault",
|
|
@@ -1407,7 +952,7 @@
|
|
|
1407
952
|
"name": "delegate",
|
|
1408
953
|
"docs": [
|
|
1409
954
|
"The vaults designated delegate for drift user account",
|
|
1410
|
-
"
|
|
955
|
+
"Can differ from actual user delegate if vault is in liquidation"
|
|
1411
956
|
],
|
|
1412
957
|
"type": "publicKey"
|
|
1413
958
|
},
|
|
@@ -1421,129 +966,126 @@
|
|
|
1421
966
|
{
|
|
1422
967
|
"name": "userShares",
|
|
1423
968
|
"docs": [
|
|
1424
|
-
"
|
|
969
|
+
"the sum of all shares held by the users (vault depositors)"
|
|
1425
970
|
],
|
|
1426
971
|
"type": "u128"
|
|
1427
972
|
},
|
|
1428
973
|
{
|
|
1429
974
|
"name": "totalShares",
|
|
1430
975
|
"docs": [
|
|
1431
|
-
"
|
|
1432
|
-
"The manager deposits are total_shares - user_shares - protocol_profit_and_fee_shares."
|
|
976
|
+
"the sum of all shares (including vault manager)"
|
|
1433
977
|
],
|
|
1434
978
|
"type": "u128"
|
|
1435
979
|
},
|
|
1436
980
|
{
|
|
1437
981
|
"name": "lastFeeUpdateTs",
|
|
1438
982
|
"docs": [
|
|
1439
|
-
"
|
|
983
|
+
"last fee update unix timestamp"
|
|
1440
984
|
],
|
|
1441
985
|
"type": "i64"
|
|
1442
986
|
},
|
|
1443
987
|
{
|
|
1444
988
|
"name": "liquidationStartTs",
|
|
1445
989
|
"docs": [
|
|
1446
|
-
"When the liquidation
|
|
990
|
+
"When the liquidation start"
|
|
1447
991
|
],
|
|
1448
992
|
"type": "i64"
|
|
1449
993
|
},
|
|
1450
994
|
{
|
|
1451
995
|
"name": "redeemPeriod",
|
|
1452
996
|
"docs": [
|
|
1453
|
-
"
|
|
1454
|
-
"Currently, the maximum is 90 days."
|
|
997
|
+
"the period (in seconds) that a vault depositor must wait after requesting a withdraw to complete withdraw"
|
|
1455
998
|
],
|
|
1456
999
|
"type": "i64"
|
|
1457
1000
|
},
|
|
1458
1001
|
{
|
|
1459
1002
|
"name": "totalWithdrawRequested",
|
|
1460
1003
|
"docs": [
|
|
1461
|
-
"
|
|
1004
|
+
"the sum of all outstanding withdraw requests"
|
|
1462
1005
|
],
|
|
1463
1006
|
"type": "u64"
|
|
1464
1007
|
},
|
|
1465
1008
|
{
|
|
1466
1009
|
"name": "maxTokens",
|
|
1467
1010
|
"docs": [
|
|
1468
|
-
"
|
|
1011
|
+
"max token capacity, once hit/passed vault will reject new deposits (updateable)"
|
|
1469
1012
|
],
|
|
1470
1013
|
"type": "u64"
|
|
1471
1014
|
},
|
|
1472
1015
|
{
|
|
1473
1016
|
"name": "managementFee",
|
|
1474
1017
|
"docs": [
|
|
1475
|
-
"
|
|
1476
|
-
"Traditional funds typically charge 2% per year on assets under management."
|
|
1018
|
+
"manager fee"
|
|
1477
1019
|
],
|
|
1478
1020
|
"type": "i64"
|
|
1479
1021
|
},
|
|
1480
1022
|
{
|
|
1481
1023
|
"name": "initTs",
|
|
1482
1024
|
"docs": [
|
|
1483
|
-
"
|
|
1025
|
+
"timestamp vault initialized"
|
|
1484
1026
|
],
|
|
1485
1027
|
"type": "i64"
|
|
1486
1028
|
},
|
|
1487
1029
|
{
|
|
1488
1030
|
"name": "netDeposits",
|
|
1489
1031
|
"docs": [
|
|
1490
|
-
"
|
|
1032
|
+
"the net deposits for the vault"
|
|
1491
1033
|
],
|
|
1492
1034
|
"type": "i64"
|
|
1493
1035
|
},
|
|
1494
1036
|
{
|
|
1495
1037
|
"name": "managerNetDeposits",
|
|
1496
1038
|
"docs": [
|
|
1497
|
-
"
|
|
1039
|
+
"the net deposits for the vault manager"
|
|
1498
1040
|
],
|
|
1499
1041
|
"type": "i64"
|
|
1500
1042
|
},
|
|
1501
1043
|
{
|
|
1502
1044
|
"name": "totalDeposits",
|
|
1503
1045
|
"docs": [
|
|
1504
|
-
"
|
|
1046
|
+
"total deposits"
|
|
1505
1047
|
],
|
|
1506
1048
|
"type": "u64"
|
|
1507
1049
|
},
|
|
1508
1050
|
{
|
|
1509
1051
|
"name": "totalWithdraws",
|
|
1510
1052
|
"docs": [
|
|
1511
|
-
"
|
|
1053
|
+
"total withdraws"
|
|
1512
1054
|
],
|
|
1513
1055
|
"type": "u64"
|
|
1514
1056
|
},
|
|
1515
1057
|
{
|
|
1516
1058
|
"name": "managerTotalDeposits",
|
|
1517
1059
|
"docs": [
|
|
1518
|
-
"
|
|
1060
|
+
"total deposits for the vault manager"
|
|
1519
1061
|
],
|
|
1520
1062
|
"type": "u64"
|
|
1521
1063
|
},
|
|
1522
1064
|
{
|
|
1523
1065
|
"name": "managerTotalWithdraws",
|
|
1524
1066
|
"docs": [
|
|
1525
|
-
"
|
|
1067
|
+
"total withdraws for the vault manager"
|
|
1526
1068
|
],
|
|
1527
1069
|
"type": "u64"
|
|
1528
1070
|
},
|
|
1529
1071
|
{
|
|
1530
1072
|
"name": "managerTotalFee",
|
|
1531
1073
|
"docs": [
|
|
1532
|
-
"
|
|
1074
|
+
"total mgmt fee charged by vault manager"
|
|
1533
1075
|
],
|
|
1534
1076
|
"type": "i64"
|
|
1535
1077
|
},
|
|
1536
1078
|
{
|
|
1537
1079
|
"name": "managerTotalProfitShare",
|
|
1538
1080
|
"docs": [
|
|
1539
|
-
"
|
|
1081
|
+
"total profit share charged by vault manager"
|
|
1540
1082
|
],
|
|
1541
1083
|
"type": "u64"
|
|
1542
1084
|
},
|
|
1543
1085
|
{
|
|
1544
1086
|
"name": "minDepositAmount",
|
|
1545
1087
|
"docs": [
|
|
1546
|
-
"
|
|
1088
|
+
"the minimum deposit amount"
|
|
1547
1089
|
],
|
|
1548
1090
|
"type": "u64"
|
|
1549
1091
|
},
|
|
@@ -1556,21 +1098,21 @@
|
|
|
1556
1098
|
{
|
|
1557
1099
|
"name": "sharesBase",
|
|
1558
1100
|
"docs": [
|
|
1559
|
-
"
|
|
1101
|
+
"the base 10 exponent of the shares (given massive share inflation can occur at near zero vault equity)"
|
|
1560
1102
|
],
|
|
1561
1103
|
"type": "u32"
|
|
1562
1104
|
},
|
|
1563
1105
|
{
|
|
1564
1106
|
"name": "profitShare",
|
|
1565
1107
|
"docs": [
|
|
1566
|
-
"
|
|
1108
|
+
"percentage of gains for vault admin upon depositor's realize/withdraw: PERCENTAGE_PRECISION"
|
|
1567
1109
|
],
|
|
1568
1110
|
"type": "u32"
|
|
1569
1111
|
},
|
|
1570
1112
|
{
|
|
1571
1113
|
"name": "hurdleRate",
|
|
1572
1114
|
"docs": [
|
|
1573
|
-
"
|
|
1115
|
+
"vault admin only collect incentive fees during periods when returns are higher than this amount: PERCENTAGE_PRECISION"
|
|
1574
1116
|
],
|
|
1575
1117
|
"type": "u32"
|
|
1576
1118
|
},
|
|
@@ -1591,32 +1133,16 @@
|
|
|
1591
1133
|
{
|
|
1592
1134
|
"name": "permissioned",
|
|
1593
1135
|
"docs": [
|
|
1594
|
-
"Whether anybody can be a depositor"
|
|
1595
|
-
],
|
|
1596
|
-
"type": "bool"
|
|
1597
|
-
},
|
|
1598
|
-
{
|
|
1599
|
-
"name": "vaultProtocol",
|
|
1600
|
-
"docs": [
|
|
1601
|
-
"The optional [`VaultProtocol`] account."
|
|
1136
|
+
"Whether or not anybody can be a depositor"
|
|
1602
1137
|
],
|
|
1603
1138
|
"type": "bool"
|
|
1604
1139
|
},
|
|
1605
|
-
{
|
|
1606
|
-
"name": "padding1",
|
|
1607
|
-
"type": {
|
|
1608
|
-
"array": [
|
|
1609
|
-
"u8",
|
|
1610
|
-
7
|
|
1611
|
-
]
|
|
1612
|
-
}
|
|
1613
|
-
},
|
|
1614
1140
|
{
|
|
1615
1141
|
"name": "padding",
|
|
1616
1142
|
"type": {
|
|
1617
1143
|
"array": [
|
|
1618
1144
|
"u64",
|
|
1619
|
-
|
|
1145
|
+
8
|
|
1620
1146
|
]
|
|
1621
1147
|
}
|
|
1622
1148
|
}
|
|
@@ -1625,81 +1151,6 @@
|
|
|
1625
1151
|
}
|
|
1626
1152
|
],
|
|
1627
1153
|
"types": [
|
|
1628
|
-
{
|
|
1629
|
-
"name": "VaultWithProtocolParams",
|
|
1630
|
-
"type": {
|
|
1631
|
-
"kind": "struct",
|
|
1632
|
-
"fields": [
|
|
1633
|
-
{
|
|
1634
|
-
"name": "name",
|
|
1635
|
-
"type": {
|
|
1636
|
-
"array": [
|
|
1637
|
-
"u8",
|
|
1638
|
-
32
|
|
1639
|
-
]
|
|
1640
|
-
}
|
|
1641
|
-
},
|
|
1642
|
-
{
|
|
1643
|
-
"name": "redeemPeriod",
|
|
1644
|
-
"type": "i64"
|
|
1645
|
-
},
|
|
1646
|
-
{
|
|
1647
|
-
"name": "maxTokens",
|
|
1648
|
-
"type": "u64"
|
|
1649
|
-
},
|
|
1650
|
-
{
|
|
1651
|
-
"name": "managementFee",
|
|
1652
|
-
"type": "i64"
|
|
1653
|
-
},
|
|
1654
|
-
{
|
|
1655
|
-
"name": "minDepositAmount",
|
|
1656
|
-
"type": "u64"
|
|
1657
|
-
},
|
|
1658
|
-
{
|
|
1659
|
-
"name": "profitShare",
|
|
1660
|
-
"type": "u32"
|
|
1661
|
-
},
|
|
1662
|
-
{
|
|
1663
|
-
"name": "hurdleRate",
|
|
1664
|
-
"type": "u32"
|
|
1665
|
-
},
|
|
1666
|
-
{
|
|
1667
|
-
"name": "spotMarketIndex",
|
|
1668
|
-
"type": "u16"
|
|
1669
|
-
},
|
|
1670
|
-
{
|
|
1671
|
-
"name": "permissioned",
|
|
1672
|
-
"type": "bool"
|
|
1673
|
-
},
|
|
1674
|
-
{
|
|
1675
|
-
"name": "vaultProtocol",
|
|
1676
|
-
"type": {
|
|
1677
|
-
"defined": "VaultProtocolParams"
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
]
|
|
1681
|
-
}
|
|
1682
|
-
},
|
|
1683
|
-
{
|
|
1684
|
-
"name": "VaultProtocolParams",
|
|
1685
|
-
"type": {
|
|
1686
|
-
"kind": "struct",
|
|
1687
|
-
"fields": [
|
|
1688
|
-
{
|
|
1689
|
-
"name": "protocol",
|
|
1690
|
-
"type": "publicKey"
|
|
1691
|
-
},
|
|
1692
|
-
{
|
|
1693
|
-
"name": "protocolFee",
|
|
1694
|
-
"type": "u64"
|
|
1695
|
-
},
|
|
1696
|
-
{
|
|
1697
|
-
"name": "protocolProfitShare",
|
|
1698
|
-
"type": "u32"
|
|
1699
|
-
}
|
|
1700
|
-
]
|
|
1701
|
-
}
|
|
1702
|
-
},
|
|
1703
1154
|
{
|
|
1704
1155
|
"name": "VaultParams",
|
|
1705
1156
|
"type": {
|
|
@@ -1749,26 +1200,6 @@
|
|
|
1749
1200
|
]
|
|
1750
1201
|
}
|
|
1751
1202
|
},
|
|
1752
|
-
{
|
|
1753
|
-
"name": "UpdateVaultProtocolParams",
|
|
1754
|
-
"type": {
|
|
1755
|
-
"kind": "struct",
|
|
1756
|
-
"fields": [
|
|
1757
|
-
{
|
|
1758
|
-
"name": "protocolFee",
|
|
1759
|
-
"type": {
|
|
1760
|
-
"option": "u64"
|
|
1761
|
-
}
|
|
1762
|
-
},
|
|
1763
|
-
{
|
|
1764
|
-
"name": "protocolProfitShare",
|
|
1765
|
-
"type": {
|
|
1766
|
-
"option": "u32"
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
]
|
|
1770
|
-
}
|
|
1771
|
-
},
|
|
1772
1203
|
{
|
|
1773
1204
|
"name": "UpdateVaultParams",
|
|
1774
1205
|
"type": {
|
|
@@ -1996,118 +1427,6 @@
|
|
|
1996
1427
|
"index": false
|
|
1997
1428
|
}
|
|
1998
1429
|
]
|
|
1999
|
-
},
|
|
2000
|
-
{
|
|
2001
|
-
"name": "VaultDepositorV1Record",
|
|
2002
|
-
"fields": [
|
|
2003
|
-
{
|
|
2004
|
-
"name": "ts",
|
|
2005
|
-
"type": "i64",
|
|
2006
|
-
"index": false
|
|
2007
|
-
},
|
|
2008
|
-
{
|
|
2009
|
-
"name": "vault",
|
|
2010
|
-
"type": "publicKey",
|
|
2011
|
-
"index": false
|
|
2012
|
-
},
|
|
2013
|
-
{
|
|
2014
|
-
"name": "depositorAuthority",
|
|
2015
|
-
"type": "publicKey",
|
|
2016
|
-
"index": false
|
|
2017
|
-
},
|
|
2018
|
-
{
|
|
2019
|
-
"name": "action",
|
|
2020
|
-
"type": {
|
|
2021
|
-
"defined": "VaultDepositorAction"
|
|
2022
|
-
},
|
|
2023
|
-
"index": false
|
|
2024
|
-
},
|
|
2025
|
-
{
|
|
2026
|
-
"name": "amount",
|
|
2027
|
-
"type": "u64",
|
|
2028
|
-
"index": false
|
|
2029
|
-
},
|
|
2030
|
-
{
|
|
2031
|
-
"name": "spotMarketIndex",
|
|
2032
|
-
"type": "u16",
|
|
2033
|
-
"index": false
|
|
2034
|
-
},
|
|
2035
|
-
{
|
|
2036
|
-
"name": "vaultSharesBefore",
|
|
2037
|
-
"type": "u128",
|
|
2038
|
-
"index": false
|
|
2039
|
-
},
|
|
2040
|
-
{
|
|
2041
|
-
"name": "vaultSharesAfter",
|
|
2042
|
-
"type": "u128",
|
|
2043
|
-
"index": false
|
|
2044
|
-
},
|
|
2045
|
-
{
|
|
2046
|
-
"name": "vaultEquityBefore",
|
|
2047
|
-
"type": "u64",
|
|
2048
|
-
"index": false
|
|
2049
|
-
},
|
|
2050
|
-
{
|
|
2051
|
-
"name": "userVaultSharesBefore",
|
|
2052
|
-
"type": "u128",
|
|
2053
|
-
"index": false
|
|
2054
|
-
},
|
|
2055
|
-
{
|
|
2056
|
-
"name": "totalVaultSharesBefore",
|
|
2057
|
-
"type": "u128",
|
|
2058
|
-
"index": false
|
|
2059
|
-
},
|
|
2060
|
-
{
|
|
2061
|
-
"name": "userVaultSharesAfter",
|
|
2062
|
-
"type": "u128",
|
|
2063
|
-
"index": false
|
|
2064
|
-
},
|
|
2065
|
-
{
|
|
2066
|
-
"name": "totalVaultSharesAfter",
|
|
2067
|
-
"type": "u128",
|
|
2068
|
-
"index": false
|
|
2069
|
-
},
|
|
2070
|
-
{
|
|
2071
|
-
"name": "protocolSharesBefore",
|
|
2072
|
-
"type": "u128",
|
|
2073
|
-
"index": false
|
|
2074
|
-
},
|
|
2075
|
-
{
|
|
2076
|
-
"name": "protocolSharesAfter",
|
|
2077
|
-
"type": "u128",
|
|
2078
|
-
"index": false
|
|
2079
|
-
},
|
|
2080
|
-
{
|
|
2081
|
-
"name": "protocolProfitShare",
|
|
2082
|
-
"type": "u64",
|
|
2083
|
-
"index": false
|
|
2084
|
-
},
|
|
2085
|
-
{
|
|
2086
|
-
"name": "protocolFee",
|
|
2087
|
-
"type": "i64",
|
|
2088
|
-
"index": false
|
|
2089
|
-
},
|
|
2090
|
-
{
|
|
2091
|
-
"name": "protocolFeeShares",
|
|
2092
|
-
"type": "i64",
|
|
2093
|
-
"index": false
|
|
2094
|
-
},
|
|
2095
|
-
{
|
|
2096
|
-
"name": "managerProfitShare",
|
|
2097
|
-
"type": "u64",
|
|
2098
|
-
"index": false
|
|
2099
|
-
},
|
|
2100
|
-
{
|
|
2101
|
-
"name": "managementFee",
|
|
2102
|
-
"type": "i64",
|
|
2103
|
-
"index": false
|
|
2104
|
-
},
|
|
2105
|
-
{
|
|
2106
|
-
"name": "managementFeeShares",
|
|
2107
|
-
"type": "i64",
|
|
2108
|
-
"index": false
|
|
2109
|
-
}
|
|
2110
|
-
]
|
|
2111
1430
|
}
|
|
2112
1431
|
],
|
|
2113
1432
|
"errors": [
|
|
@@ -2220,14 +1539,6 @@
|
|
|
2220
1539
|
"code": 6021,
|
|
2221
1540
|
"name": "OngoingLiquidation",
|
|
2222
1541
|
"msg": "OngoingLiquidation"
|
|
2223
|
-
},
|
|
2224
|
-
{
|
|
2225
|
-
"code": 6022,
|
|
2226
|
-
"name": "VaultProtocolMissing",
|
|
2227
|
-
"msg": "VaultProtocolMissing"
|
|
2228
1542
|
}
|
|
2229
|
-
]
|
|
2230
|
-
"metadata": {
|
|
2231
|
-
"address": "vAuLTsyrvSfZRuRB3XgvkPwNGgYSs9YRYymVebLKoxR"
|
|
2232
|
-
}
|
|
1543
|
+
]
|
|
2233
1544
|
}
|
package/src/types/types.ts
CHANGED
|
@@ -120,8 +120,8 @@ export type VaultDepositor = {
|
|
|
120
120
|
cumulativeProfitShareAmount: BN;
|
|
121
121
|
vaultSharesBase: number;
|
|
122
122
|
profitShareFeePaid: BN;
|
|
123
|
-
padding1: number;
|
|
124
|
-
padding: BN[];
|
|
123
|
+
padding1: number | number[];
|
|
124
|
+
padding: number[] | BN[];
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
export type VaultProtocol = {
|