@drift-labs/sdk

Index

Namespaces

Enumerations

Classes

AdminClient AssetTier AuctionSubscriber AverageOverSlotsStrategy AverageStrategy BN BasicUserAccountSubscriber BigNum BlockhashSubscriber BulkAccountLoader ChainClock ClockSubscriber ContractTier ContractType DLOB DLOBApiClient DLOBOrdersCoder DLOBSubscriber DepositDirection DepositExplanation DriftClient EventSubscriber EwmaStrategy FastSingleTxSender FloatingLimitOrderNode ForwardOnlyTxSender JupiterClient LPAction LiquidationType LogParser MarketOrderNode MarketStatus MarketType MaxOverSlotsStrategy MaxStrategy ModifyOrderPolicy NodeList NotSubscribedError OneShotUserAccountSubscriber OpenbookV2FulfillmentConfigMap OpenbookV2Subscriber OracleSource OrderAction OrderActionExplanation OrderNode OrderStatus OrderSubscriber OrderTriggerCondition OrderType PhoenixFulfillmentConfigMap PhoenixSubscriber PollingDriftClientAccountSubscriber PollingInsuranceFundStakeAccountSubscriber PollingLogProvider PollingOracleAccountSubscriber PollingTokenAccountSubscriber PollingUserAccountSubscriber PollingUserStatsAccountSubscriber PositionDirection PostOnlyParams PriorityFeeCalculator PriorityFeeSubscriber PriorityFeeSubscriberMap PublicKey PythClient RestingLimitOrderNode RetryTxSender SerumFulfillmentConfigMap SerumSubscriber SettlePnlExplanation SettlePnlMode SlotSubscriber SpotBalanceType SpotFulfillmentConfigStatus SpotFulfillmentStatus SpotFulfillmentType StakeAction StrictOraclePrice SwapDirection SwapReduceOnly TakingLimitOrderNode TestClient TokenFaucet TransactionConfirmationManager TriggerOrderNode TxEventCache TxHandler TxSendError User UserMap UserStats UserStatsMap Wallet WebSocketDriftClientAccountSubscriber WebSocketInsuranceFundStakeAccountSubscriber WebSocketLogProvider WhileValidTxSender

Interfaces

Type Aliases

AMM AccountToLoad AccountToPoll AssetType AuctionSubscriberConfig BSOL_EMISSIONS_API_RESPONSE BSOL_STATS_API_RESPONSE BaseTxParams BufferAndSlot CandleResolution ChainClickInitialisationProps ChainClockProgress ChainClockState ChainClockUpdateProps CurveRecord DLOBFilterFcn DLOBNodeMap DLOBNodeType DLOBOrder DLOBOrders DLOBSubscriptionConfig DataAndSlot DepositRecord DriftClientConfig DriftClientSubscriptionConfig DriftEnv DriftEvent DriftMarketInfo DriftPriorityFeeLevels DriftPriorityFeeResponse Event EventMap EventSubscriptionOptions EventSubscriptionOrderBy EventSubscriptionOrderDirection EventType EventsServerLogProviderConfig FeeStructure FeeTier FundingPaymentRecord FundingRateRecord HealthComponent HealthComponents HeliusPriorityFeeLevels HeliusPriorityFeeResponse HistoricalIndexData HistoricalOracleData InsuranceFundRecord InsuranceFundStake InsuranceFundStakeRecord JITO_SOL_METRICS_ENDPOINT_RESPONSE L2Level L2OrderBook L3Level L3OrderBook LPRecord LiquidateBorrowForPerpPnlRecord LiquidatePerpPnlForDepositRecord LiquidatePerpRecord LiquidateSpotRecord LiquidationRecord LogProviderConfig LogProviderType MSOL_METRICS_ENDPOINT_RESPONSE MakerInfo MappedRecord MarginCategory MarketNodeLists MarketTypeStr ModifyOrderParams NecessaryOrderParams NewUserRecord NodeToFill NodeToTrigger OpenbookV2FulfillmentConfigAccount OpenbookV2SubscriberConfig OptionalOrderParams OracleGuardRails OracleInfo OraclePriceData OraclesToPoll Order OrderActionRecord OrderFillSimulation OrderFillerRewardStructure OrderParams OrderRecord OrderSubscriberConfig PerpBankruptcyRecord PerpMarketAccount PerpMarketConfig PerpMarketExtendedInfo PerpPosition PhoenixMarketSubscriberConfig PhoenixV1FulfillmentConfigAccount PollingLogProviderConfig PoolBalance PrelaunchOracle PriceImpactUnit PriorityFeeSubscriberConfig PriorityFeeSubscriberMapConfig ProcessingTxParams ReferrerInfo ReferrerNameAccount ResubOpts SerumV3FulfillmentConfigAccount SettlePnlRecord SignedTxData SolanaPriorityFeeResponse SortDirection SortFn SpotBankruptcyRecord SpotInterestRecord SpotMarketAccount SpotMarketConfig SpotMarketVaultDepositRecord SpotPosition StateAccount StreamingLogProviderConfig SwapMode SwapRecord SwiftOrderParamsMessage SwiftServerMessage SwiftTriggerOrderParams TakerInfo TxBuildingProps TxHandlerConfig TxParams TxSigAndSlot UserAccount UserConfig UserStatsAccount UserStatsConfig UserStatsSubscriptionConfig UserSubscriptionConfig WebSocketLogProviderConfig WrappedEvent WrappedEvents logProviderCallback

