flash-sdk 2.18.0 → 2.18.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -64,6 +64,7 @@ var anchor_1 = require("@coral-xyz/anchor");
64
64
  var web3_js_1 = require("@solana/web3.js");
65
65
  var spl_token_1 = require("@solana/spl-token");
66
66
  var js_sha256_1 = require("js-sha256");
67
+ var bs58_1 = require("bs58");
67
68
  var PositionAccount_1 = require("./PositionAccount");
68
69
  var types_1 = require("./types");
69
70
  var OraclePrice_1 = require("./OraclePrice");
@@ -293,6 +294,53 @@ var PerpetualsClient = (function () {
293
294
  return [2, this.program.account.position.all()];
294
295
  });
295
296
  }); };
297
+ this.getAllActivePositions = function () { return __awaiter(_this, void 0, void 0, function () {
298
+ var allPositions, activePositions;
299
+ return __generator(this, function (_a) {
300
+ switch (_a.label) {
301
+ case 0: return [4, this.program.account.position.all()];
302
+ case 1:
303
+ allPositions = _a.sent();
304
+ activePositions = allPositions.filter(function (f) { return !f.account.sizeAmount.isZero(); });
305
+ return [2, activePositions];
306
+ }
307
+ });
308
+ }); };
309
+ this.getAllPositionsByMarket = function (marketKey) { return __awaiter(_this, void 0, void 0, function () {
310
+ var data, allPositions;
311
+ return __generator(this, function (_a) {
312
+ switch (_a.label) {
313
+ case 0:
314
+ data = (0, bs58_1.encode)(Buffer.concat([marketKey.toBuffer()]));
315
+ return [4, this.program.account.position.all([
316
+ {
317
+ memcmp: { bytes: data, offset: 40 }
318
+ }
319
+ ])];
320
+ case 1:
321
+ allPositions = _a.sent();
322
+ return [2, allPositions];
323
+ }
324
+ });
325
+ }); };
326
+ this.getAllActivePositionsByMarket = function (marketKey) { return __awaiter(_this, void 0, void 0, function () {
327
+ var data, allPositions, activePositions;
328
+ return __generator(this, function (_a) {
329
+ switch (_a.label) {
330
+ case 0:
331
+ data = (0, bs58_1.encode)(Buffer.concat([marketKey.toBuffer()]));
332
+ return [4, this.program.account.position.all([
333
+ {
334
+ memcmp: { bytes: data, offset: 40 }
335
+ }
336
+ ])];
337
+ case 1:
338
+ allPositions = _a.sent();
339
+ activePositions = allPositions.filter(function (f) { return !f.account.sizeAmount.isZero(); });
340
+ return [2, activePositions];
341
+ }
342
+ });
343
+ }); };
296
344
  this.getAllOrderAccounts = function () { return __awaiter(_this, void 0, void 0, function () {
297
345
  return __generator(this, function (_a) {
298
346
  return [2, this.program.account.order.all()];
@@ -1907,11 +1955,10 @@ var PerpetualsClient = (function () {
1907
1955
  }
1908
1956
  });
1909
1957
  }); };
1910
- this.getAddLiquidityAmountAndFee = function (amount, poolKey, depositCustodyKey, POOL_CONFIG) { return __awaiter(_this, void 0, void 0, function () {
1911
- var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_3, token, _a, custodies_4, custody, _b, _c, market, depositCustodyConfig, transaction, backUpOracleInstruction, result, index, res;
1912
- var _d;
1913
- return __generator(this, function (_e) {
1914
- switch (_e.label) {
1958
+ this.getAssetsUnderManagement = function (poolKey, POOL_CONFIG) { return __awaiter(_this, void 0, void 0, function () {
1959
+ var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_3, token, _a, custodies_4, custody, _b, _c, market;
1960
+ return __generator(this, function (_d) {
1961
+ switch (_d.label) {
1915
1962
  case 0:
1916
1963
  backUpOracleInstructionPromise = (0, backupOracle_1.createBackupOracleInstruction)(POOL_CONFIG.poolAddress.toBase58(), true);
1917
1964
  custodies = POOL_CONFIG.custodies;
@@ -1941,6 +1988,57 @@ var PerpetualsClient = (function () {
1941
1988
  isWritable: false,
1942
1989
  });
1943
1990
  }
1991
+ return [4, this.program.methods
1992
+ .getAssetsUnderManagement({})
1993
+ .accounts({
1994
+ perpetuals: POOL_CONFIG.perpetuals,
1995
+ pool: poolKey,
1996
+ ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
1997
+ })
1998
+ .remainingAccounts(__spreadArray(__spreadArray([], custodyMetas, true), marketMetas, true))
1999
+ .view()
2000
+ .catch(function (err) {
2001
+ console.error(err);
2002
+ throw err;
2003
+ })];
2004
+ case 1: return [2, _d.sent()];
2005
+ }
2006
+ });
2007
+ }); };
2008
+ this.getAddLiquidityAmountAndFee = function (amount, poolKey, depositCustodyKey, POOL_CONFIG) { return __awaiter(_this, void 0, void 0, function () {
2009
+ var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_5, token, _a, custodies_6, custody, _b, _c, market, depositCustodyConfig, transaction, backUpOracleInstruction, result, index, res;
2010
+ var _d;
2011
+ return __generator(this, function (_e) {
2012
+ switch (_e.label) {
2013
+ case 0:
2014
+ backUpOracleInstructionPromise = (0, backupOracle_1.createBackupOracleInstruction)(POOL_CONFIG.poolAddress.toBase58(), true);
2015
+ custodies = POOL_CONFIG.custodies;
2016
+ custodyMetas = [];
2017
+ marketMetas = [];
2018
+ for (_i = 0, custodies_5 = custodies; _i < custodies_5.length; _i++) {
2019
+ token = custodies_5[_i];
2020
+ custodyMetas.push({
2021
+ isSigner: false,
2022
+ isWritable: false,
2023
+ pubkey: token.custodyAccount,
2024
+ });
2025
+ }
2026
+ for (_a = 0, custodies_6 = custodies; _a < custodies_6.length; _a++) {
2027
+ custody = custodies_6[_a];
2028
+ custodyMetas.push({
2029
+ isSigner: false,
2030
+ isWritable: false,
2031
+ pubkey: custody.intOracleAccount,
2032
+ });
2033
+ }
2034
+ for (_b = 0, _c = POOL_CONFIG.markets; _b < _c.length; _b++) {
2035
+ market = _c[_b];
2036
+ marketMetas.push({
2037
+ pubkey: market.marketAccount,
2038
+ isSigner: false,
2039
+ isWritable: false,
2040
+ });
2041
+ }
1944
2042
  depositCustodyConfig = custodies.find(function (i) { return i.custodyAccount.equals(depositCustodyKey); });
1945
2043
  return [4, this.program.methods
1946
2044
  .getAddLiquidityAmountAndFee({
@@ -1975,7 +2073,7 @@ var PerpetualsClient = (function () {
1975
2073
  });
1976
2074
  }); };
1977
2075
  this.getRemoveLiquidityAmountAndFee = function (amount, poolKey, removeTokenCustodyKey, POOL_CONFIG) { return __awaiter(_this, void 0, void 0, function () {
1978
- var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_5, token, _a, custodies_6, custody, _b, _c, market, removeCustodyConfig, transaction, backUpOracleInstruction, result, index, res;
2076
+ var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_7, token, _a, custodies_8, custody, _b, _c, market, removeCustodyConfig, transaction, backUpOracleInstruction, result, index, res;
1979
2077
  var _d;
1980
2078
  return __generator(this, function (_e) {
1981
2079
  switch (_e.label) {
@@ -1984,16 +2082,16 @@ var PerpetualsClient = (function () {
1984
2082
  custodies = POOL_CONFIG.custodies;
1985
2083
  custodyMetas = [];
1986
2084
  marketMetas = [];
1987
- for (_i = 0, custodies_5 = custodies; _i < custodies_5.length; _i++) {
1988
- token = custodies_5[_i];
2085
+ for (_i = 0, custodies_7 = custodies; _i < custodies_7.length; _i++) {
2086
+ token = custodies_7[_i];
1989
2087
  custodyMetas.push({
1990
2088
  isSigner: false,
1991
2089
  isWritable: false,
1992
2090
  pubkey: token.custodyAccount,
1993
2091
  });
1994
2092
  }
1995
- for (_a = 0, custodies_6 = custodies; _a < custodies_6.length; _a++) {
1996
- custody = custodies_6[_a];
2093
+ for (_a = 0, custodies_8 = custodies; _a < custodies_8.length; _a++) {
2094
+ custody = custodies_8[_a];
1997
2095
  custodyMetas.push({
1998
2096
  isSigner: false,
1999
2097
  isWritable: false,
@@ -2048,7 +2146,7 @@ var PerpetualsClient = (function () {
2048
2146
  });
2049
2147
  }); };
2050
2148
  this.getCompoundingLPTokenPrice = function (poolKey, POOL_CONFIG) { return __awaiter(_this, void 0, void 0, function () {
2051
- var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_7, token, _a, custodies_8, custody, _b, _c, market, backUpOracleInstruction, transaction, result, index, res;
2149
+ var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_9, token, _a, custodies_10, custody, _b, _c, market, backUpOracleInstruction, transaction, result, index, res;
2052
2150
  var _d;
2053
2151
  return __generator(this, function (_e) {
2054
2152
  switch (_e.label) {
@@ -2057,16 +2155,16 @@ var PerpetualsClient = (function () {
2057
2155
  custodies = POOL_CONFIG.custodies;
2058
2156
  custodyMetas = [];
2059
2157
  marketMetas = [];
2060
- for (_i = 0, custodies_7 = custodies; _i < custodies_7.length; _i++) {
2061
- token = custodies_7[_i];
2158
+ for (_i = 0, custodies_9 = custodies; _i < custodies_9.length; _i++) {
2159
+ token = custodies_9[_i];
2062
2160
  custodyMetas.push({
2063
2161
  isSigner: false,
2064
2162
  isWritable: false,
2065
2163
  pubkey: token.custodyAccount,
2066
2164
  });
2067
2165
  }
2068
- for (_a = 0, custodies_8 = custodies; _a < custodies_8.length; _a++) {
2069
- custody = custodies_8[_a];
2166
+ for (_a = 0, custodies_10 = custodies; _a < custodies_10.length; _a++) {
2167
+ custody = custodies_10[_a];
2070
2168
  custodyMetas.push({
2071
2169
  isSigner: false,
2072
2170
  isWritable: false,
@@ -2107,7 +2205,7 @@ var PerpetualsClient = (function () {
2107
2205
  });
2108
2206
  }); };
2109
2207
  this.getSFLPAddLiquidityAmountAndFee = function (amount, poolKey, depositCustodyKey, POOL_CONFIG) { return __awaiter(_this, void 0, void 0, function () {
2110
- var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_9, token, _a, custodies_10, custody, _b, _c, market, depositCustodyConfig, rewardCustody, backUpOracleInstruction, transaction, result, index, res;
2208
+ var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_11, token, _a, custodies_12, custody, _b, _c, market, depositCustodyConfig, rewardCustody, backUpOracleInstruction, transaction, result, index, res;
2111
2209
  var _d;
2112
2210
  return __generator(this, function (_e) {
2113
2211
  switch (_e.label) {
@@ -2116,16 +2214,16 @@ var PerpetualsClient = (function () {
2116
2214
  custodies = POOL_CONFIG.custodies;
2117
2215
  custodyMetas = [];
2118
2216
  marketMetas = [];
2119
- for (_i = 0, custodies_9 = custodies; _i < custodies_9.length; _i++) {
2120
- token = custodies_9[_i];
2217
+ for (_i = 0, custodies_11 = custodies; _i < custodies_11.length; _i++) {
2218
+ token = custodies_11[_i];
2121
2219
  custodyMetas.push({
2122
2220
  isSigner: false,
2123
2221
  isWritable: false,
2124
2222
  pubkey: token.custodyAccount,
2125
2223
  });
2126
2224
  }
2127
- for (_a = 0, custodies_10 = custodies; _a < custodies_10.length; _a++) {
2128
- custody = custodies_10[_a];
2225
+ for (_a = 0, custodies_12 = custodies; _a < custodies_12.length; _a++) {
2226
+ custody = custodies_12[_a];
2129
2227
  custodyMetas.push({
2130
2228
  isSigner: false,
2131
2229
  isWritable: false,
@@ -2178,7 +2276,7 @@ var PerpetualsClient = (function () {
2178
2276
  });
2179
2277
  }); };
2180
2278
  this.getSFLPRemoveLiquidityAmountAndFee = function (amount, poolKey, removeTokenCustodyKey, POOL_CONFIG) { return __awaiter(_this, void 0, void 0, function () {
2181
- var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_11, token, _a, custodies_12, custody, _b, _c, market, removeCustodyConfig, rewardCustody, backUpOracleInstruction, transaction, result, index, res;
2279
+ var backUpOracleInstructionPromise, custodies, custodyMetas, marketMetas, _i, custodies_13, token, _a, custodies_14, custody, _b, _c, market, removeCustodyConfig, rewardCustody, backUpOracleInstruction, transaction, result, index, res;
2182
2280
  var _d;
2183
2281
  return __generator(this, function (_e) {
2184
2282
  switch (_e.label) {
@@ -2187,16 +2285,16 @@ var PerpetualsClient = (function () {
2187
2285
  custodies = POOL_CONFIG.custodies;
2188
2286
  custodyMetas = [];
2189
2287
  marketMetas = [];
2190
- for (_i = 0, custodies_11 = custodies; _i < custodies_11.length; _i++) {
2191
- token = custodies_11[_i];
2288
+ for (_i = 0, custodies_13 = custodies; _i < custodies_13.length; _i++) {
2289
+ token = custodies_13[_i];
2192
2290
  custodyMetas.push({
2193
2291
  isSigner: false,
2194
2292
  isWritable: false,
2195
2293
  pubkey: token.custodyAccount,
2196
2294
  });
2197
2295
  }
2198
- for (_a = 0, custodies_12 = custodies; _a < custodies_12.length; _a++) {
2199
- custody = custodies_12[_a];
2296
+ for (_a = 0, custodies_14 = custodies; _a < custodies_14.length; _a++) {
2297
+ custody = custodies_14[_a];
2200
2298
  custodyMetas.push({
2201
2299
  isSigner: false,
2202
2300
  isWritable: false,
@@ -1185,6 +1185,123 @@
1185
1185
  }
1186
1186
  ]
1187
1187
  },
1188
+ {
1189
+ "programId": "FLASH6Lo6h3iasJKWDs2F8TkW2UKf3s15C8PMGuVfgBn",
1190
+ "perpComposibilityProgramId": "FSWAPViR8ny5K96hezav8jynVubP2dJ2L7SbKzds2hwm",
1191
+ "fbNftRewardProgramId": "FBRWDXSLysNbFQk64MQJcpkXP8e4fjezsGabV8jV7d7o",
1192
+ "cluster": "mainnet-beta",
1193
+ "poolName": "Community.3",
1194
+ "poolAddress": "F8qWvHm5F288VodQ7zGLhnrbbRR3zDbae6aNE53HQ98f",
1195
+ "stakedLpTokenMint": "Cwneu1mq39LExywGhY79nzxeAAGnQhPVijZr98P9hs3Q",
1196
+ "compoundingTokenMint": "C9HErFA8ABcAjfMRp4eySQx8dDB6u92CdqjsnSgYyHGa",
1197
+ "stakedLpVault": "J6g9q4VwzX8F2VA22cB572WghsJgnFRYoJhEVSqSWx58",
1198
+ "compoundingLpVault": "58Vw9F231HwHZ6Cqgey3r3BZDbrxcaTGt5YbZsgYkwTp",
1199
+ "metadataAccount": "9DLY54Dj7qEvFzRZgupyozwxJNGAGP8wFrg7p48zZs3c",
1200
+ "lpDecimals": 6,
1201
+ "compoundingLpTokenSymbol": "FLP.6",
1202
+ "stakedLpTokenSymbol": "sFLP.6",
1203
+ "perpetuals": "7DWCtB5Z8rPiyBMKUwqyC95R9tJpbhoQhLM9LbK3Z5QZ",
1204
+ "transferAuthority": "81xGAvJ27ZeRThU2JEfKAUeT4Fx6qCCd8WHZpujZbiiG",
1205
+ "multisig": "3FqKnAQrvr6G6AqCAWKdqg9fVe6ceAk3A5Y1ibeQqV2V",
1206
+ "addressLookupTableAddresses": [
1207
+ "4E5u7DBVrJp6tVaWkH1sr6r9hhkFwGWmhEHrHeTNDdnP"
1208
+ ],
1209
+ "backupOracle": "AjAubETeBLhebBxLcErmzbavZfqF9bCxkpRAdyJtoi9G",
1210
+ "nftCollectionAddress": "H4EQ8pcE7PQSQGG1WYW4hAA1nizU6ULYipHZcYk9b64u",
1211
+ "rewardDistributionProgram": {
1212
+ "programId": "FARNT7LL119pmy9vSkN9q1ApZESPaKHuuX5Acz1oBoME",
1213
+ "transferAuthority": "E2GZM2FQmX2uGBcBpLQB3s5UhPJvM2F8BgHEkBG45xBN",
1214
+ "rewardVault": "6sXyDryKp6hqV6E1jc7gbzTeWxTFUW1A6s39vzp55hLL",
1215
+ "rewardMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
1216
+ "rewardTokenAccount": "EhH4KEra2UfKdwRErjEFf2286BQ3BstKxfLiyYnF513h"
1217
+ },
1218
+ "tokens": [
1219
+ {
1220
+ "symbol": "USDC",
1221
+ "mintKey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
1222
+ "decimals": 6,
1223
+ "usdPrecision": 2,
1224
+ "tokenPrecision": 4,
1225
+ "isStable": true,
1226
+ "isVirtual": false,
1227
+ "pythTicker": "Crypto.USDC/USD",
1228
+ "pythPriceId": "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a"
1229
+ },
1230
+ {
1231
+ "symbol": "SAMO",
1232
+ "mintKey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
1233
+ "decimals": 9,
1234
+ "usdPrecision": 4,
1235
+ "tokenPrecision": 4,
1236
+ "isStable": false,
1237
+ "isVirtual": false,
1238
+ "pythTicker": "Crypto.SAMO/USD",
1239
+ "pythPriceId": "0x49601625e1a342c1f90c3fe6a03ae0251991a1d76e480d2741524c29037be28a"
1240
+ }
1241
+ ],
1242
+ "custodies": [
1243
+ {
1244
+ "custodyId": 0,
1245
+ "custodyAccount": "888zpafZJEtPYp15HJocz45rw7kTr8BnEM9Hvcd7opy3",
1246
+ "tokenAccount": "BAB98S63TMUmeJLL6ZSAv9o9wX2mCMiUzFb1vhPS4dbF",
1247
+ "symbol": "USDC",
1248
+ "mintKey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
1249
+ "decimals": 6,
1250
+ "usdPrecision": 2,
1251
+ "tokenPrecision": 2,
1252
+ "isStable": true,
1253
+ "isVirtual": false,
1254
+ "intOracleAddress": "GCtJxWQ57B3BJUYdWrhb3TUxzeiDUx275ZCxKkTV6G3N",
1255
+ "extOracleAddress": "Dpw1EAVrSB1ibxiDQyTAW6Zip3J4Btk2x4SgApQCeFbX",
1256
+ "pythTicker": "Crypto.USDC/USD",
1257
+ "pythPriceId": "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a"
1258
+ },
1259
+ {
1260
+ "custodyId": 1,
1261
+ "custodyAccount": "ArnD1faZVVkkewX4HUSoDuht46egAtVvhDTFMJn3DkFo",
1262
+ "tokenAccount": "DvXbMKMk7JESxckPR8knPffm779TwERtAFo3HhJTohtQ",
1263
+ "symbol": "SAMO",
1264
+ "mintKey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
1265
+ "decimals": 9,
1266
+ "usdPrecision": 4,
1267
+ "tokenPrecision": 4,
1268
+ "isStable": false,
1269
+ "isVirtual": false,
1270
+ "intOracleAddress": "7SMPa7rEnjgeDjp8S6i9yH522SXK2vQwNModGxcA5U8Y",
1271
+ "extOracleAddress": "2eUVzcYccqXzsDU1iBuatUaDCbRKBjegEaPPeChzfocG",
1272
+ "pythTicker": "Crypto.SAMO/USD",
1273
+ "pythPriceId": "0x49601625e1a342c1f90c3fe6a03ae0251991a1d76e480d2741524c29037be28a"
1274
+ }
1275
+ ],
1276
+ "markets": [
1277
+ {
1278
+ "marketId": 0,
1279
+ "marketAccount": "FULXckUCpsHnUsaXZNys4bFCbY5s2199SEg6eyeQuxTH",
1280
+ "pool": "F8qWvHm5F288VodQ7zGLhnrbbRR3zDbae6aNE53HQ98f",
1281
+ "targetCustody": "ArnD1faZVVkkewX4HUSoDuht46egAtVvhDTFMJn3DkFo",
1282
+ "collateralCustody": "ArnD1faZVVkkewX4HUSoDuht46egAtVvhDTFMJn3DkFo",
1283
+ "side": "long",
1284
+ "maxLev": 10,
1285
+ "targetCustodyId": 1,
1286
+ "collateralCustodyId": 1,
1287
+ "targetMint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
1288
+ "collateralMint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
1289
+ },
1290
+ {
1291
+ "marketId": 1,
1292
+ "marketAccount": "GchNQzigTFP4bUuH3LwdoDSvn1fexHw84Gtjap8x8Ppm",
1293
+ "pool": "F8qWvHm5F288VodQ7zGLhnrbbRR3zDbae6aNE53HQ98f",
1294
+ "targetCustody": "ArnD1faZVVkkewX4HUSoDuht46egAtVvhDTFMJn3DkFo",
1295
+ "collateralCustody": "888zpafZJEtPYp15HJocz45rw7kTr8BnEM9Hvcd7opy3",
1296
+ "side": "short",
1297
+ "maxLev": 10,
1298
+ "targetCustodyId": 1,
1299
+ "collateralCustodyId": 0,
1300
+ "targetMint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
1301
+ "collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
1302
+ }
1303
+ ]
1304
+ },
1188
1305
  {
1189
1306
  "programId": "FTN6rgbaaxwT8mpRuC55EFTwpHB3BwnHJ91Lqv4ZVCfW",
1190
1307
  "perpComposibilityProgramId": "SWAP4AE4N1if9qKD7dgfQgmRBRv1CtWG8xDs4HP14ST",
@@ -709,6 +709,16 @@ export type Perpetuals = {
709
709
  "name": "market";
710
710
  "isMut": true;
711
711
  "isSigner": false;
712
+ },
713
+ {
714
+ "name": "targetCustody";
715
+ "isMut": false;
716
+ "isSigner": false;
717
+ },
718
+ {
719
+ "name": "collateralCustody";
720
+ "isMut": false;
721
+ "isSigner": false;
712
722
  }
713
723
  ];
714
724
  "args": [
@@ -848,6 +858,45 @@ export type Perpetuals = {
848
858
  ];
849
859
  "returns": "u8";
850
860
  },
861
+ {
862
+ "name": "updateCustody";
863
+ "accounts": [
864
+ {
865
+ "name": "admin";
866
+ "isMut": true;
867
+ "isSigner": true;
868
+ },
869
+ {
870
+ "name": "multisig";
871
+ "isMut": true;
872
+ "isSigner": false;
873
+ },
874
+ {
875
+ "name": "pool";
876
+ "isMut": true;
877
+ "isSigner": false;
878
+ },
879
+ {
880
+ "name": "custody";
881
+ "isMut": true;
882
+ "isSigner": false;
883
+ },
884
+ {
885
+ "name": "systemProgram";
886
+ "isMut": false;
887
+ "isSigner": false;
888
+ }
889
+ ];
890
+ "args": [
891
+ {
892
+ "name": "params";
893
+ "type": {
894
+ "defined": "UpdateCustodyParams";
895
+ };
896
+ }
897
+ ];
898
+ "returns": "u8";
899
+ },
851
900
  {
852
901
  "name": "updateTokenRatios";
853
902
  "accounts": [
@@ -712,6 +712,16 @@ exports.IDL = {
712
712
  "name": "market",
713
713
  "isMut": true,
714
714
  "isSigner": false
715
+ },
716
+ {
717
+ "name": "targetCustody",
718
+ "isMut": false,
719
+ "isSigner": false
720
+ },
721
+ {
722
+ "name": "collateralCustody",
723
+ "isMut": false,
724
+ "isSigner": false
715
725
  }
716
726
  ],
717
727
  "args": [
@@ -851,6 +861,45 @@ exports.IDL = {
851
861
  ],
852
862
  "returns": "u8"
853
863
  },
864
+ {
865
+ "name": "updateCustody",
866
+ "accounts": [
867
+ {
868
+ "name": "admin",
869
+ "isMut": true,
870
+ "isSigner": true
871
+ },
872
+ {
873
+ "name": "multisig",
874
+ "isMut": true,
875
+ "isSigner": false
876
+ },
877
+ {
878
+ "name": "pool",
879
+ "isMut": true,
880
+ "isSigner": false
881
+ },
882
+ {
883
+ "name": "custody",
884
+ "isMut": true,
885
+ "isSigner": false
886
+ },
887
+ {
888
+ "name": "systemProgram",
889
+ "isMut": false,
890
+ "isSigner": false
891
+ }
892
+ ],
893
+ "args": [
894
+ {
895
+ "name": "params",
896
+ "type": {
897
+ "defined": "UpdateCustodyParams"
898
+ }
899
+ }
900
+ ],
901
+ "returns": "u8"
902
+ },
854
903
  {
855
904
  "name": "updateTokenRatios",
856
905
  "accounts": [