@drift-labs/sdk 0.2.0-master.2 → 0.2.0-master.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/accounts/bulkUserStatsSubscription.d.ts +7 -0
- package/lib/accounts/bulkUserStatsSubscription.js +21 -0
- 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/pollingUserStatsAccountSubscriber.d.ts +27 -0
- package/lib/accounts/pollingUserStatsAccountSubscriber.js +113 -0
- package/lib/accounts/types.d.ts +14 -1
- package/lib/accounts/webSocketUserStatsAccountSubsriber.d.ts +20 -0
- package/lib/accounts/webSocketUserStatsAccountSubsriber.js +47 -0
- package/lib/addresses/pda.d.ts +1 -0
- package/lib/addresses/pda.js +8 -1
- package/lib/admin.d.ts +9 -5
- package/lib/admin.js +52 -11
- package/lib/clearingHouse.d.ts +52 -23
- package/lib/clearingHouse.js +727 -197
- package/lib/clearingHouseConfig.d.ts +1 -0
- package/lib/clearingHouseUser.d.ts +17 -17
- package/lib/clearingHouseUser.js +186 -101
- package/lib/clearingHouseUserStats.d.ts +18 -0
- package/lib/clearingHouseUserStats.js +49 -0
- package/lib/clearingHouseUserStatsConfig.d.ts +14 -0
- package/lib/clearingHouseUserStatsConfig.js +2 -0
- package/lib/config.js +1 -1
- package/lib/constants/banks.d.ts +2 -2
- package/lib/constants/banks.js +12 -4
- package/lib/constants/numericConstants.d.ts +5 -0
- package/lib/constants/numericConstants.js +8 -3
- package/lib/events/eventList.js +3 -0
- package/lib/events/types.d.ts +3 -1
- package/lib/events/types.js +2 -0
- package/lib/factory/bigNum.d.ts +1 -0
- package/lib/factory/bigNum.js +34 -10
- package/lib/idl/clearing_house.json +1609 -388
- package/lib/idl/{mock_usdc_faucet.json → token_faucet.json} +46 -23
- package/lib/index.d.ts +9 -3
- package/lib/index.js +13 -3
- package/lib/math/amm.d.ts +1 -0
- package/lib/math/amm.js +22 -38
- package/lib/math/auction.js +4 -1
- package/lib/math/bankBalance.d.ts +7 -1
- package/lib/math/bankBalance.js +77 -2
- package/lib/math/margin.d.ts +11 -0
- package/lib/math/margin.js +72 -0
- package/lib/math/market.d.ts +4 -1
- package/lib/math/market.js +35 -1
- package/lib/math/oracles.d.ts +3 -0
- package/lib/math/oracles.js +25 -5
- package/lib/math/orders.d.ts +5 -2
- package/lib/math/orders.js +53 -12
- package/lib/math/position.d.ts +8 -0
- package/lib/math/position.js +45 -12
- package/lib/math/trade.d.ts +1 -1
- package/lib/math/trade.js +7 -10
- package/lib/orderParams.d.ts +14 -5
- package/lib/orderParams.js +8 -96
- 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.js +9 -2
- package/lib/tx/utils.js +1 -1
- package/lib/types.d.ts +233 -26
- package/lib/types.js +64 -1
- 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 +3 -3
- package/src/accounts/bulkUserStatsSubscription.ts +33 -0
- package/src/accounts/bulkUserSubscription.ts +0 -1
- package/src/accounts/fetch.ts +27 -2
- package/src/accounts/pollingUserStatsAccountSubscriber.ts +172 -0
- package/src/accounts/types.ts +18 -0
- package/src/accounts/webSocketUserStatsAccountSubsriber.ts +80 -0
- package/src/addresses/marketAddresses.js +26 -0
- package/src/addresses/pda.ts +13 -0
- package/src/admin.ts +82 -15
- package/src/assert/assert.js +9 -0
- package/src/clearingHouse.ts +1224 -319
- package/src/clearingHouseConfig.ts +1 -0
- package/src/clearingHouseUser.ts +311 -148
- package/src/clearingHouseUserStats.ts +75 -0
- package/src/clearingHouseUserStatsConfig.ts +18 -0
- package/src/config.ts +1 -1
- package/src/constants/banks.js +42 -0
- package/src/constants/banks.ts +14 -4
- package/src/constants/markets.js +42 -0
- package/src/constants/numericConstants.js +41 -0
- package/src/constants/numericConstants.ts +14 -2
- package/src/events/eventList.js +77 -0
- package/src/events/eventList.ts +3 -0
- package/src/events/eventSubscriber.js +139 -0
- package/src/events/fetchLogs.js +50 -0
- package/src/events/pollingLogProvider.js +64 -0
- package/src/events/sort.js +44 -0
- package/src/events/txEventCache.js +71 -0
- package/src/events/types.ts +6 -0
- package/src/events/webSocketLogProvider.js +41 -0
- package/src/examples/makeTradeExample.js +80 -0
- package/src/factory/bigNum.js +390 -0
- package/src/factory/bigNum.ts +42 -13
- package/src/factory/oracleClient.js +20 -0
- package/src/idl/clearing_house.json +1609 -388
- package/src/idl/{mock_usdc_faucet.json → token_faucet.json} +46 -23
- package/src/index.ts +9 -3
- package/src/math/amm.ts +54 -55
- package/src/math/auction.js +42 -0
- package/src/math/auction.ts +5 -1
- package/src/math/bankBalance.ts +148 -2
- package/src/math/conversion.js +11 -0
- package/src/math/funding.js +248 -0
- package/src/math/margin.ts +124 -0
- package/src/math/market.ts +66 -1
- package/src/math/oracles.js +26 -0
- package/src/math/oracles.ts +42 -5
- package/src/math/orders.ts +112 -13
- package/src/math/position.ts +64 -9
- package/src/math/repeg.js +128 -0
- package/src/math/state.js +15 -0
- package/src/math/trade.js +253 -0
- package/src/math/trade.ts +23 -25
- package/src/math/utils.js +0 -1
- package/src/oracles/oracleClientCache.js +19 -0
- package/src/oracles/pythClient.js +46 -0
- package/src/oracles/quoteAssetOracleClient.js +32 -0
- package/src/oracles/switchboardClient.js +69 -0
- package/src/oracles/types.js +2 -0
- package/src/orderParams.js +20 -0
- package/src/orderParams.ts +20 -141
- package/src/slot/SlotSubscriber.js +39 -0
- package/src/slot/SlotSubscriber.ts +11 -1
- package/src/token/index.js +38 -0
- package/src/tokenFaucet.js +189 -0
- package/src/{mockUSDCFaucet.ts → tokenFaucet.ts} +82 -70
- package/src/tx/retryTxSender.ts +11 -3
- package/src/tx/types.js +2 -0
- package/src/tx/utils.js +17 -0
- package/src/tx/utils.ts +1 -1
- package/src/types.ts +236 -27
- package/src/userName.js +20 -0
- package/src/util/computeUnits.js +21 -11
- package/src/util/computeUnits.ts +1 -1
- package/src/util/getTokenAddress.js +9 -0
- package/src/util/getTokenAddress.ts +18 -0
- package/src/util/promiseTimeout.js +14 -0
- package/src/util/tps.js +27 -0
- package/src/wallet.js +35 -0
- package/tests/bn/test.ts +10 -0
- package/lib/orders.d.ts +0 -8
- package/lib/orders.js +0 -142
- package/src/orders.ts +0 -251
- package/src/util/computeUnits.js.map +0 -1
package/lib/clearingHouse.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="bn.js" />
|
|
3
3
|
import { AnchorProvider, BN, Program } from '@project-serum/anchor';
|
|
4
|
-
import { StateAccount, IWallet, PositionDirection, UserAccount, MarketAccount, OrderParams, Order, BankAccount, UserBankBalance, MakerInfo } from './types';
|
|
4
|
+
import { StateAccount, IWallet, PositionDirection, UserAccount, MarketAccount, OrderParams, Order, BankAccount, UserBankBalance, MakerInfo, TakerInfo, OptionalOrderParams, ReferrerInfo } from './types';
|
|
5
5
|
import { Connection, PublicKey, TransactionSignature, ConfirmOptions, TransactionInstruction, AccountMeta } from '@solana/web3.js';
|
|
6
|
-
import {
|
|
6
|
+
import { TokenFaucet } from './tokenFaucet';
|
|
7
7
|
import { EventEmitter } from 'events';
|
|
8
8
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
9
9
|
import { ClearingHouseAccountSubscriber, ClearingHouseAccountEvents, DataAndSlot } from './accounts/types';
|
|
@@ -12,6 +12,7 @@ import { OraclePriceData } from './oracles/types';
|
|
|
12
12
|
import { ClearingHouseConfig } from './clearingHouseConfig';
|
|
13
13
|
import { ClearingHouseUser } from './clearingHouseUser';
|
|
14
14
|
import { ClearingHouseUserAccountSubscriptionConfig } from './clearingHouseUserConfig';
|
|
15
|
+
import { ClearingHouseUserStats } from './clearingHouseUserStats';
|
|
15
16
|
/**
|
|
16
17
|
* # ClearingHouse
|
|
17
18
|
* This class is the main way to interact with Drift Protocol. It allows you to subscribe to the various accounts where the Market's state is stored, as well as: opening positions, liquidating, settling funding, depositing & withdrawing, and more.
|
|
@@ -23,6 +24,7 @@ export declare class ClearingHouse {
|
|
|
23
24
|
provider: AnchorProvider;
|
|
24
25
|
opts?: ConfirmOptions;
|
|
25
26
|
users: Map<number, ClearingHouseUser>;
|
|
27
|
+
userStats?: ClearingHouseUserStats;
|
|
26
28
|
activeUserId: number;
|
|
27
29
|
userAccountSubscriptionConfig: ClearingHouseUserAccountSubscriptionConfig;
|
|
28
30
|
accountSubscriber: ClearingHouseAccountSubscriber;
|
|
@@ -60,10 +62,14 @@ export declare class ClearingHouse {
|
|
|
60
62
|
updateWallet(newWallet: IWallet, userIds?: number[], activeUserId?: number): Promise<void>;
|
|
61
63
|
switchActiveUser(userId: number): Promise<void>;
|
|
62
64
|
addUser(userId: number): Promise<void>;
|
|
63
|
-
initializeUserAccount(userId?: number, name?: string): Promise<[TransactionSignature, PublicKey]>;
|
|
64
|
-
getInitializeUserInstructions(userId?: number, name?: string): Promise<[PublicKey, TransactionInstruction]>;
|
|
65
|
+
initializeUserAccount(userId?: number, name?: string, referrerInfo?: ReferrerInfo): Promise<[TransactionSignature, PublicKey]>;
|
|
66
|
+
getInitializeUserInstructions(userId?: number, name?: string, referrerInfo?: ReferrerInfo): Promise<[PublicKey, TransactionInstruction]>;
|
|
67
|
+
getInitializeUserStatsIx(): Promise<TransactionInstruction>;
|
|
65
68
|
getUser(userId?: number): ClearingHouseUser;
|
|
66
69
|
getUsers(): ClearingHouseUser[];
|
|
70
|
+
getUserStats(): ClearingHouseUserStats;
|
|
71
|
+
userStatsAccountPublicKey: PublicKey;
|
|
72
|
+
getUserStatsAccountPublicKey(): PublicKey;
|
|
67
73
|
getUserAccountPublicKey(): Promise<PublicKey>;
|
|
68
74
|
getUserAccount(userId?: number): UserAccount | undefined;
|
|
69
75
|
getUserAccountAndSlot(userId?: number): DataAndSlot<UserAccount> | undefined;
|
|
@@ -72,63 +78,86 @@ export declare class ClearingHouse {
|
|
|
72
78
|
getRemainingAccounts(params: {
|
|
73
79
|
writableMarketIndex?: BN;
|
|
74
80
|
writableBankIndex?: BN;
|
|
81
|
+
readableMarketIndex?: BN;
|
|
75
82
|
}): AccountMeta[];
|
|
76
83
|
getOrder(orderId: BN | number): Order | undefined;
|
|
77
84
|
getOrderByUserId(userOrderId: number): Order | undefined;
|
|
78
85
|
deposit(amount: BN, bankIndex: BN, collateralAccountPublicKey: PublicKey, userId?: number, reduceOnly?: boolean): Promise<TransactionSignature>;
|
|
79
86
|
getDepositInstruction(amount: BN, bankIndex: BN, userTokenAccount: PublicKey, userId?: number, reduceOnly?: boolean, userInitialized?: boolean): Promise<TransactionInstruction>;
|
|
87
|
+
private checkIfAccountExists;
|
|
88
|
+
private getSolWithdrawalIxs;
|
|
89
|
+
private getWrappedSolAccountCreationIxs;
|
|
80
90
|
/**
|
|
81
91
|
* Creates the Clearing House User account for a user, and deposits some initial collateral
|
|
82
|
-
* @param userId
|
|
83
|
-
* @param name
|
|
84
92
|
* @param amount
|
|
85
93
|
* @param userTokenAccount
|
|
94
|
+
* @param bankIndex
|
|
95
|
+
* @param userId
|
|
96
|
+
* @param name
|
|
86
97
|
* @param fromUserId
|
|
87
98
|
* @returns
|
|
88
99
|
*/
|
|
89
|
-
initializeUserAccountAndDepositCollateral(amount: BN, userTokenAccount: PublicKey, bankIndex?: BN, userId?: number, name?: string, fromUserId?: number): Promise<[TransactionSignature, PublicKey]>;
|
|
90
|
-
initializeUserAccountForDevnet(userId: number, name: string,
|
|
100
|
+
initializeUserAccountAndDepositCollateral(amount: BN, userTokenAccount: PublicKey, bankIndex?: BN, userId?: number, name?: string, fromUserId?: number, referrerInfo?: ReferrerInfo): Promise<[TransactionSignature, PublicKey]>;
|
|
101
|
+
initializeUserAccountForDevnet(userId: number, name: string, bankIndex: BN, tokenFaucet: TokenFaucet, amount: BN, referrerInfo?: ReferrerInfo): Promise<[TransactionSignature, PublicKey]>;
|
|
91
102
|
withdraw(amount: BN, bankIndex: BN, userTokenAccount: PublicKey, reduceOnly?: boolean): Promise<TransactionSignature>;
|
|
92
103
|
getWithdrawIx(amount: BN, bankIndex: BN, userTokenAccount: PublicKey, reduceOnly?: boolean): Promise<TransactionInstruction>;
|
|
93
104
|
transferDeposit(amount: BN, bankIndex: BN, fromUserId: number, toUserId: number): Promise<TransactionSignature>;
|
|
94
105
|
getTransferDepositIx(amount: BN, bankIndex: BN, fromUserId: number, toUserId: number): Promise<TransactionInstruction>;
|
|
95
106
|
updateBankCumulativeInterest(bankIndex: BN): Promise<TransactionSignature>;
|
|
96
107
|
updateBankCumulativeInterestIx(bankIndex: BN): Promise<TransactionInstruction>;
|
|
108
|
+
settleLP(settleeUserAccountPublicKey: PublicKey, marketIndex: BN): Promise<TransactionSignature>;
|
|
109
|
+
settleLPIx(settleeUserAccountPublicKey: PublicKey, marketIndex: BN): Promise<TransactionInstruction>;
|
|
110
|
+
removeLiquidity(marketIndex: BN, sharesToBurn?: BN): Promise<TransactionSignature>;
|
|
111
|
+
getRemoveLiquidityIx(marketIndex: BN, sharesToBurn?: BN): Promise<TransactionInstruction>;
|
|
112
|
+
addLiquidity(amount: BN, marketIndex: BN): Promise<TransactionSignature>;
|
|
113
|
+
getAddLiquidityIx(amount: BN, marketIndex: BN): Promise<TransactionInstruction>;
|
|
97
114
|
openPosition(direction: PositionDirection, amount: BN, marketIndex: BN, limitPrice?: BN): Promise<TransactionSignature>;
|
|
98
|
-
placeOrder(orderParams:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
getExpireOrdersIx(userAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
|
|
115
|
+
placeOrder(orderParams: OptionalOrderParams): Promise<TransactionSignature>;
|
|
116
|
+
getOrderParams(optionalOrderParams: OptionalOrderParams): OrderParams;
|
|
117
|
+
getPlaceOrderIx(orderParams: OptionalOrderParams): Promise<TransactionInstruction>;
|
|
102
118
|
updateAMMs(marketIndexes: BN[]): Promise<TransactionSignature>;
|
|
103
119
|
getUpdateAMMsIx(marketIndexes: BN[]): Promise<TransactionInstruction>;
|
|
104
120
|
cancelOrder(orderId?: BN): Promise<TransactionSignature>;
|
|
105
121
|
getCancelOrderIx(orderId?: BN): Promise<TransactionInstruction>;
|
|
106
122
|
cancelOrderByUserId(userOrderId: number): Promise<TransactionSignature>;
|
|
107
123
|
getCancelOrderByUserIdIx(userOrderId: number): Promise<TransactionInstruction>;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
cancelOrdersByMarketAndSide(bestEffort?: boolean, marketIndexOnly?: BN, directionOnly?: PositionDirection): Promise<TransactionSignature>;
|
|
111
|
-
getCancelOrdersByMarketAndSideIx(bestEffort?: boolean, marketIndexOnly?: BN, directionOnly?: PositionDirection): Promise<TransactionInstruction>;
|
|
112
|
-
fillOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Order, makerInfo?: MakerInfo): Promise<TransactionSignature>;
|
|
113
|
-
getFillOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Order, makerInfo?: MakerInfo): Promise<TransactionInstruction>;
|
|
124
|
+
fillOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Order, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionSignature>;
|
|
125
|
+
getFillOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Order, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
114
126
|
triggerOrder(userAccountPublicKey: PublicKey, user: UserAccount, order: Order): Promise<TransactionSignature>;
|
|
115
127
|
getTriggerOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Order): Promise<TransactionInstruction>;
|
|
116
|
-
placeAndTake(orderParams:
|
|
117
|
-
getPlaceAndTakeIx(orderParams:
|
|
128
|
+
placeAndTake(orderParams: OptionalOrderParams, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionSignature>;
|
|
129
|
+
getPlaceAndTakeIx(orderParams: OptionalOrderParams, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
130
|
+
placeAndMake(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionSignature>;
|
|
131
|
+
getPlaceAndMakeIx(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
118
132
|
/**
|
|
119
133
|
* Close an entire position. If you want to reduce a position, use the {@link openPosition} method in the opposite direction of the current position.
|
|
120
134
|
* @param marketIndex
|
|
121
135
|
* @returns
|
|
122
136
|
*/
|
|
123
|
-
closePosition(marketIndex: BN): Promise<TransactionSignature>;
|
|
137
|
+
closePosition(marketIndex: BN, limitPrice?: BN): Promise<TransactionSignature>;
|
|
124
138
|
settlePNLs(users: {
|
|
125
139
|
settleeUserAccountPublicKey: PublicKey;
|
|
126
140
|
settleeUserAccount: UserAccount;
|
|
127
141
|
}[], marketIndex: BN): Promise<TransactionSignature>;
|
|
128
142
|
settlePNL(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndex: BN): Promise<TransactionSignature>;
|
|
129
143
|
settlePNLIx(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndex: BN): Promise<TransactionInstruction>;
|
|
130
|
-
|
|
131
|
-
|
|
144
|
+
liquidatePerp(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: BN, maxBaseAssetAmount: BN): Promise<TransactionSignature>;
|
|
145
|
+
getLiquidatePerpIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: BN, maxBaseAssetAmount: BN): Promise<TransactionInstruction>;
|
|
146
|
+
liquidateBorrow(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetBankIndex: BN, liabilityBankIndex: BN, maxLiabilityTransfer: BN): Promise<TransactionSignature>;
|
|
147
|
+
getLiquidateBorrowIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetBankIndex: BN, liabilityBankIndex: BN, maxLiabilityTransfer: BN): Promise<TransactionInstruction>;
|
|
148
|
+
liquidateBorrowForPerpPnl(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: BN, liabilityBankIndex: BN, maxLiabilityTransfer: BN): Promise<TransactionSignature>;
|
|
149
|
+
getLiquidateBorrowForPerpPnlIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: BN, liabilityBankIndex: BN, maxLiabilityTransfer: BN): Promise<TransactionInstruction>;
|
|
150
|
+
liquidatePerpPnlForDeposit(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: BN, assetBankIndex: BN, maxPnlTransfer: BN): Promise<TransactionSignature>;
|
|
151
|
+
getLiquidatePerpPnlForDepositIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: BN, assetBankIndex: BN, maxPnlTransfer: BN): Promise<TransactionInstruction>;
|
|
152
|
+
resolvePerpBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: BN): Promise<TransactionSignature>;
|
|
153
|
+
getResolvePerpBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: BN): Promise<TransactionInstruction>;
|
|
154
|
+
resolveBorrowBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, bankIndex: BN): Promise<TransactionSignature>;
|
|
155
|
+
getResolveBorrowBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, bankIndex: BN): Promise<TransactionInstruction>;
|
|
156
|
+
getRemainingAccountsForLiquidation(params: {
|
|
157
|
+
userAccount: UserAccount;
|
|
158
|
+
writableMarketIndex?: BN;
|
|
159
|
+
writableBankIndexes?: BN[];
|
|
160
|
+
}): AccountMeta[];
|
|
132
161
|
updateFundingRate(oracle: PublicKey, marketIndex: BN): Promise<TransactionSignature>;
|
|
133
162
|
getUpdateFundingRateIx(oracle: PublicKey, marketIndex: BN): Promise<TransactionInstruction>;
|
|
134
163
|
settleFundingPayment(userAccount: PublicKey): Promise<TransactionSignature>;
|