Variables

ACCOUNT_AGE_DELETION_CUTOFF_SECONDS AMM_RESERVE_PRECISION AMM_RESERVE_PRECISION_EXP AMM_TIMES_PEG_TO_QUOTE_PRECISION_RATIO AMM_TO_QUOTE_PRECISION_RATIO ANCHOR_TEST_SWIFT_ID BASE_PRECISION BASE_PRECISION_EXP BID_ASK_SPREAD_PRECISION BN_MAX COMPUTE_UNITS_DEFAULT CONCENTRATION_PRECISION DEFAULT_CONFIRMATION_OPTS DEFAULT_MARKET_NAME DEFAULT_PRIORITY_FEE_MAP_FREQUENCY_MS DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT DEFAULT_TOP_OF_BOOK_QUOTE_AMOUNTS DEFAULT_USER_NAME DRIFT_ORACLE_RECEIVER_ID DRIFT_PROGRAM_ID DUST_POSITION_SIZE DefaultEventSubscriptionOptions DefaultOrderParams DevnetPerpMarkets DevnetSpotMarkets EIGHT FIVE FIVE_MINUTE FOUR FUEL_START_TS FUEL_WINDOW FUNDING_RATE_BUFFER_PRECISION FUNDING_RATE_BUFFER_PRECISION_EXP FUNDING_RATE_OFFSET_DENOMINATOR FUNDING_RATE_PRECISION FUNDING_RATE_PRECISION_EXP GOV_SPOT_MARKET_INDEX IDLE_TIME_SLOTS LAMPORTS_EXP LAMPORTS_PRECISION LIQUIDATION_FEE_PRECISION LIQUIDATION_PCT_PRECISION MARGIN_PRECISION MAX_LEVERAGE MAX_LEVERAGE_ORDER_SIZE MAX_NAME_LENGTH MAX_PREDICTION_PRICE MainnetPerpMarkets MainnetSpotMarkets NINE ONE ONE_HOUR ONE_YEAR OPEN_ORDER_MARGIN_REQUIREMENT PEG_PRECISION PEG_PRECISION_EXP PERCENTAGE_PRECISION PERCENTAGE_PRECISION_EXP PRICE_DIV_PEG PRICE_PRECISION PRICE_PRECISION_EXP PRICE_TO_QUOTE_PRECISION PerpMarkets QUOTE_PRECISION QUOTE_PRECISION_EXP QUOTE_SPOT_MARKET_INDEX SEVEN SIX SLOT_TIME_ESTIMATE_MS SPOT_MARKET_BALANCE_PRECISION SPOT_MARKET_BALANCE_PRECISION_EXP SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION_EXP SPOT_MARKET_IMF_PRECISION SPOT_MARKET_IMF_PRECISION_EXP SPOT_MARKET_RATE_PRECISION SPOT_MARKET_RATE_PRECISION_EXP SPOT_MARKET_UTILIZATION_PRECISION SPOT_MARKET_UTILIZATION_PRECISION_EXP SPOT_MARKET_WEIGHT_PRECISION SWIFT_ID SpotMarkets TEN TEN_MILLION TEN_THOUSAND THREE TWO WRAPPED_SOL_MINT ZERO configs

