@drift-labs/sdk 2.124.0-beta.14 → 2.124.0-beta.2
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/VERSION +1 -1
- package/lib/browser/accounts/bulkAccountLoader.js +2 -2
- package/lib/browser/addresses/pda.d.ts +0 -1
- package/lib/browser/addresses/pda.js +1 -10
- package/lib/browser/adminClient.d.ts +1 -5
- package/lib/browser/adminClient.js +6 -49
- package/lib/browser/constants/numericConstants.d.ts +1 -2
- package/lib/browser/constants/numericConstants.js +53 -54
- package/lib/browser/driftClient.d.ts +0 -10
- package/lib/browser/driftClient.js +3 -45
- package/lib/browser/driftClientConfig.d.ts +0 -2
- package/lib/browser/events/types.d.ts +2 -4
- package/lib/browser/events/types.js +0 -2
- package/lib/browser/idl/drift.json +0 -561
- package/lib/browser/index.d.ts +0 -2
- package/lib/browser/index.js +1 -4
- package/lib/browser/math/amm.js +4 -4
- package/lib/browser/math/auction.d.ts +1 -7
- package/lib/browser/math/auction.js +1 -58
- package/lib/browser/types.d.ts +0 -58
- package/lib/browser/user.d.ts +1 -1
- package/lib/browser/user.js +46 -10
- package/lib/node/accounts/bulkAccountLoader.d.ts.map +1 -1
- package/lib/node/accounts/bulkAccountLoader.js +2 -2
- package/lib/node/addresses/pda.d.ts +0 -1
- package/lib/node/addresses/pda.d.ts.map +1 -1
- package/lib/node/addresses/pda.js +1 -10
- package/lib/node/adminClient.d.ts +1 -5
- package/lib/node/adminClient.d.ts.map +1 -1
- package/lib/node/adminClient.js +6 -49
- package/lib/node/constants/numericConstants.d.ts +1 -2
- package/lib/node/constants/numericConstants.d.ts.map +1 -1
- package/lib/node/constants/numericConstants.js +53 -54
- package/lib/node/driftClient.d.ts +0 -10
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +3 -45
- package/lib/node/driftClientConfig.d.ts +0 -2
- package/lib/node/driftClientConfig.d.ts.map +1 -1
- package/lib/node/events/types.d.ts +2 -4
- package/lib/node/events/types.d.ts.map +1 -1
- package/lib/node/events/types.js +0 -2
- package/lib/node/idl/drift.json +0 -561
- package/lib/node/index.d.ts +0 -2
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +1 -4
- package/lib/node/math/amm.js +4 -4
- package/lib/node/math/auction.d.ts +1 -7
- package/lib/node/math/auction.d.ts.map +1 -1
- package/lib/node/math/auction.js +1 -58
- package/lib/node/types.d.ts +0 -58
- package/lib/node/types.d.ts.map +1 -1
- package/lib/node/user.d.ts +1 -1
- package/lib/node/user.d.ts.map +1 -1
- package/lib/node/user.js +46 -10
- package/package.json +1 -1
- package/src/accounts/bulkAccountLoader.ts +2 -1
- package/src/addresses/pda.ts +0 -15
- package/src/adminClient.ts +6 -99
- package/src/constants/numericConstants.ts +1 -3
- package/src/driftClient.ts +3 -81
- package/src/driftClientConfig.ts +0 -2
- package/src/events/types.ts +1 -9
- package/src/idl/drift.json +1 -562
- package/src/index.ts +0 -2
- package/src/math/amm.ts +4 -4
- package/src/math/auction.ts +1 -96
- package/src/types.ts +0 -62
- package/src/user.ts +73 -25
- package/tests/dlob/helpers.ts +0 -3
- package/lib/browser/accounts/customizedCadenceBulkAccountLoader.d.ts +0 -44
- package/lib/browser/accounts/customizedCadenceBulkAccountLoader.js +0 -152
- package/lib/browser/decode/customCoder.d.ts +0 -46
- package/lib/browser/decode/customCoder.js +0 -75
- package/lib/node/accounts/customizedCadenceBulkAccountLoader.d.ts +0 -45
- package/lib/node/accounts/customizedCadenceBulkAccountLoader.d.ts.map +0 -1
- package/lib/node/accounts/customizedCadenceBulkAccountLoader.js +0 -152
- package/lib/node/decode/customCoder.d.ts +0 -47
- package/lib/node/decode/customCoder.d.ts.map +0 -1
- package/lib/node/decode/customCoder.js +0 -75
- package/src/accounts/customizedCadenceBulkAccountLoader.ts +0 -213
- package/src/decode/customCoder.ts +0 -114
- package/tests/accounts/customizedCadenceBulkAccountLoader.test.ts +0 -202
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.124.0-beta.
|
|
1
|
+
2.124.0-beta.2
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BulkAccountLoader = void 0;
|
|
4
4
|
const uuid_1 = require("uuid");
|
|
5
5
|
const promiseTimeout_1 = require("../util/promiseTimeout");
|
|
6
|
-
const
|
|
6
|
+
const GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = 99;
|
|
7
7
|
const oneMinute = 60 * 1000;
|
|
8
8
|
class BulkAccountLoader {
|
|
9
9
|
constructor(connection, commitment, pollingFrequency) {
|
|
@@ -84,7 +84,7 @@ class BulkAccountLoader {
|
|
|
84
84
|
});
|
|
85
85
|
this.lastTimeLoadingPromiseCleared = Date.now();
|
|
86
86
|
try {
|
|
87
|
-
const chunks = this.chunks(this.chunks(Array.from(this.accountsToLoad.values()),
|
|
87
|
+
const chunks = this.chunks(this.chunks(Array.from(this.accountsToLoad.values()), GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE), 10);
|
|
88
88
|
await Promise.all(chunks.map((chunk) => {
|
|
89
89
|
return this.loadChunk(chunk);
|
|
90
90
|
}));
|
|
@@ -32,4 +32,3 @@ export declare function getPythLazerOraclePublicKey(progarmId: PublicKey, feedId
|
|
|
32
32
|
export declare function getTokenProgramForSpotMarket(spotMarketAccount: SpotMarketAccount): PublicKey;
|
|
33
33
|
export declare function getHighLeverageModeConfigPublicKey(programId: PublicKey): PublicKey;
|
|
34
34
|
export declare function getProtectedMakerModeConfigPublicKey(programId: PublicKey): PublicKey;
|
|
35
|
-
export declare function getIfRebalanceConfigPublicKey(programId: PublicKey, inMarketIndex: number, outMarketIndex: number): PublicKey;
|
|
@@ -23,10 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.getProtectedMakerModeConfigPublicKey = exports.getHighLeverageModeConfigPublicKey = exports.getTokenProgramForSpotMarket = exports.getPythLazerOraclePublicKey = exports.getPythPullOraclePublicKey = exports.getPrelaunchOraclePublicKey = exports.getProtocolIfSharesTransferConfigPublicKey = exports.getReferrerNamePublicKeySync = exports.getOpenbookV2FulfillmentConfigPublicKey = exports.getPhoenixFulfillmentConfigPublicKey = exports.getSerumFulfillmentConfigPublicKey = exports.getSerumSignerPublicKey = exports.getSerumOpenOrdersPublicKey = exports.getDriftSignerPublicKey = exports.getInsuranceFundStakeAccountPublicKey = exports.getInsuranceFundVaultPublicKey = exports.getSpotMarketVaultPublicKey = exports.getSpotMarketPublicKeySync = exports.getSpotMarketPublicKey = exports.getPerpMarketPublicKeySync = exports.getPerpMarketPublicKey = exports.getSignedMsgWsDelegatesAccountPublicKey = exports.getSignedMsgUserAccountPublicKey = exports.getFuelOverflowAccountPublicKey = exports.getUserStatsAccountPublicKey = exports.getUserAccountPublicKeySync = exports.getUserAccountPublicKey = exports.getUserAccountPublicKeyAndNonce = exports.getDriftStateAccountPublicKey = exports.getDriftStateAccountPublicKeyAndNonce = void 0;
|
|
27
27
|
const web3_js_1 = require("@solana/web3.js");
|
|
28
28
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
29
|
-
const anchor_1 = require("@coral-xyz/anchor");
|
|
30
29
|
const spl_token_1 = require("@solana/spl-token");
|
|
31
30
|
async function getDriftStateAccountPublicKeyAndNonce(programId) {
|
|
32
31
|
return web3_js_1.PublicKey.findProgramAddress([Buffer.from(anchor.utils.bytes.utf8.encode('drift_state'))], programId);
|
|
@@ -223,11 +222,3 @@ function getProtectedMakerModeConfigPublicKey(programId) {
|
|
|
223
222
|
], programId)[0];
|
|
224
223
|
}
|
|
225
224
|
exports.getProtectedMakerModeConfigPublicKey = getProtectedMakerModeConfigPublicKey;
|
|
226
|
-
function getIfRebalanceConfigPublicKey(programId, inMarketIndex, outMarketIndex) {
|
|
227
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
228
|
-
Buffer.from(anchor.utils.bytes.utf8.encode('if_rebalance_config')),
|
|
229
|
-
new anchor_1.BN(inMarketIndex).toArrayLike(Buffer, 'le', 2),
|
|
230
|
-
new anchor_1.BN(outMarketIndex).toArrayLike(Buffer, 'le', 2),
|
|
231
|
-
], programId)[0];
|
|
232
|
-
}
|
|
233
|
-
exports.getIfRebalanceConfigPublicKey = getIfRebalanceConfigPublicKey;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
import { PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
|
|
3
|
-
import { FeeStructure, OracleGuardRails, OracleSource, ExchangeStatus, MarketStatus, ContractTier, AssetTier, SpotFulfillmentConfigStatus
|
|
3
|
+
import { FeeStructure, OracleGuardRails, OracleSource, ExchangeStatus, MarketStatus, ContractTier, AssetTier, SpotFulfillmentConfigStatus } from './types';
|
|
4
4
|
import { BN } from '@coral-xyz/anchor';
|
|
5
5
|
import { DriftClient } from './driftClient';
|
|
6
6
|
export declare class AdminClient extends DriftClient {
|
|
@@ -183,8 +183,6 @@ export declare class AdminClient extends DriftClient {
|
|
|
183
183
|
getInitializeProtocolIfSharesTransferConfigIx(): Promise<TransactionInstruction>;
|
|
184
184
|
updateProtocolIfSharesTransferConfig(whitelistedSigners?: PublicKey[], maxTransferPerEpoch?: BN): Promise<TransactionSignature>;
|
|
185
185
|
getUpdateProtocolIfSharesTransferConfigIx(whitelistedSigners?: PublicKey[], maxTransferPerEpoch?: BN): Promise<TransactionInstruction>;
|
|
186
|
-
transferProtocolIfSharesToRevenuePool(outMarketIndex: number, inMarketIndex: number, amount: BN): Promise<TransactionSignature>;
|
|
187
|
-
getTransferProtocolIfSharesToRevenuePoolIx(outMarketIndex: number, inMarketIndex: number, amount: BN): Promise<TransactionInstruction>;
|
|
188
186
|
initializePrelaunchOracle(perpMarketIndex: number, price?: BN, maxPrice?: BN): Promise<TransactionSignature>;
|
|
189
187
|
getInitializePrelaunchOracleIx(perpMarketIndex: number, price?: BN, maxPrice?: BN): Promise<TransactionInstruction>;
|
|
190
188
|
updatePrelaunchOracleParams(perpMarketIndex: number, price?: BN, maxPrice?: BN): Promise<TransactionSignature>;
|
|
@@ -201,8 +199,6 @@ export declare class AdminClient extends DriftClient {
|
|
|
201
199
|
getUpdatePerpMarketAmmSpreadAdjustmentIx(perpMarketIndex: number, ammSpreadAdjustment: number): Promise<TransactionInstruction>;
|
|
202
200
|
updatePerpMarketProtectedMakerParams(perpMarketIndex: number, protectedMakerLimitPriceDivisor?: number, protectedMakerDynamicDivisor?: number): Promise<TransactionSignature>;
|
|
203
201
|
getUpdatePerpMarketProtectedMakerParamsIx(perpMarketIndex: number, protectedMakerLimitPriceDivisor?: number, protectedMakerDynamicDivisor?: number): Promise<TransactionInstruction>;
|
|
204
|
-
initializeIfRebalanceConfig(params: IfRebalanceConfigParams): Promise<TransactionSignature>;
|
|
205
|
-
getInitializeIfRebalanceConfigIx(params: IfRebalanceConfigParams): Promise<TransactionInstruction>;
|
|
206
202
|
initUserFuel(user: PublicKey, authority: PublicKey, fuelBonusDeposits?: number, fuelBonusBorrows?: number, fuelBonusTaker?: number, fuelBonusMaker?: number, fuelBonusInsurance?: number): Promise<TransactionSignature>;
|
|
207
203
|
getInitUserFuelIx(user: PublicKey, authority: PublicKey, fuelBonusDeposits?: number, fuelBonusBorrows?: number, fuelBonusTaker?: number, fuelBonusMaker?: number, fuelBonusInsurance?: number): Promise<TransactionInstruction>;
|
|
208
204
|
/**
|
|
@@ -1666,30 +1666,6 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
1666
1666
|
},
|
|
1667
1667
|
});
|
|
1668
1668
|
}
|
|
1669
|
-
async transferProtocolIfSharesToRevenuePool(outMarketIndex, inMarketIndex, amount) {
|
|
1670
|
-
const transferProtocolIfSharesToRevenuePoolIx = await this.getTransferProtocolIfSharesToRevenuePoolIx(outMarketIndex, inMarketIndex, amount);
|
|
1671
|
-
const tx = await this.buildTransaction(transferProtocolIfSharesToRevenuePoolIx);
|
|
1672
|
-
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1673
|
-
return txSig;
|
|
1674
|
-
}
|
|
1675
|
-
async getTransferProtocolIfSharesToRevenuePoolIx(outMarketIndex, inMarketIndex, amount) {
|
|
1676
|
-
const remainingAccounts = await this.getRemainingAccounts({
|
|
1677
|
-
userAccounts: [],
|
|
1678
|
-
writableSpotMarketIndexes: [outMarketIndex],
|
|
1679
|
-
});
|
|
1680
|
-
return await this.program.instruction.transferProtocolIfSharesToRevenuePool(outMarketIndex, amount, {
|
|
1681
|
-
accounts: {
|
|
1682
|
-
authority: this.wallet.publicKey,
|
|
1683
|
-
state: await this.getStatePublicKey(),
|
|
1684
|
-
insuranceFundVault: await (0, pda_1.getInsuranceFundVaultPublicKey)(this.program.programId, outMarketIndex),
|
|
1685
|
-
spotMarketVault: await (0, pda_1.getSpotMarketVaultPublicKey)(this.program.programId, outMarketIndex),
|
|
1686
|
-
ifRebalanceConfig: await (0, pda_1.getIfRebalanceConfigPublicKey)(this.program.programId, inMarketIndex, outMarketIndex),
|
|
1687
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
1688
|
-
driftSigner: this.getStateAccount().signer,
|
|
1689
|
-
},
|
|
1690
|
-
remainingAccounts,
|
|
1691
|
-
});
|
|
1692
|
-
}
|
|
1693
1669
|
async initializePrelaunchOracle(perpMarketIndex, price, maxPrice) {
|
|
1694
1670
|
const initializePrelaunchOracleIx = await this.getInitializePrelaunchOracleIx(perpMarketIndex, price, maxPrice);
|
|
1695
1671
|
const tx = await this.buildTransaction(initializePrelaunchOracleIx);
|
|
@@ -1808,9 +1784,9 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
1808
1784
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
1809
1785
|
return await this.program.instruction.updatePerpMarketTakerSpeedBumpOverride(takerSpeedBumpOverride, {
|
|
1810
1786
|
accounts: {
|
|
1811
|
-
admin: this.
|
|
1812
|
-
? this.
|
|
1813
|
-
: this.
|
|
1787
|
+
admin: this.isSubscribed
|
|
1788
|
+
? this.getStateAccount().admin
|
|
1789
|
+
: this.wallet.publicKey,
|
|
1814
1790
|
state: await this.getStatePublicKey(),
|
|
1815
1791
|
perpMarket: perpMarketPublicKey,
|
|
1816
1792
|
},
|
|
@@ -1826,9 +1802,9 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
1826
1802
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
1827
1803
|
return await this.program.instruction.updatePerpMarketAmmSpreadAdjustment(ammSpreadAdjustment, {
|
|
1828
1804
|
accounts: {
|
|
1829
|
-
admin: this.
|
|
1830
|
-
? this.
|
|
1831
|
-
: this.
|
|
1805
|
+
admin: this.isSubscribed
|
|
1806
|
+
? this.getStateAccount().admin
|
|
1807
|
+
: this.wallet.publicKey,
|
|
1832
1808
|
state: await this.getStatePublicKey(),
|
|
1833
1809
|
perpMarket: perpMarketPublicKey,
|
|
1834
1810
|
},
|
|
@@ -1852,25 +1828,6 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
1852
1828
|
},
|
|
1853
1829
|
});
|
|
1854
1830
|
}
|
|
1855
|
-
async initializeIfRebalanceConfig(params) {
|
|
1856
|
-
const initializeIfRebalanceConfigIx = await this.getInitializeIfRebalanceConfigIx(params);
|
|
1857
|
-
const tx = await this.buildTransaction(initializeIfRebalanceConfigIx);
|
|
1858
|
-
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1859
|
-
return txSig;
|
|
1860
|
-
}
|
|
1861
|
-
async getInitializeIfRebalanceConfigIx(params) {
|
|
1862
|
-
return await this.program.instruction.initializeIfRebalanceConfig(params, {
|
|
1863
|
-
accounts: {
|
|
1864
|
-
admin: this.isSubscribed
|
|
1865
|
-
? this.getStateAccount().admin
|
|
1866
|
-
: this.wallet.publicKey,
|
|
1867
|
-
state: await this.getStatePublicKey(),
|
|
1868
|
-
ifRebalanceConfig: await (0, pda_1.getIfRebalanceConfigPublicKey)(this.program.programId, params.inMarketIndex, params.outMarketIndex),
|
|
1869
|
-
rent: web3_js_1.SYSVAR_RENT_PUBKEY,
|
|
1870
|
-
systemProgram: anchor.web3.SystemProgram.programId,
|
|
1871
|
-
},
|
|
1872
|
-
});
|
|
1873
|
-
}
|
|
1874
1831
|
async initUserFuel(user, authority, fuelBonusDeposits, fuelBonusBorrows, fuelBonusTaker, fuelBonusMaker, fuelBonusInsurance) {
|
|
1875
1832
|
const updatePerpMarketFuelIx = await this.getInitUserFuelIx(user, authority, fuelBonusDeposits, fuelBonusBorrows, fuelBonusTaker, fuelBonusMaker, fuelBonusInsurance);
|
|
1876
1833
|
const tx = await this.buildTransaction(updatePerpMarketFuelIx);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
|
-
import { BN } from '
|
|
2
|
+
import { BN } from '../';
|
|
3
3
|
export declare const ZERO: BN;
|
|
4
4
|
export declare const ONE: BN;
|
|
5
5
|
export declare const TWO: BN;
|
|
@@ -70,4 +70,3 @@ export declare const DUST_POSITION_SIZE: BN;
|
|
|
70
70
|
export declare const FUEL_WINDOW: BN;
|
|
71
71
|
export declare const FUEL_START_TS: BN;
|
|
72
72
|
export declare const MAX_PREDICTION_PRICE: BN;
|
|
73
|
-
export declare const GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = 99;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MARGIN_PRECISION = exports.AMM_TIMES_PEG_TO_QUOTE_PRECISION_RATIO = exports.PRICE_TO_QUOTE_PRECISION = exports.PRICE_DIV_PEG = exports.AMM_TO_QUOTE_PRECISION_RATIO = exports.BASE_PRECISION_EXP = exports.BASE_PRECISION = exports.AMM_RESERVE_PRECISION = exports.PEG_PRECISION = exports.FUNDING_RATE_BUFFER_PRECISION = exports.FUNDING_RATE_PRECISION = exports.PRICE_PRECISION = exports.QUOTE_PRECISION = exports.LIQUIDATION_FEE_PRECISION = exports.SPOT_MARKET_IMF_PRECISION = exports.SPOT_MARKET_IMF_PRECISION_EXP = exports.SPOT_MARKET_BALANCE_PRECISION = exports.SPOT_MARKET_BALANCE_PRECISION_EXP = exports.SPOT_MARKET_WEIGHT_PRECISION = exports.SPOT_MARKET_UTILIZATION_PRECISION = exports.SPOT_MARKET_UTILIZATION_PRECISION_EXP = exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION = exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION_EXP = exports.SPOT_MARKET_RATE_PRECISION = exports.SPOT_MARKET_RATE_PRECISION_EXP = exports.AMM_RESERVE_PRECISION_EXP = exports.PEG_PRECISION_EXP = exports.FUNDING_RATE_PRECISION_EXP = exports.PRICE_PRECISION_EXP = exports.FUNDING_RATE_BUFFER_PRECISION_EXP = exports.QUOTE_PRECISION_EXP = exports.CONCENTRATION_PRECISION = exports.PERCENTAGE_PRECISION = exports.PERCENTAGE_PRECISION_EXP = exports.MAX_LEVERAGE_ORDER_SIZE = exports.MAX_LEVERAGE = exports.TEN_MILLION = exports.BN_MAX = exports.TEN_THOUSAND = exports.TEN = exports.NINE = exports.EIGHT = exports.SEVEN = exports.SIX = exports.FIVE = exports.FOUR = exports.THREE = exports.TWO = exports.ONE = exports.ZERO = void 0;
|
|
4
|
-
exports.
|
|
4
|
+
exports.MAX_PREDICTION_PRICE = exports.FUEL_START_TS = exports.FUEL_WINDOW = exports.DUST_POSITION_SIZE = exports.SLOT_TIME_ESTIMATE_MS = exports.IDLE_TIME_SLOTS = exports.ACCOUNT_AGE_DELETION_CUTOFF_SECONDS = exports.DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT = exports.OPEN_ORDER_MARGIN_REQUIREMENT = exports.LAMPORTS_EXP = exports.LAMPORTS_PRECISION = exports.GOV_SPOT_MARKET_INDEX = exports.QUOTE_SPOT_MARKET_INDEX = exports.ONE_YEAR = exports.ONE_HOUR = exports.FIVE_MINUTE = exports.PRICE_TIMES_AMM_TO_QUOTE_PRECISION_RATIO = exports.FUNDING_RATE_OFFSET_DENOMINATOR = exports.LIQUIDATION_PCT_PRECISION = exports.BID_ASK_SPREAD_PRECISION = void 0;
|
|
5
5
|
const web3_js_1 = require("@solana/web3.js");
|
|
6
|
-
const
|
|
7
|
-
exports.ZERO = new
|
|
8
|
-
exports.ONE = new
|
|
9
|
-
exports.TWO = new
|
|
10
|
-
exports.THREE = new
|
|
11
|
-
exports.FOUR = new
|
|
12
|
-
exports.FIVE = new
|
|
13
|
-
exports.SIX = new
|
|
14
|
-
exports.SEVEN = new
|
|
15
|
-
exports.EIGHT = new
|
|
16
|
-
exports.NINE = new
|
|
17
|
-
exports.TEN = new
|
|
18
|
-
exports.TEN_THOUSAND = new
|
|
19
|
-
exports.BN_MAX = new
|
|
6
|
+
const __1 = require("../");
|
|
7
|
+
exports.ZERO = new __1.BN(0);
|
|
8
|
+
exports.ONE = new __1.BN(1);
|
|
9
|
+
exports.TWO = new __1.BN(2);
|
|
10
|
+
exports.THREE = new __1.BN(3);
|
|
11
|
+
exports.FOUR = new __1.BN(4);
|
|
12
|
+
exports.FIVE = new __1.BN(5);
|
|
13
|
+
exports.SIX = new __1.BN(6);
|
|
14
|
+
exports.SEVEN = new __1.BN(7);
|
|
15
|
+
exports.EIGHT = new __1.BN(8);
|
|
16
|
+
exports.NINE = new __1.BN(9);
|
|
17
|
+
exports.TEN = new __1.BN(10);
|
|
18
|
+
exports.TEN_THOUSAND = new __1.BN(10000);
|
|
19
|
+
exports.BN_MAX = new __1.BN(Number.MAX_SAFE_INTEGER);
|
|
20
20
|
exports.TEN_MILLION = exports.TEN_THOUSAND.mul(exports.TEN_THOUSAND);
|
|
21
|
-
exports.MAX_LEVERAGE = new
|
|
22
|
-
exports.MAX_LEVERAGE_ORDER_SIZE = new
|
|
23
|
-
exports.PERCENTAGE_PRECISION_EXP = new
|
|
24
|
-
exports.PERCENTAGE_PRECISION = new
|
|
21
|
+
exports.MAX_LEVERAGE = new __1.BN(5);
|
|
22
|
+
exports.MAX_LEVERAGE_ORDER_SIZE = new __1.BN('18446744073709551615');
|
|
23
|
+
exports.PERCENTAGE_PRECISION_EXP = new __1.BN(6);
|
|
24
|
+
exports.PERCENTAGE_PRECISION = new __1.BN(10).pow(exports.PERCENTAGE_PRECISION_EXP);
|
|
25
25
|
exports.CONCENTRATION_PRECISION = exports.PERCENTAGE_PRECISION;
|
|
26
|
-
exports.QUOTE_PRECISION_EXP = new
|
|
27
|
-
exports.FUNDING_RATE_BUFFER_PRECISION_EXP = new
|
|
28
|
-
exports.PRICE_PRECISION_EXP = new
|
|
26
|
+
exports.QUOTE_PRECISION_EXP = new __1.BN(6);
|
|
27
|
+
exports.FUNDING_RATE_BUFFER_PRECISION_EXP = new __1.BN(3);
|
|
28
|
+
exports.PRICE_PRECISION_EXP = new __1.BN(6);
|
|
29
29
|
exports.FUNDING_RATE_PRECISION_EXP = exports.PRICE_PRECISION_EXP.add(exports.FUNDING_RATE_BUFFER_PRECISION_EXP);
|
|
30
|
-
exports.PEG_PRECISION_EXP = new
|
|
31
|
-
exports.AMM_RESERVE_PRECISION_EXP = new
|
|
32
|
-
exports.SPOT_MARKET_RATE_PRECISION_EXP = new
|
|
33
|
-
exports.SPOT_MARKET_RATE_PRECISION = new
|
|
34
|
-
exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION_EXP = new
|
|
35
|
-
exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION = new
|
|
36
|
-
exports.SPOT_MARKET_UTILIZATION_PRECISION_EXP = new
|
|
37
|
-
exports.SPOT_MARKET_UTILIZATION_PRECISION = new
|
|
38
|
-
exports.SPOT_MARKET_WEIGHT_PRECISION = new
|
|
39
|
-
exports.SPOT_MARKET_BALANCE_PRECISION_EXP = new
|
|
40
|
-
exports.SPOT_MARKET_BALANCE_PRECISION = new
|
|
41
|
-
exports.SPOT_MARKET_IMF_PRECISION_EXP = new
|
|
42
|
-
exports.SPOT_MARKET_IMF_PRECISION = new
|
|
43
|
-
exports.LIQUIDATION_FEE_PRECISION = new
|
|
44
|
-
exports.QUOTE_PRECISION = new
|
|
45
|
-
exports.PRICE_PRECISION = new
|
|
46
|
-
exports.FUNDING_RATE_PRECISION = new
|
|
47
|
-
exports.FUNDING_RATE_BUFFER_PRECISION = new
|
|
48
|
-
exports.PEG_PRECISION = new
|
|
49
|
-
exports.AMM_RESERVE_PRECISION = new
|
|
30
|
+
exports.PEG_PRECISION_EXP = new __1.BN(6);
|
|
31
|
+
exports.AMM_RESERVE_PRECISION_EXP = new __1.BN(9);
|
|
32
|
+
exports.SPOT_MARKET_RATE_PRECISION_EXP = new __1.BN(6);
|
|
33
|
+
exports.SPOT_MARKET_RATE_PRECISION = new __1.BN(10).pow(exports.SPOT_MARKET_RATE_PRECISION_EXP);
|
|
34
|
+
exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION_EXP = new __1.BN(10);
|
|
35
|
+
exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION = new __1.BN(10).pow(exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION_EXP);
|
|
36
|
+
exports.SPOT_MARKET_UTILIZATION_PRECISION_EXP = new __1.BN(6);
|
|
37
|
+
exports.SPOT_MARKET_UTILIZATION_PRECISION = new __1.BN(10).pow(exports.SPOT_MARKET_UTILIZATION_PRECISION_EXP);
|
|
38
|
+
exports.SPOT_MARKET_WEIGHT_PRECISION = new __1.BN(10000);
|
|
39
|
+
exports.SPOT_MARKET_BALANCE_PRECISION_EXP = new __1.BN(9);
|
|
40
|
+
exports.SPOT_MARKET_BALANCE_PRECISION = new __1.BN(10).pow(exports.SPOT_MARKET_BALANCE_PRECISION_EXP);
|
|
41
|
+
exports.SPOT_MARKET_IMF_PRECISION_EXP = new __1.BN(6);
|
|
42
|
+
exports.SPOT_MARKET_IMF_PRECISION = new __1.BN(10).pow(exports.SPOT_MARKET_IMF_PRECISION_EXP);
|
|
43
|
+
exports.LIQUIDATION_FEE_PRECISION = new __1.BN(1000000);
|
|
44
|
+
exports.QUOTE_PRECISION = new __1.BN(10).pow(exports.QUOTE_PRECISION_EXP);
|
|
45
|
+
exports.PRICE_PRECISION = new __1.BN(10).pow(exports.PRICE_PRECISION_EXP);
|
|
46
|
+
exports.FUNDING_RATE_PRECISION = new __1.BN(10).pow(exports.FUNDING_RATE_PRECISION_EXP);
|
|
47
|
+
exports.FUNDING_RATE_BUFFER_PRECISION = new __1.BN(10).pow(exports.FUNDING_RATE_BUFFER_PRECISION_EXP);
|
|
48
|
+
exports.PEG_PRECISION = new __1.BN(10).pow(exports.PEG_PRECISION_EXP);
|
|
49
|
+
exports.AMM_RESERVE_PRECISION = new __1.BN(10).pow(exports.AMM_RESERVE_PRECISION_EXP);
|
|
50
50
|
exports.BASE_PRECISION = exports.AMM_RESERVE_PRECISION;
|
|
51
51
|
exports.BASE_PRECISION_EXP = exports.AMM_RESERVE_PRECISION_EXP;
|
|
52
52
|
exports.AMM_TO_QUOTE_PRECISION_RATIO = exports.AMM_RESERVE_PRECISION.div(exports.QUOTE_PRECISION); // 10^3
|
|
@@ -54,24 +54,23 @@ exports.PRICE_DIV_PEG = exports.PRICE_PRECISION.div(exports.PEG_PRECISION); //10
|
|
|
54
54
|
exports.PRICE_TO_QUOTE_PRECISION = exports.PRICE_PRECISION.div(exports.QUOTE_PRECISION); // 10^1
|
|
55
55
|
exports.AMM_TIMES_PEG_TO_QUOTE_PRECISION_RATIO = exports.AMM_RESERVE_PRECISION.mul(exports.PEG_PRECISION).div(exports.QUOTE_PRECISION); // 10^9
|
|
56
56
|
exports.MARGIN_PRECISION = exports.TEN_THOUSAND;
|
|
57
|
-
exports.BID_ASK_SPREAD_PRECISION = new
|
|
57
|
+
exports.BID_ASK_SPREAD_PRECISION = new __1.BN(1000000); // 10^6
|
|
58
58
|
exports.LIQUIDATION_PCT_PRECISION = exports.TEN_THOUSAND;
|
|
59
|
-
exports.FUNDING_RATE_OFFSET_DENOMINATOR = new
|
|
59
|
+
exports.FUNDING_RATE_OFFSET_DENOMINATOR = new __1.BN(5000);
|
|
60
60
|
exports.PRICE_TIMES_AMM_TO_QUOTE_PRECISION_RATIO = exports.PRICE_PRECISION.mul(exports.AMM_TO_QUOTE_PRECISION_RATIO);
|
|
61
|
-
exports.FIVE_MINUTE = new
|
|
62
|
-
exports.ONE_HOUR = new
|
|
63
|
-
exports.ONE_YEAR = new
|
|
61
|
+
exports.FIVE_MINUTE = new __1.BN(60 * 5);
|
|
62
|
+
exports.ONE_HOUR = new __1.BN(60 * 60);
|
|
63
|
+
exports.ONE_YEAR = new __1.BN(31536000);
|
|
64
64
|
exports.QUOTE_SPOT_MARKET_INDEX = 0;
|
|
65
65
|
exports.GOV_SPOT_MARKET_INDEX = 15;
|
|
66
|
-
exports.LAMPORTS_PRECISION = new
|
|
67
|
-
exports.LAMPORTS_EXP = new
|
|
68
|
-
exports.OPEN_ORDER_MARGIN_REQUIREMENT = exports.QUOTE_PRECISION.div(new
|
|
69
|
-
exports.DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT = new
|
|
66
|
+
exports.LAMPORTS_PRECISION = new __1.BN(web3_js_1.LAMPORTS_PER_SOL);
|
|
67
|
+
exports.LAMPORTS_EXP = new __1.BN(Math.log10(web3_js_1.LAMPORTS_PER_SOL));
|
|
68
|
+
exports.OPEN_ORDER_MARGIN_REQUIREMENT = exports.QUOTE_PRECISION.div(new __1.BN(100));
|
|
69
|
+
exports.DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT = new __1.BN(-25).mul(exports.QUOTE_PRECISION);
|
|
70
70
|
exports.ACCOUNT_AGE_DELETION_CUTOFF_SECONDS = 60 * 60 * 24 * 13; // 13 days
|
|
71
71
|
exports.IDLE_TIME_SLOTS = 9000;
|
|
72
72
|
exports.SLOT_TIME_ESTIMATE_MS = 400;
|
|
73
73
|
exports.DUST_POSITION_SIZE = exports.QUOTE_PRECISION.divn(100); // Dust position is any position smaller than 1c
|
|
74
|
-
exports.FUEL_WINDOW = new
|
|
75
|
-
exports.FUEL_START_TS = new
|
|
74
|
+
exports.FUEL_WINDOW = new __1.BN(60 * 60 * 24 * 28); // 28 days
|
|
75
|
+
exports.FUEL_START_TS = new __1.BN(1723147200); // unix timestamp
|
|
76
76
|
exports.MAX_PREDICTION_PRICE = exports.PRICE_PRECISION;
|
|
77
|
-
exports.GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = 99;
|
|
@@ -795,16 +795,6 @@ export declare class DriftClient {
|
|
|
795
795
|
beginSwapIx: TransactionInstruction;
|
|
796
796
|
endSwapIx: TransactionInstruction;
|
|
797
797
|
}>;
|
|
798
|
-
getInsuranceFundSwapIx({ inMarketIndex, outMarketIndex, amountIn, inTokenAccount, outTokenAccount, }: {
|
|
799
|
-
inMarketIndex: number;
|
|
800
|
-
outMarketIndex: number;
|
|
801
|
-
amountIn: BN;
|
|
802
|
-
inTokenAccount: PublicKey;
|
|
803
|
-
outTokenAccount: PublicKey;
|
|
804
|
-
}): Promise<{
|
|
805
|
-
beginSwapIx: TransactionInstruction;
|
|
806
|
-
endSwapIx: TransactionInstruction;
|
|
807
|
-
}>;
|
|
808
798
|
liquidateBorrowForPerpPnl(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
809
799
|
getLiquidateBorrowForPerpPnlIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
|
|
810
800
|
liquidatePerpPnlForDeposit(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, assetMarketIndex: number, maxPnlTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
@@ -105,7 +105,7 @@ class DriftClient {
|
|
|
105
105
|
this.provider = new anchor_1.AnchorProvider(config.connection,
|
|
106
106
|
// @ts-ignore
|
|
107
107
|
config.wallet, this.opts);
|
|
108
|
-
this.program = new anchor_1.Program(drift_json_1.default, (_d = config.programID) !== null && _d !== void 0 ? _d : new web3_js_1.PublicKey(config_1.DRIFT_PROGRAM_ID), this.provider
|
|
108
|
+
this.program = new anchor_1.Program(drift_json_1.default, (_d = config.programID) !== null && _d !== void 0 ? _d : new web3_js_1.PublicKey(config_1.DRIFT_PROGRAM_ID), this.provider);
|
|
109
109
|
this.authority = (_e = config.authority) !== null && _e !== void 0 ? _e : this.wallet.publicKey;
|
|
110
110
|
this.activeSubAccountId = (_f = config.activeSubAccountId) !== null && _f !== void 0 ? _f : 0;
|
|
111
111
|
this.skipLoadUsers = (_g = config.skipLoadUsers) !== null && _g !== void 0 ? _g : false;
|
|
@@ -4101,46 +4101,6 @@ class DriftClient {
|
|
|
4101
4101
|
});
|
|
4102
4102
|
return { beginSwapIx, endSwapIx };
|
|
4103
4103
|
}
|
|
4104
|
-
async getInsuranceFundSwapIx({ inMarketIndex, outMarketIndex, amountIn, inTokenAccount, outTokenAccount, }) {
|
|
4105
|
-
const remainingAccounts = await this.getRemainingAccounts({
|
|
4106
|
-
userAccounts: [],
|
|
4107
|
-
writableSpotMarketIndexes: [inMarketIndex, outMarketIndex],
|
|
4108
|
-
});
|
|
4109
|
-
const inSpotMarket = this.getSpotMarketAccount(inMarketIndex);
|
|
4110
|
-
const outSpotMarket = this.getSpotMarketAccount(outMarketIndex);
|
|
4111
|
-
const ifRebalanceConfig = (0, pda_1.getIfRebalanceConfigPublicKey)(this.program.programId, inMarketIndex, outMarketIndex);
|
|
4112
|
-
const beginSwapIx = await this.program.instruction.beginInsuranceFundSwap(inMarketIndex, outMarketIndex, amountIn, {
|
|
4113
|
-
accounts: {
|
|
4114
|
-
state: await this.getStatePublicKey(),
|
|
4115
|
-
authority: this.wallet.publicKey,
|
|
4116
|
-
outInsuranceFundVault: outSpotMarket.insuranceFund.vault,
|
|
4117
|
-
inInsuranceFundVault: inSpotMarket.insuranceFund.vault,
|
|
4118
|
-
outTokenAccount,
|
|
4119
|
-
inTokenAccount,
|
|
4120
|
-
ifRebalanceConfig: ifRebalanceConfig,
|
|
4121
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
4122
|
-
driftSigner: this.getStateAccount().signer,
|
|
4123
|
-
instructions: anchor.web3.SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
4124
|
-
},
|
|
4125
|
-
remainingAccounts,
|
|
4126
|
-
});
|
|
4127
|
-
const endSwapIx = await this.program.instruction.endInsuranceFundSwap(inMarketIndex, outMarketIndex, {
|
|
4128
|
-
accounts: {
|
|
4129
|
-
state: await this.getStatePublicKey(),
|
|
4130
|
-
authority: this.wallet.publicKey,
|
|
4131
|
-
outInsuranceFundVault: outSpotMarket.insuranceFund.vault,
|
|
4132
|
-
inInsuranceFundVault: inSpotMarket.insuranceFund.vault,
|
|
4133
|
-
outTokenAccount,
|
|
4134
|
-
inTokenAccount,
|
|
4135
|
-
ifRebalanceConfig: ifRebalanceConfig,
|
|
4136
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
4137
|
-
driftSigner: this.getStateAccount().signer,
|
|
4138
|
-
instructions: anchor.web3.SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
4139
|
-
},
|
|
4140
|
-
remainingAccounts,
|
|
4141
|
-
});
|
|
4142
|
-
return { beginSwapIx, endSwapIx };
|
|
4143
|
-
}
|
|
4144
4104
|
async liquidateBorrowForPerpPnl(userAccountPublicKey, userAccount, perpMarketIndex, liabilityMarketIndex, maxLiabilityTransfer, limitPrice, txParams, liquidatorSubAccountId) {
|
|
4145
4105
|
const { txSig, slot } = await this.sendTransaction(await this.buildTransaction(await this.getLiquidateBorrowForPerpPnlIx(userAccountPublicKey, userAccount, perpMarketIndex, liabilityMarketIndex, maxLiabilityTransfer, limitPrice, liquidatorSubAccountId), txParams), [], this.opts);
|
|
4146
4106
|
this.perpMarketLastSlotCache.set(perpMarketIndex, slot);
|
|
@@ -4675,10 +4635,8 @@ class DriftClient {
|
|
|
4675
4635
|
* @returns : {takerFee: number, makerFee: number} Precision None
|
|
4676
4636
|
*/
|
|
4677
4637
|
getMarketFees(marketType, marketIndex, user, enteringHighLeverageMode) {
|
|
4678
|
-
var _a;
|
|
4679
4638
|
let feeTier;
|
|
4680
|
-
|
|
4681
|
-
if (user && !userHLM) {
|
|
4639
|
+
if (user) {
|
|
4682
4640
|
feeTier = user.getUserFeeTier(marketType);
|
|
4683
4641
|
}
|
|
4684
4642
|
else {
|
|
@@ -4698,7 +4656,7 @@ class DriftClient {
|
|
|
4698
4656
|
marketAccount = this.getSpotMarketAccount(marketIndex);
|
|
4699
4657
|
}
|
|
4700
4658
|
takerFee += (takerFee * marketAccount.feeAdjustment) / 100;
|
|
4701
|
-
if (
|
|
4659
|
+
if (user && (user.isHighLeverageMode() || enteringHighLeverageMode)) {
|
|
4702
4660
|
takerFee *= 2;
|
|
4703
4661
|
}
|
|
4704
4662
|
makerFee += (makerFee * marketAccount.feeAdjustment) / 100;
|
|
@@ -6,7 +6,6 @@ import { DriftEnv } from './config';
|
|
|
6
6
|
import { TxSender } from './tx/types';
|
|
7
7
|
import { TxHandler, TxHandlerConfig } from './tx/txHandler';
|
|
8
8
|
import { DelistedMarketSetting, GrpcConfigs } from './accounts/types';
|
|
9
|
-
import { Coder } from '@coral-xyz/anchor';
|
|
10
9
|
export type DriftClientConfig = {
|
|
11
10
|
connection: Connection;
|
|
12
11
|
wallet: IWallet;
|
|
@@ -35,7 +34,6 @@ export type DriftClientConfig = {
|
|
|
35
34
|
txHandlerConfig?: TxHandlerConfig;
|
|
36
35
|
delistedMarketSetting?: DelistedMarketSetting;
|
|
37
36
|
useHotWalletAdmin?: boolean;
|
|
38
|
-
coder?: Coder;
|
|
39
37
|
};
|
|
40
38
|
export type DriftClientSubscriptionConfig = {
|
|
41
39
|
type: 'grpc';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Commitment, PublicKey, TransactionSignature } from '@solana/web3.js';
|
|
3
|
-
import { DepositRecord, FundingPaymentRecord, FundingRateRecord, LiquidationRecord, NewUserRecord, OrderActionRecord, OrderRecord, SettlePnlRecord, LPRecord, InsuranceFundRecord, SpotInterestRecord, InsuranceFundStakeRecord, CurveRecord, SwapRecord, SpotMarketVaultDepositRecord, SignedMsgOrderRecord, DeleteUserRecord, FuelSweepRecord, FuelSeasonRecord
|
|
3
|
+
import { DepositRecord, FundingPaymentRecord, FundingRateRecord, LiquidationRecord, NewUserRecord, OrderActionRecord, OrderRecord, SettlePnlRecord, LPRecord, InsuranceFundRecord, SpotInterestRecord, InsuranceFundStakeRecord, CurveRecord, SwapRecord, SpotMarketVaultDepositRecord, SignedMsgOrderRecord, DeleteUserRecord, FuelSweepRecord, FuelSeasonRecord } from '../index';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
5
|
export type EventSubscriptionOptions = {
|
|
6
6
|
address?: PublicKey;
|
|
@@ -45,11 +45,9 @@ export type EventMap = {
|
|
|
45
45
|
DeleteUserRecord: Event<DeleteUserRecord>;
|
|
46
46
|
FuelSweepRecord: Event<FuelSweepRecord>;
|
|
47
47
|
FuelSeasonRecord: Event<FuelSeasonRecord>;
|
|
48
|
-
InsuranceFundSwapRecord: Event<InsuranceFundSwapRecord>;
|
|
49
|
-
TransferProtocolIfSharesToRevenuePoolRecord: Event<TransferProtocolIfSharesToRevenuePoolRecord>;
|
|
50
48
|
};
|
|
51
49
|
export type EventType = keyof EventMap;
|
|
52
|
-
export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord> | Event<SignedMsgOrderRecord> | Event<DeleteUserRecord> | Event<FuelSweepRecord> | Event<FuelSeasonRecord
|
|
50
|
+
export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord> | Event<SignedMsgOrderRecord> | Event<DeleteUserRecord> | Event<FuelSweepRecord> | Event<FuelSeasonRecord>;
|
|
53
51
|
export interface EventSubscriberEvents {
|
|
54
52
|
newEvent: (event: WrappedEvent<EventType>) => void;
|
|
55
53
|
}
|