@drift-labs/sdk 0.2.0-master.4 → 0.2.0-master.40
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/README.md +27 -27
- package/lib/accounts/bulkAccountLoader.d.ts +2 -0
- package/lib/accounts/bulkAccountLoader.js +36 -29
- package/lib/accounts/bulkUserStatsSubscription.d.ts +7 -0
- package/lib/accounts/bulkUserStatsSubscription.js +21 -0
- package/lib/accounts/bulkUserSubscription.d.ts +2 -2
- package/lib/accounts/bulkUserSubscription.js +0 -1
- package/lib/accounts/fetch.d.ts +2 -1
- package/lib/accounts/fetch.js +9 -1
- package/lib/accounts/{pollingClearingHouseAccountSubscriber.d.ts → pollingDriftClientAccountSubscriber.d.ts} +20 -25
- package/lib/accounts/{pollingClearingHouseAccountSubscriber.js → pollingDriftClientAccountSubscriber.js} +45 -49
- package/lib/accounts/{pollingOracleSubscriber.d.ts → pollingOracleAccountSubscriber.d.ts} +2 -2
- package/lib/accounts/{pollingOracleSubscriber.js → pollingOracleAccountSubscriber.js} +3 -3
- package/lib/accounts/pollingUserStatsAccountSubscriber.d.ts +27 -0
- package/lib/accounts/pollingUserStatsAccountSubscriber.js +113 -0
- package/lib/accounts/types.d.ts +26 -15
- package/lib/accounts/webSocketDriftClientAccountSubscriber.d.ts +49 -0
- package/lib/accounts/{webSocketClearingHouseAccountSubscriber.js → webSocketDriftClientAccountSubscriber.js} +47 -45
- package/lib/accounts/webSocketUserStatsAccountSubsriber.d.ts +20 -0
- package/lib/accounts/webSocketUserStatsAccountSubsriber.js +47 -0
- package/lib/addresses/marketAddresses.d.ts +1 -3
- package/lib/addresses/marketAddresses.js +1 -1
- package/lib/addresses/pda.d.ts +15 -9
- package/lib/addresses/pda.js +73 -35
- package/lib/adminClient.d.ts +65 -0
- package/lib/adminClient.js +637 -0
- package/lib/config.d.ts +9 -9
- package/lib/config.js +25 -21
- package/lib/constants/numericConstants.d.ts +30 -12
- package/lib/constants/numericConstants.js +41 -21
- package/lib/constants/perpMarkets.d.ts +18 -0
- package/lib/constants/{markets.js → perpMarkets.js} +7 -7
- package/lib/constants/spotMarkets.d.ts +19 -0
- package/lib/constants/spotMarkets.js +53 -0
- package/lib/dlob/DLOB.d.ts +82 -0
- package/lib/dlob/DLOB.js +696 -0
- package/lib/dlob/DLOBNode.d.ts +54 -0
- package/lib/dlob/DLOBNode.js +77 -0
- package/lib/dlob/NodeList.d.ts +27 -0
- package/lib/dlob/NodeList.js +144 -0
- package/lib/driftClient.d.ts +233 -0
- package/lib/driftClient.js +2096 -0
- package/lib/{clearingHouseConfig.d.ts → driftClientConfig.d.ts} +9 -9
- package/lib/{clearingHouseConfig.js → driftClientConfig.js} +0 -0
- package/lib/events/eventList.js +3 -0
- package/lib/events/eventSubscriber.d.ts +5 -2
- package/lib/events/eventSubscriber.js +25 -11
- package/lib/events/fetchLogs.d.ts +13 -2
- package/lib/events/fetchLogs.js +40 -12
- package/lib/events/pollingLogProvider.d.ts +2 -1
- package/lib/events/pollingLogProvider.js +7 -3
- package/lib/events/sort.js +8 -11
- package/lib/events/types.d.ts +9 -3
- package/lib/events/types.js +6 -0
- package/lib/events/webSocketLogProvider.js +1 -1
- package/lib/examples/makeTradeExample.js +30 -18
- package/lib/factory/bigNum.d.ts +8 -4
- package/lib/factory/bigNum.js +109 -19
- package/lib/idl/drift.json +8250 -0
- package/lib/idl/{mock_usdc_faucet.json → token_faucet.json} +46 -23
- package/lib/index.d.ts +30 -13
- package/lib/index.js +30 -13
- package/lib/math/amm.d.ts +9 -6
- package/lib/math/amm.js +91 -38
- package/lib/math/conversion.js +1 -1
- package/lib/math/exchangeStatus.d.ts +4 -0
- package/lib/math/exchangeStatus.js +18 -0
- package/lib/math/funding.d.ts +6 -6
- package/lib/math/funding.js +23 -21
- package/lib/math/insurance.d.ts +4 -0
- package/lib/math/insurance.js +27 -0
- package/lib/math/margin.d.ts +11 -0
- package/lib/math/margin.js +82 -0
- package/lib/math/market.d.ts +14 -9
- package/lib/math/market.js +70 -10
- package/lib/math/oracles.d.ts +4 -0
- package/lib/math/oracles.js +36 -8
- package/lib/math/orders.d.ts +14 -6
- package/lib/math/orders.js +90 -17
- package/lib/math/position.d.ts +27 -13
- package/lib/math/position.js +92 -36
- package/lib/math/repeg.js +17 -8
- package/lib/math/spotBalance.d.ts +22 -0
- package/lib/math/spotBalance.js +192 -0
- package/lib/math/spotMarket.d.ts +4 -0
- package/lib/math/spotMarket.js +8 -0
- package/lib/math/spotPosition.d.ts +6 -0
- package/lib/math/spotPosition.js +23 -0
- package/lib/math/trade.d.ts +10 -10
- package/lib/math/trade.js +27 -31
- package/lib/oracles/pythClient.js +1 -1
- package/lib/oracles/quoteAssetOracleClient.js +1 -1
- package/lib/oracles/switchboardClient.js +1 -1
- package/lib/orderParams.d.ts +4 -4
- package/lib/orderParams.js +12 -4
- package/lib/serum/serumFulfillmentConfigMap.d.ts +10 -0
- package/lib/serum/serumFulfillmentConfigMap.js +17 -0
- package/lib/serum/serumSubscriber.d.ts +27 -0
- package/lib/serum/serumSubscriber.js +56 -0
- package/lib/serum/types.d.ts +11 -0
- package/lib/{clearingHouseUserConfig.js → serum/types.js} +0 -0
- package/lib/slot/SlotSubscriber.d.ts +7 -0
- package/lib/slot/SlotSubscriber.js +3 -0
- package/lib/{mockUSDCFaucet.d.ts → tokenFaucet.d.ts} +8 -5
- package/lib/{mockUSDCFaucet.js → tokenFaucet.js} +63 -51
- package/lib/tx/retryTxSender.d.ts +1 -1
- package/lib/tx/retryTxSender.js +13 -4
- package/lib/tx/types.d.ts +1 -1
- package/lib/tx/utils.js +1 -1
- package/lib/types.d.ts +589 -196
- package/lib/types.js +108 -17
- package/lib/user.d.ts +226 -0
- package/lib/user.js +949 -0
- package/lib/userConfig.d.ts +14 -0
- package/lib/userConfig.js +2 -0
- package/lib/userMap/userMap.d.ts +41 -0
- package/lib/userMap/userMap.js +85 -0
- package/lib/userMap/userStatsMap.d.ts +19 -0
- package/lib/userMap/userStatsMap.js +68 -0
- package/lib/userName.d.ts +1 -0
- package/lib/userName.js +3 -2
- package/lib/userStats.d.ts +18 -0
- package/lib/userStats.js +49 -0
- package/lib/userStatsConfig.d.ts +14 -0
- package/lib/userStatsConfig.js +2 -0
- package/lib/util/computeUnits.js +1 -1
- package/lib/util/getTokenAddress.d.ts +2 -0
- package/lib/util/getTokenAddress.js +9 -0
- package/package.json +10 -3
- package/src/accounts/bulkAccountLoader.ts +44 -34
- package/src/accounts/bulkUserStatsSubscription.ts +33 -0
- package/src/accounts/bulkUserSubscription.ts +2 -3
- package/src/accounts/fetch.ts +27 -2
- package/src/accounts/{pollingClearingHouseAccountSubscriber.ts → pollingDriftClientAccountSubscriber.ts} +65 -75
- package/src/accounts/{pollingOracleSubscriber.ts → pollingOracleAccountSubscriber.ts} +2 -2
- package/src/accounts/pollingUserStatsAccountSubscriber.ts +172 -0
- package/src/accounts/types.ts +35 -15
- package/src/accounts/{webSocketClearingHouseAccountSubscriber.ts → webSocketDriftClientAccountSubscriber.ts} +78 -73
- package/src/accounts/webSocketUserStatsAccountSubsriber.ts +80 -0
- package/src/addresses/marketAddresses.ts +3 -4
- package/src/addresses/pda.ts +105 -33
- package/src/adminClient.ts +1207 -0
- package/src/config.ts +37 -31
- package/src/constants/numericConstants.ts +58 -24
- package/src/constants/{markets.ts → perpMarkets.ts} +10 -10
- package/src/constants/spotMarkets.ts +73 -0
- package/src/dlob/DLOB.ts +1123 -0
- package/src/dlob/DLOBNode.ts +155 -0
- package/src/dlob/NodeList.ts +195 -0
- package/src/driftClient.ts +3564 -0
- package/src/{clearingHouseConfig.ts → driftClientConfig.ts} +9 -8
- package/src/events/eventList.ts +3 -0
- package/src/events/eventSubscriber.ts +36 -14
- package/src/events/fetchLogs.ts +55 -13
- package/src/events/pollingLogProvider.ts +11 -3
- package/src/events/sort.ts +11 -15
- package/src/events/types.ts +21 -2
- package/src/events/webSocketLogProvider.ts +1 -1
- package/src/examples/makeTradeExample.ts +44 -28
- package/src/factory/bigNum.ts +150 -22
- package/src/idl/drift.json +8250 -0
- package/src/idl/pyth.json +98 -2
- package/src/idl/{mock_usdc_faucet.json → token_faucet.json} +46 -23
- package/src/index.ts +30 -13
- package/src/math/amm.ts +161 -48
- package/src/math/conversion.ts +2 -2
- package/src/math/exchangeStatus.ts +31 -0
- package/src/math/funding.ts +41 -31
- package/src/math/insurance.ts +35 -0
- package/src/math/margin.ts +133 -0
- package/src/math/market.ts +143 -14
- package/src/math/oracles.ts +63 -9
- package/src/math/orders.ts +163 -26
- package/src/math/position.ts +136 -58
- package/src/math/repeg.ts +19 -9
- package/src/math/spotBalance.ts +319 -0
- package/src/math/spotMarket.ts +9 -0
- package/src/math/spotPosition.ts +47 -0
- package/src/math/trade.ts +33 -37
- package/src/oracles/pythClient.ts +2 -2
- package/src/oracles/quoteAssetOracleClient.ts +2 -2
- package/src/oracles/switchboardClient.ts +2 -2
- package/src/orderParams.ts +16 -8
- package/src/serum/serumFulfillmentConfigMap.ts +26 -0
- package/src/serum/serumSubscriber.ts +99 -0
- package/src/serum/types.ts +13 -0
- package/src/slot/SlotSubscriber.ts +11 -1
- package/src/{mockUSDCFaucet.ts → tokenFaucet.ts} +82 -70
- package/src/tx/retryTxSender.ts +16 -5
- package/src/tx/types.ts +2 -1
- package/src/tx/utils.ts +1 -1
- package/src/types.ts +572 -178
- package/src/user.ts +1582 -0
- package/src/{clearingHouseUserConfig.ts → userConfig.ts} +5 -5
- package/src/userMap/userMap.ts +124 -0
- package/src/userMap/userStatsMap.ts +108 -0
- package/src/userName.ts +2 -1
- package/src/userStats.ts +75 -0
- package/src/userStatsConfig.ts +18 -0
- package/src/util/computeUnits.ts +1 -1
- package/src/util/getTokenAddress.ts +18 -0
- package/tests/bn/test.ts +46 -11
- package/tests/dlob/helpers.ts +611 -0
- package/tests/dlob/test.ts +4588 -0
- package/lib/accounts/webSocketClearingHouseAccountSubscriber.d.ts +0 -49
- package/lib/admin.d.ts +0 -44
- package/lib/admin.js +0 -433
- package/lib/clearingHouse.d.ts +0 -133
- package/lib/clearingHouse.js +0 -931
- package/lib/clearingHouseUser.d.ts +0 -187
- package/lib/clearingHouseUser.js +0 -643
- package/lib/clearingHouseUserConfig.d.ts +0 -14
- package/lib/constants/banks.d.ts +0 -16
- package/lib/constants/banks.js +0 -34
- package/lib/constants/markets.d.ts +0 -19
- package/lib/idl/clearing_house.json +0 -3998
- package/lib/math/bankBalance.d.ts +0 -9
- package/lib/math/bankBalance.js +0 -75
- package/lib/math/state.d.ts +0 -8
- package/lib/math/state.js +0 -15
- package/lib/orders.d.ts +0 -8
- package/lib/orders.js +0 -134
- package/src/admin.ts +0 -722
- package/src/clearingHouse.ts +0 -1451
- package/src/clearingHouseUser.ts +0 -989
- package/src/constants/banks.ts +0 -43
- package/src/idl/clearing_house.json +0 -3998
- package/src/math/bankBalance.ts +0 -112
- package/src/math/state.ts +0 -14
- package/src/math/utils.js +0 -27
- package/src/math/utils.js.map +0 -1
- package/src/orders.ts +0 -244
- package/src/util/computeUnits.js +0 -17
- package/src/util/computeUnits.js.map +0 -1
package/src/admin.ts
DELETED
|
@@ -1,722 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PublicKey,
|
|
3
|
-
SYSVAR_RENT_PUBKEY,
|
|
4
|
-
TransactionSignature,
|
|
5
|
-
} from '@solana/web3.js';
|
|
6
|
-
import {
|
|
7
|
-
FeeStructure,
|
|
8
|
-
OracleGuardRails,
|
|
9
|
-
OracleSource,
|
|
10
|
-
OrderFillerRewardStructure,
|
|
11
|
-
} from './types';
|
|
12
|
-
import { BN } from '@project-serum/anchor';
|
|
13
|
-
import * as anchor from '@project-serum/anchor';
|
|
14
|
-
import {
|
|
15
|
-
getClearingHouseStateAccountPublicKeyAndNonce,
|
|
16
|
-
getBankVaultAuthorityPublicKey,
|
|
17
|
-
getBankPublicKey,
|
|
18
|
-
getBankVaultPublicKey,
|
|
19
|
-
getMarketPublicKey,
|
|
20
|
-
} from './addresses/pda';
|
|
21
|
-
import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
22
|
-
import { ClearingHouse } from './clearingHouse';
|
|
23
|
-
import { PEG_PRECISION } from './constants/numericConstants';
|
|
24
|
-
import { calculateTargetPriceTrade } from './math/trade';
|
|
25
|
-
import { calculateAmmReservesAfterSwap, getSwapDirection } from './math/amm';
|
|
26
|
-
|
|
27
|
-
export class Admin extends ClearingHouse {
|
|
28
|
-
public async initialize(
|
|
29
|
-
usdcMint: PublicKey,
|
|
30
|
-
adminControlsPrices: boolean
|
|
31
|
-
): Promise<[TransactionSignature]> {
|
|
32
|
-
const stateAccountRPCResponse = await this.connection.getParsedAccountInfo(
|
|
33
|
-
await this.getStatePublicKey()
|
|
34
|
-
);
|
|
35
|
-
if (stateAccountRPCResponse.value !== null) {
|
|
36
|
-
throw new Error('Clearing house already initialized');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const [insuranceVaultPublicKey] = await PublicKey.findProgramAddress(
|
|
40
|
-
[Buffer.from(anchor.utils.bytes.utf8.encode('insurance_vault'))],
|
|
41
|
-
this.program.programId
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const [insuranceVaultAuthority] = await PublicKey.findProgramAddress(
|
|
45
|
-
[insuranceVaultPublicKey.toBuffer()],
|
|
46
|
-
this.program.programId
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
const [clearingHouseStatePublicKey] =
|
|
50
|
-
await getClearingHouseStateAccountPublicKeyAndNonce(
|
|
51
|
-
this.program.programId
|
|
52
|
-
);
|
|
53
|
-
const initializeTx = await this.program.transaction.initialize(
|
|
54
|
-
adminControlsPrices,
|
|
55
|
-
{
|
|
56
|
-
accounts: {
|
|
57
|
-
admin: this.wallet.publicKey,
|
|
58
|
-
state: clearingHouseStatePublicKey,
|
|
59
|
-
quoteAssetMint: usdcMint,
|
|
60
|
-
insuranceVault: insuranceVaultPublicKey,
|
|
61
|
-
insuranceVaultAuthority: insuranceVaultAuthority,
|
|
62
|
-
rent: SYSVAR_RENT_PUBKEY,
|
|
63
|
-
systemProgram: anchor.web3.SystemProgram.programId,
|
|
64
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
65
|
-
},
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const { txSig: initializeTxSig } = await this.txSender.send(
|
|
70
|
-
initializeTx,
|
|
71
|
-
[],
|
|
72
|
-
this.opts
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
return [initializeTxSig];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public async initializeBank(
|
|
79
|
-
mint: PublicKey,
|
|
80
|
-
optimalUtilization: BN,
|
|
81
|
-
optimalRate: BN,
|
|
82
|
-
maxRate: BN,
|
|
83
|
-
oracle: PublicKey,
|
|
84
|
-
oracleSource: OracleSource,
|
|
85
|
-
initialAssetWeight: BN,
|
|
86
|
-
maintenanceAssetWeight: BN,
|
|
87
|
-
initialLiabilityWeight: BN,
|
|
88
|
-
maintenanceLiabilityWeight: BN
|
|
89
|
-
): Promise<TransactionSignature> {
|
|
90
|
-
const bankIndex = this.getStateAccount().numberOfBanks;
|
|
91
|
-
const bank = await getBankPublicKey(this.program.programId, bankIndex);
|
|
92
|
-
|
|
93
|
-
const bankVault = await getBankVaultPublicKey(
|
|
94
|
-
this.program.programId,
|
|
95
|
-
bankIndex
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
const bankVaultAuthority = await getBankVaultAuthorityPublicKey(
|
|
99
|
-
this.program.programId,
|
|
100
|
-
bankIndex
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
const initializeTx = await this.program.transaction.initializeBank(
|
|
104
|
-
optimalUtilization,
|
|
105
|
-
optimalRate,
|
|
106
|
-
maxRate,
|
|
107
|
-
oracleSource,
|
|
108
|
-
initialAssetWeight,
|
|
109
|
-
maintenanceAssetWeight,
|
|
110
|
-
initialLiabilityWeight,
|
|
111
|
-
maintenanceLiabilityWeight,
|
|
112
|
-
{
|
|
113
|
-
accounts: {
|
|
114
|
-
admin: this.wallet.publicKey,
|
|
115
|
-
state: await this.getStatePublicKey(),
|
|
116
|
-
bank,
|
|
117
|
-
bankVault,
|
|
118
|
-
bankVaultAuthority,
|
|
119
|
-
bankMint: mint,
|
|
120
|
-
oracle,
|
|
121
|
-
rent: SYSVAR_RENT_PUBKEY,
|
|
122
|
-
systemProgram: anchor.web3.SystemProgram.programId,
|
|
123
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
124
|
-
},
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
const { txSig } = await this.txSender.send(initializeTx, [], this.opts);
|
|
129
|
-
|
|
130
|
-
await this.accountSubscriber.addBank(bankIndex);
|
|
131
|
-
await this.accountSubscriber.addOracle({
|
|
132
|
-
source: oracleSource,
|
|
133
|
-
publicKey: oracle,
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
return txSig;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
public async initializeMarket(
|
|
140
|
-
priceOracle: PublicKey,
|
|
141
|
-
baseAssetReserve: BN,
|
|
142
|
-
quoteAssetReserve: BN,
|
|
143
|
-
periodicity: BN,
|
|
144
|
-
pegMultiplier: BN = PEG_PRECISION,
|
|
145
|
-
oracleSource: OracleSource = OracleSource.PYTH,
|
|
146
|
-
marginRatioInitial = 2000,
|
|
147
|
-
marginRatioPartial = 625,
|
|
148
|
-
marginRatioMaintenance = 500
|
|
149
|
-
): Promise<TransactionSignature> {
|
|
150
|
-
const marketPublicKey = await getMarketPublicKey(
|
|
151
|
-
this.program.programId,
|
|
152
|
-
this.getStateAccount().numberOfMarkets
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
const initializeMarketTx = await this.program.transaction.initializeMarket(
|
|
156
|
-
baseAssetReserve,
|
|
157
|
-
quoteAssetReserve,
|
|
158
|
-
periodicity,
|
|
159
|
-
pegMultiplier,
|
|
160
|
-
oracleSource,
|
|
161
|
-
marginRatioInitial,
|
|
162
|
-
marginRatioPartial,
|
|
163
|
-
marginRatioMaintenance,
|
|
164
|
-
{
|
|
165
|
-
accounts: {
|
|
166
|
-
state: await this.getStatePublicKey(),
|
|
167
|
-
admin: this.wallet.publicKey,
|
|
168
|
-
oracle: priceOracle,
|
|
169
|
-
market: marketPublicKey,
|
|
170
|
-
rent: SYSVAR_RENT_PUBKEY,
|
|
171
|
-
systemProgram: anchor.web3.SystemProgram.programId,
|
|
172
|
-
},
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
const { txSig } = await this.txSender.send(
|
|
176
|
-
initializeMarketTx,
|
|
177
|
-
[],
|
|
178
|
-
this.opts
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
await this.accountSubscriber.addMarket(
|
|
182
|
-
this.getStateAccount().numberOfMarkets
|
|
183
|
-
);
|
|
184
|
-
await this.accountSubscriber.addOracle({
|
|
185
|
-
source: oracleSource,
|
|
186
|
-
publicKey: priceOracle,
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
return txSig;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
public async moveAmmPrice(
|
|
193
|
-
baseAssetReserve: BN,
|
|
194
|
-
quoteAssetReserve: BN,
|
|
195
|
-
marketIndex: BN
|
|
196
|
-
): Promise<TransactionSignature> {
|
|
197
|
-
const marketPublicKey = await getMarketPublicKey(
|
|
198
|
-
this.program.programId,
|
|
199
|
-
marketIndex
|
|
200
|
-
);
|
|
201
|
-
|
|
202
|
-
return await this.program.rpc.moveAmmPrice(
|
|
203
|
-
baseAssetReserve,
|
|
204
|
-
quoteAssetReserve,
|
|
205
|
-
{
|
|
206
|
-
accounts: {
|
|
207
|
-
state: await this.getStatePublicKey(),
|
|
208
|
-
admin: this.wallet.publicKey,
|
|
209
|
-
market: marketPublicKey,
|
|
210
|
-
},
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
public async updateK(
|
|
216
|
-
sqrtK: BN,
|
|
217
|
-
marketIndex: BN
|
|
218
|
-
): Promise<TransactionSignature> {
|
|
219
|
-
return await this.program.rpc.updateK(sqrtK, {
|
|
220
|
-
accounts: {
|
|
221
|
-
state: await this.getStatePublicKey(),
|
|
222
|
-
admin: this.wallet.publicKey,
|
|
223
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
224
|
-
oracle: this.getMarketAccount(marketIndex).amm.oracle,
|
|
225
|
-
},
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
public async moveAmmToPrice(
|
|
230
|
-
marketIndex: BN,
|
|
231
|
-
targetPrice: BN
|
|
232
|
-
): Promise<TransactionSignature> {
|
|
233
|
-
const market = this.getMarketAccount(marketIndex);
|
|
234
|
-
|
|
235
|
-
const [direction, tradeSize, _] = calculateTargetPriceTrade(
|
|
236
|
-
market,
|
|
237
|
-
targetPrice,
|
|
238
|
-
new BN(1000),
|
|
239
|
-
'quote',
|
|
240
|
-
undefined //todo
|
|
241
|
-
);
|
|
242
|
-
|
|
243
|
-
const [newQuoteAssetAmount, newBaseAssetAmount] =
|
|
244
|
-
calculateAmmReservesAfterSwap(
|
|
245
|
-
market.amm,
|
|
246
|
-
'quote',
|
|
247
|
-
tradeSize,
|
|
248
|
-
getSwapDirection('quote', direction)
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
const marketPublicKey = await getMarketPublicKey(
|
|
252
|
-
this.program.programId,
|
|
253
|
-
marketIndex
|
|
254
|
-
);
|
|
255
|
-
|
|
256
|
-
return await this.program.rpc.moveAmmPrice(
|
|
257
|
-
newBaseAssetAmount,
|
|
258
|
-
newQuoteAssetAmount,
|
|
259
|
-
{
|
|
260
|
-
accounts: {
|
|
261
|
-
state: await this.getStatePublicKey(),
|
|
262
|
-
admin: this.wallet.publicKey,
|
|
263
|
-
market: marketPublicKey,
|
|
264
|
-
},
|
|
265
|
-
}
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
public async repegAmmCurve(
|
|
270
|
-
newPeg: BN,
|
|
271
|
-
marketIndex: BN
|
|
272
|
-
): Promise<TransactionSignature> {
|
|
273
|
-
const marketPublicKey = await getMarketPublicKey(
|
|
274
|
-
this.program.programId,
|
|
275
|
-
marketIndex
|
|
276
|
-
);
|
|
277
|
-
const ammData = this.getMarketAccount(marketIndex).amm;
|
|
278
|
-
|
|
279
|
-
return await this.program.rpc.repegAmmCurve(newPeg, {
|
|
280
|
-
accounts: {
|
|
281
|
-
state: await this.getStatePublicKey(),
|
|
282
|
-
admin: this.wallet.publicKey,
|
|
283
|
-
oracle: ammData.oracle,
|
|
284
|
-
market: marketPublicKey,
|
|
285
|
-
},
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
public async updateAmmOracleTwap(
|
|
290
|
-
marketIndex: BN
|
|
291
|
-
): Promise<TransactionSignature> {
|
|
292
|
-
const ammData = this.getMarketAccount(marketIndex).amm;
|
|
293
|
-
const marketPublicKey = await getMarketPublicKey(
|
|
294
|
-
this.program.programId,
|
|
295
|
-
marketIndex
|
|
296
|
-
);
|
|
297
|
-
|
|
298
|
-
return await this.program.rpc.updateAmmOracleTwap({
|
|
299
|
-
accounts: {
|
|
300
|
-
state: await this.getStatePublicKey(),
|
|
301
|
-
admin: this.wallet.publicKey,
|
|
302
|
-
oracle: ammData.oracle,
|
|
303
|
-
market: marketPublicKey,
|
|
304
|
-
},
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
public async resetAmmOracleTwap(
|
|
309
|
-
marketIndex: BN
|
|
310
|
-
): Promise<TransactionSignature> {
|
|
311
|
-
const ammData = this.getMarketAccount(marketIndex).amm;
|
|
312
|
-
const marketPublicKey = await getMarketPublicKey(
|
|
313
|
-
this.program.programId,
|
|
314
|
-
marketIndex
|
|
315
|
-
);
|
|
316
|
-
|
|
317
|
-
return await this.program.rpc.resetAmmOracleTwap({
|
|
318
|
-
accounts: {
|
|
319
|
-
state: await this.getStatePublicKey(),
|
|
320
|
-
admin: this.wallet.publicKey,
|
|
321
|
-
oracle: ammData.oracle,
|
|
322
|
-
market: marketPublicKey,
|
|
323
|
-
},
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
public async withdrawFromInsuranceVault(
|
|
328
|
-
amount: BN,
|
|
329
|
-
recipient: PublicKey
|
|
330
|
-
): Promise<TransactionSignature> {
|
|
331
|
-
const state = await this.getStateAccount();
|
|
332
|
-
return await this.program.rpc.withdrawFromInsuranceVault(amount, {
|
|
333
|
-
accounts: {
|
|
334
|
-
admin: this.wallet.publicKey,
|
|
335
|
-
state: await this.getStatePublicKey(),
|
|
336
|
-
insuranceVault: state.insuranceVault,
|
|
337
|
-
insuranceVaultAuthority: state.insuranceVaultAuthority,
|
|
338
|
-
recipient: recipient,
|
|
339
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
340
|
-
},
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
public async withdrawFees(
|
|
345
|
-
marketIndex: BN,
|
|
346
|
-
amount: BN,
|
|
347
|
-
recipient: PublicKey
|
|
348
|
-
): Promise<TransactionSignature> {
|
|
349
|
-
const marketPublicKey = await getMarketPublicKey(
|
|
350
|
-
this.program.programId,
|
|
351
|
-
marketIndex
|
|
352
|
-
);
|
|
353
|
-
const bank = this.getQuoteAssetBankAccount();
|
|
354
|
-
return await this.program.rpc.withdrawFees(amount, {
|
|
355
|
-
accounts: {
|
|
356
|
-
admin: this.wallet.publicKey,
|
|
357
|
-
state: await this.getStatePublicKey(),
|
|
358
|
-
market: marketPublicKey,
|
|
359
|
-
bank: bank.pubkey,
|
|
360
|
-
bankVault: bank.vault,
|
|
361
|
-
bankVaultAuthority: bank.vaultAuthority,
|
|
362
|
-
recipient: recipient,
|
|
363
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
364
|
-
},
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
public async withdrawFromInsuranceVaultToMarket(
|
|
369
|
-
marketIndex: BN,
|
|
370
|
-
amount: BN
|
|
371
|
-
): Promise<TransactionSignature> {
|
|
372
|
-
const state = await this.getStateAccount();
|
|
373
|
-
return await this.program.rpc.withdrawFromInsuranceVaultToMarket(amount, {
|
|
374
|
-
accounts: {
|
|
375
|
-
admin: this.wallet.publicKey,
|
|
376
|
-
state: await this.getStatePublicKey(),
|
|
377
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
378
|
-
insuranceVault: state.insuranceVault,
|
|
379
|
-
insuranceVaultAuthority: state.insuranceVaultAuthority,
|
|
380
|
-
bankVault: this.getQuoteAssetBankAccount().vault,
|
|
381
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
382
|
-
},
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
public async updateAdmin(admin: PublicKey): Promise<TransactionSignature> {
|
|
387
|
-
return await this.program.rpc.updateAdmin(admin, {
|
|
388
|
-
accounts: {
|
|
389
|
-
admin: this.wallet.publicKey,
|
|
390
|
-
state: await this.getStatePublicKey(),
|
|
391
|
-
},
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
public async updateCurveUpdateIntensity(
|
|
396
|
-
marketIndex: BN,
|
|
397
|
-
curveUpdateIntensity: number
|
|
398
|
-
): Promise<TransactionSignature> {
|
|
399
|
-
// assert(curveUpdateIntensity >= 0 && curveUpdateIntensity <= 100);
|
|
400
|
-
// assert(Number.isInteger(curveUpdateIntensity));
|
|
401
|
-
|
|
402
|
-
return await this.program.rpc.updateCurveUpdateIntensity(
|
|
403
|
-
curveUpdateIntensity,
|
|
404
|
-
{
|
|
405
|
-
accounts: {
|
|
406
|
-
admin: this.wallet.publicKey,
|
|
407
|
-
state: await this.getStatePublicKey(),
|
|
408
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
409
|
-
},
|
|
410
|
-
}
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
public async updateMarginRatio(
|
|
415
|
-
marketIndex: BN,
|
|
416
|
-
marginRatioInitial: number,
|
|
417
|
-
marginRatioPartial: number,
|
|
418
|
-
marginRatioMaintenance: number
|
|
419
|
-
): Promise<TransactionSignature> {
|
|
420
|
-
return await this.program.rpc.updateMarginRatio(
|
|
421
|
-
marginRatioInitial,
|
|
422
|
-
marginRatioPartial,
|
|
423
|
-
marginRatioMaintenance,
|
|
424
|
-
{
|
|
425
|
-
accounts: {
|
|
426
|
-
admin: this.wallet.publicKey,
|
|
427
|
-
state: await this.getStatePublicKey(),
|
|
428
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
429
|
-
},
|
|
430
|
-
}
|
|
431
|
-
);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
public async updateMarketBaseSpread(
|
|
435
|
-
marketIndex: BN,
|
|
436
|
-
baseSpread: number
|
|
437
|
-
): Promise<TransactionSignature> {
|
|
438
|
-
return await this.program.rpc.updateMarketBaseSpread(baseSpread, {
|
|
439
|
-
accounts: {
|
|
440
|
-
admin: this.wallet.publicKey,
|
|
441
|
-
state: await this.getStatePublicKey(),
|
|
442
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
443
|
-
},
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
public async updateMarketMaxSpread(
|
|
448
|
-
marketIndex: BN,
|
|
449
|
-
maxSpread: number
|
|
450
|
-
): Promise<TransactionSignature> {
|
|
451
|
-
return await this.program.rpc.updateMarketMaxSpread(maxSpread, {
|
|
452
|
-
accounts: {
|
|
453
|
-
admin: this.wallet.publicKey,
|
|
454
|
-
state: await this.getStatePublicKey(),
|
|
455
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
456
|
-
},
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
public async updatePartialLiquidationClosePercentage(
|
|
461
|
-
numerator: BN,
|
|
462
|
-
denominator: BN
|
|
463
|
-
): Promise<TransactionSignature> {
|
|
464
|
-
return await this.program.rpc.updatePartialLiquidationClosePercentage(
|
|
465
|
-
numerator,
|
|
466
|
-
denominator,
|
|
467
|
-
{
|
|
468
|
-
accounts: {
|
|
469
|
-
admin: this.wallet.publicKey,
|
|
470
|
-
state: await this.getStatePublicKey(),
|
|
471
|
-
},
|
|
472
|
-
}
|
|
473
|
-
);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
public async updatePartialLiquidationPenaltyPercentage(
|
|
477
|
-
numerator: BN,
|
|
478
|
-
denominator: BN
|
|
479
|
-
): Promise<TransactionSignature> {
|
|
480
|
-
return await this.program.rpc.updatePartialLiquidationPenaltyPercentage(
|
|
481
|
-
numerator,
|
|
482
|
-
denominator,
|
|
483
|
-
{
|
|
484
|
-
accounts: {
|
|
485
|
-
admin: this.wallet.publicKey,
|
|
486
|
-
state: await this.getStatePublicKey(),
|
|
487
|
-
},
|
|
488
|
-
}
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
public async updateFullLiquidationPenaltyPercentage(
|
|
493
|
-
numerator: BN,
|
|
494
|
-
denominator: BN
|
|
495
|
-
): Promise<TransactionSignature> {
|
|
496
|
-
return await this.program.rpc.updateFullLiquidationPenaltyPercentage(
|
|
497
|
-
numerator,
|
|
498
|
-
denominator,
|
|
499
|
-
{
|
|
500
|
-
accounts: {
|
|
501
|
-
admin: this.wallet.publicKey,
|
|
502
|
-
state: await this.getStatePublicKey(),
|
|
503
|
-
},
|
|
504
|
-
}
|
|
505
|
-
);
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
public async updatePartialLiquidationShareDenominator(
|
|
509
|
-
denominator: BN
|
|
510
|
-
): Promise<TransactionSignature> {
|
|
511
|
-
return await this.program.rpc.updatePartialLiquidationLiquidatorShareDenominator(
|
|
512
|
-
denominator,
|
|
513
|
-
{
|
|
514
|
-
accounts: {
|
|
515
|
-
admin: this.wallet.publicKey,
|
|
516
|
-
state: await this.getStatePublicKey(),
|
|
517
|
-
},
|
|
518
|
-
}
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
public async updateFullLiquidationShareDenominator(
|
|
523
|
-
denominator: BN
|
|
524
|
-
): Promise<TransactionSignature> {
|
|
525
|
-
return await this.program.rpc.updateFullLiquidationLiquidatorShareDenominator(
|
|
526
|
-
denominator,
|
|
527
|
-
{
|
|
528
|
-
accounts: {
|
|
529
|
-
admin: this.wallet.publicKey,
|
|
530
|
-
state: await this.getStatePublicKey(),
|
|
531
|
-
},
|
|
532
|
-
}
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
public async updateOrderFillerRewardStructure(
|
|
537
|
-
orderFillerRewardStructure: OrderFillerRewardStructure
|
|
538
|
-
): Promise<TransactionSignature> {
|
|
539
|
-
return await this.program.rpc.updateOrderFillerRewardStructure(
|
|
540
|
-
orderFillerRewardStructure,
|
|
541
|
-
{
|
|
542
|
-
accounts: {
|
|
543
|
-
admin: this.wallet.publicKey,
|
|
544
|
-
state: await this.getStatePublicKey(),
|
|
545
|
-
},
|
|
546
|
-
}
|
|
547
|
-
);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
public async updateFee(fees: FeeStructure): Promise<TransactionSignature> {
|
|
551
|
-
return await this.program.rpc.updateFee(fees, {
|
|
552
|
-
accounts: {
|
|
553
|
-
admin: this.wallet.publicKey,
|
|
554
|
-
state: await this.getStatePublicKey(),
|
|
555
|
-
},
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
public async updateOracleGuardRails(
|
|
560
|
-
oracleGuardRails: OracleGuardRails
|
|
561
|
-
): Promise<TransactionSignature> {
|
|
562
|
-
return await this.program.rpc.updateOracleGuardRails(oracleGuardRails, {
|
|
563
|
-
accounts: {
|
|
564
|
-
admin: this.wallet.publicKey,
|
|
565
|
-
state: await this.getStatePublicKey(),
|
|
566
|
-
},
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
public async updateMarketOracle(
|
|
571
|
-
marketIndex: BN,
|
|
572
|
-
oracle: PublicKey,
|
|
573
|
-
oracleSource: OracleSource
|
|
574
|
-
): Promise<TransactionSignature> {
|
|
575
|
-
return await this.program.rpc.updateMarketOracle(oracle, oracleSource, {
|
|
576
|
-
accounts: {
|
|
577
|
-
admin: this.wallet.publicKey,
|
|
578
|
-
state: await this.getStatePublicKey(),
|
|
579
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
580
|
-
},
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
public async updateMarketMinimumQuoteAssetTradeSize(
|
|
585
|
-
marketIndex: BN,
|
|
586
|
-
minimumTradeSize: BN
|
|
587
|
-
): Promise<TransactionSignature> {
|
|
588
|
-
return await this.program.rpc.updateMarketMinimumQuoteAssetTradeSize(
|
|
589
|
-
minimumTradeSize,
|
|
590
|
-
{
|
|
591
|
-
accounts: {
|
|
592
|
-
admin: this.wallet.publicKey,
|
|
593
|
-
state: await this.getStatePublicKey(),
|
|
594
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
595
|
-
},
|
|
596
|
-
}
|
|
597
|
-
);
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
public async updateMarketBaseAssetAmountStepSize(
|
|
601
|
-
marketIndex: BN,
|
|
602
|
-
stepSize: BN
|
|
603
|
-
): Promise<TransactionSignature> {
|
|
604
|
-
return await this.program.rpc.updateMarketBaseAssetAmountStepSize(
|
|
605
|
-
stepSize,
|
|
606
|
-
{
|
|
607
|
-
accounts: {
|
|
608
|
-
admin: this.wallet.publicKey,
|
|
609
|
-
state: await this.getStatePublicKey(),
|
|
610
|
-
market: await getMarketPublicKey(this.program.programId, marketIndex),
|
|
611
|
-
},
|
|
612
|
-
}
|
|
613
|
-
);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
public async updateWhitelistMint(
|
|
617
|
-
whitelistMint?: PublicKey
|
|
618
|
-
): Promise<TransactionSignature> {
|
|
619
|
-
return await this.program.rpc.updateWhitelistMint(whitelistMint, {
|
|
620
|
-
accounts: {
|
|
621
|
-
admin: this.wallet.publicKey,
|
|
622
|
-
state: await this.getStatePublicKey(),
|
|
623
|
-
},
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
public async updateDiscountMint(
|
|
628
|
-
discountMint: PublicKey
|
|
629
|
-
): Promise<TransactionSignature> {
|
|
630
|
-
return await this.program.rpc.updateDiscountMint(discountMint, {
|
|
631
|
-
accounts: {
|
|
632
|
-
admin: this.wallet.publicKey,
|
|
633
|
-
state: await this.getStatePublicKey(),
|
|
634
|
-
},
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
public async updateMaxDeposit(maxDeposit: BN): Promise<TransactionSignature> {
|
|
639
|
-
return await this.program.rpc.updateMaxDeposit(maxDeposit, {
|
|
640
|
-
accounts: {
|
|
641
|
-
admin: this.wallet.publicKey,
|
|
642
|
-
state: await this.getStatePublicKey(),
|
|
643
|
-
},
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
public async updateFundingPaused(
|
|
648
|
-
fundingPaused: boolean
|
|
649
|
-
): Promise<TransactionSignature> {
|
|
650
|
-
return await this.program.rpc.updateFundingPaused(fundingPaused, {
|
|
651
|
-
accounts: {
|
|
652
|
-
admin: this.wallet.publicKey,
|
|
653
|
-
state: await this.getStatePublicKey(),
|
|
654
|
-
},
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
public async updateExchangePaused(
|
|
659
|
-
exchangePaused: boolean
|
|
660
|
-
): Promise<TransactionSignature> {
|
|
661
|
-
return await this.program.rpc.updateExchangePaused(exchangePaused, {
|
|
662
|
-
accounts: {
|
|
663
|
-
admin: this.wallet.publicKey,
|
|
664
|
-
state: await this.getStatePublicKey(),
|
|
665
|
-
},
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
public async disableAdminControlsPrices(): Promise<TransactionSignature> {
|
|
670
|
-
return await this.program.rpc.disableAdminControlsPrices({
|
|
671
|
-
accounts: {
|
|
672
|
-
admin: this.wallet.publicKey,
|
|
673
|
-
state: await this.getStatePublicKey(),
|
|
674
|
-
},
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
public async updateAuctionDuration(
|
|
679
|
-
minDuration: BN | number,
|
|
680
|
-
maxDuration: BN | number
|
|
681
|
-
): Promise<TransactionSignature> {
|
|
682
|
-
return await this.program.rpc.updateAuctionDuration(
|
|
683
|
-
typeof minDuration === 'number' ? minDuration : minDuration.toNumber(),
|
|
684
|
-
typeof maxDuration === 'number' ? maxDuration : maxDuration.toNumber(),
|
|
685
|
-
{
|
|
686
|
-
accounts: {
|
|
687
|
-
admin: this.wallet.publicKey,
|
|
688
|
-
state: await this.getStatePublicKey(),
|
|
689
|
-
},
|
|
690
|
-
}
|
|
691
|
-
);
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
public async updateMaxBaseAssetAmountRatio(
|
|
695
|
-
marketIndex: BN,
|
|
696
|
-
maxBaseAssetAmountRatio: number
|
|
697
|
-
): Promise<TransactionSignature> {
|
|
698
|
-
return await this.program.rpc.updateMaxBaseAssetAmountRatio(
|
|
699
|
-
maxBaseAssetAmountRatio,
|
|
700
|
-
{
|
|
701
|
-
accounts: {
|
|
702
|
-
admin: this.wallet.publicKey,
|
|
703
|
-
state: await this.getStatePublicKey(),
|
|
704
|
-
market: this.getMarketAccount(marketIndex).pubkey,
|
|
705
|
-
},
|
|
706
|
-
}
|
|
707
|
-
);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
public async updateMaxSlippageRatio(
|
|
711
|
-
marketIndex: BN,
|
|
712
|
-
maxSlippageRatio: number
|
|
713
|
-
): Promise<TransactionSignature> {
|
|
714
|
-
return await this.program.rpc.updateMaxSlippageRatio(maxSlippageRatio, {
|
|
715
|
-
accounts: {
|
|
716
|
-
admin: this.wallet.publicKey,
|
|
717
|
-
state: await this.getStatePublicKey(),
|
|
718
|
-
market: this.getMarketAccount(marketIndex).pubkey,
|
|
719
|
-
},
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
}
|