Functions

ammPaused bulkPollingUserStatsSubscribe bulkPollingUserSubscribe calculateAdjustKCost calculateAllEstimatedFundingRate calculateAmmReservesAfterSwap calculateAskPrice calculateAssetWeight calculateAvailablePerpLiquidity calculateBaseAssetAmountForAmmToFulfill calculateBaseAssetAmountToFillUpToLimitPrice calculateBaseAssetValue calculateBaseAssetValueWithOracle calculateBidAskPrice calculateBidPrice calculateBorrowRate calculateBreakEvenPrice calculateBudgetedK calculateBudgetedKBN calculateBudgetedPeg calculateClaimablePnl calculateCollateralDepositRequiredForTrade calculateCollateralValueOfDeposit calculateCostBasis calculateDepositRate calculateEffectiveLeverage calculateEntryPrice calculateEstimatedEntryPriceWithL2 calculateEstimatedPerpEntryPrice calculateEstimatedSpotEntryPrice calculateEstimatedSuperStakeLiquidationPrice calculateFundingPool calculateInitUserFee calculateInsuranceFuelBonus calculateInterestAccumulated calculateInterestRate calculateInventoryLiquidityRatio calculateInventoryScale calculateLiabilityWeight calculateLiquidationPrice calculateLiveOracleStd calculateLiveOracleTwap calculateLongShortFundingRate calculateLongShortFundingRateAndLiveTwaps calculateMarginUSDCRequiredForTrade calculateMarketAvailablePNL calculateMarketMarginRatio calculateMarketMaxAvailableInsurance calculateMarketOpenBidAsk calculateMaxBaseAssetAmountFillable calculateMaxBaseAssetAmountToTrade calculateMaxRemainingDeposit calculateMaxSpread calculateNetUserPnl calculateNetUserPnlImbalance calculateNewAmm calculateNewMarketAfterTrade calculateOptimalPegAndBudget calculateOraclePriceForPerpMargin calculateOracleReserveSpread calculateOracleSpread calculatePegFromTargetPrice calculatePerpFuelBonus calculatePerpLiabilityValue calculatePositionFundingPNL calculatePositionPNL calculatePrice calculateQuoteAssetAmountSwapped calculateReferencePriceOffset calculateRepegCost calculateReservePrice calculateScaledInitialAssetWeight calculateSizeDiscountAssetWeight calculateSizePremiumLiabilityWeight calculateSolEarned calculateSpotFuelBonus calculateSpotMarketBorrowCapacity calculateSpotMarketMarginRatio calculateSpread calculateSpreadBN calculateSpreadReserves calculateSwapOutput calculateTargetPriceTrade calculateTerminalPrice calculateTokenUtilizationLimits calculateTradeAcquiredAmounts calculateTradeSlippage calculateUnrealizedAssetWeight calculateUpdatedAMM calculateUpdatedAMMSpreadReserves calculateUtilization calculateVolSpreadBN calculateWeightedTokenValue calculateWithdrawLimit calculateWorstCaseBaseAssetAmount calculateWorstCasePerpLiabilityValue castNumberToSpotPrecision checkSameDate clampBN containsComputeUnitIxs convertPythPrice convertToNumber createL2Levels createNode decodeName decodeUser deriveOracleAuctionParams divCeil encodeName estimateTps exchangePaused fetchBSolDriftEmissions fetchBSolMetrics fetchDriftPriorityFee fetchHeliusPriorityFee fetchJitoSolMetrics fetchLogs fetchMSolMetrics fetchSolanaPriorityFee fetchTransactionLogs fetchUserAccounts fetchUserAccountsUsingKeys fetchUserStatsAccount fillPaused findAllMarketAndOracles findBestJitoSolSuperStakeIxs findBestLstSuperStakeIxs findBestMSolSuperStakeIxs findBestSuperStakeIxs findComputeUnitConsumption findDirectionToClose getAuctionPrice getAuctionPriceForFixedAuction getAuctionPriceForOracleOffsetAuction getBalance getConfig getDriftSignerPublicKey getDriftStateAccountPublicKey getDriftStateAccountPublicKeyAndNonce getInsuranceFundStakeAccountPublicKey getInsuranceFundVaultPublicKey getL2GeneratorFromDLOBNodes getLimitOrderParams getLimitPrice getMarinadeDepositIx getMarinadeFinanceProgram getMarinadeMSolPrice getMarketOrderParams getMarketsAndOraclesForSubscription getMaxConfidenceIntervalMultiplier getMaxNumberOfSubAccounts getNewOracleConfPct getNonIdleUserFilter getOpenbookV2FulfillmentConfigPublicKey getOracleClient getOrderParams getOrderSignature getPerpMarketPublicKey getPerpMarketPublicKeySync getPhoenixFulfillmentConfigPublicKey getPrelaunchOraclePublicKey getProtocolIfSharesTransferConfigPublicKey getPythPullOraclePublicKey getQuoteAssetReservePredictionMarketBounds getReferrerNamePublicKeySync getSerumFulfillmentConfigPublicKey getSerumOpenOrdersPublicKey getSerumSignerPublicKey getSignedTokenAmount getSpotMarketPublicKey getSpotMarketPublicKeySync getSpotMarketVaultPublicKey getStrictTokenValue getSwapDirection getTokenAmount getTokenProgramForSpotMarket getTokenValue getTriggerLimitOrderParams getTriggerMarketOrderParams getUser30dRollingVolumeEstimate getUserAccountPublicKey getUserAccountPublicKeyAndNonce getUserAccountPublicKeySync getUserFilter getUserStatsAccountPublicKey getUserThatHasBeenLP getUserWithAuctionFilter getUserWithName getUserWithOrderFilter getVammL2Generator getVammNodeGenerator getVariant getWorstCaseTokenAmounts groupL2 hasAuctionPrice hasLimitPrice hasOpenOrders initialize isAmmDrawdownPause isAuctionComplete isBNSafe isEmptyPosition isFallbackAvailableLiquiditySource isFillableByVAMM isLimitOrder isMarketOrder isOneOfVariant isOperationPaused isOracleTooDivergent isOracleValid isOrderExpired isOrderReduceOnly isOrderRiskIncreasing isOrderRiskIncreasingInSameDirection isRestingLimitOrder isSetComputeUnitPriceIx isSetComputeUnitsIx isSpotPositionAvailable isTakingOrder isTriggered isUserBankrupt isVariant loadKeypair mergeL2LevelGenerators mustBeTriggered nextRevenuePoolSettleApr numberToSafeBN oraclePriceBands parseLogs parseLogsWithRaw positionCurrentDirection positionIsAvailable promiseTimeout sigNum simulateOrderFill squareRootBN stakeAmountToShares standardizeBaseAssetAmount standardizePrice timeRemainingUntilUpdate trimVaaSignatures uncrossL2 unstakeSharesToAmount unstakeSharesToAmountWithOpenRequest

Generated using TypeDoc