@quartz-labs/sdk
Version:
SDK for interacting with the Quartz Protocol
39 lines • 2.07 kB
TypeScript
import { BN, type DriftClient, type MarginCategory, type UserAccount } from "@drift-labs/sdk";
import type { PublicKey } from "@solana/web3.js";
import type { AccountMeta } from "../interfaces/AccountMeta.interface.js";
import type { MarketIndex } from "../../config/tokens.js";
export declare class DriftUser {
private authority;
private driftClient;
private userAccount;
pubkey: PublicKey;
statsPubkey: PublicKey;
constructor(authority: PublicKey, driftClient: DriftClient, userAccount: UserAccount);
getDriftUserAccount(): UserAccount;
getRemainingAccounts(writeableIndices: MarketIndex[]): AccountMeta[];
getHealth(): number;
getTokenAmount(marketIndex: number, openOrderBalances?: Record<MarketIndex, BN>): BN;
getWithdrawalLimit(marketIndex: MarketIndex, reduceOnly?: boolean, openOrderBalances?: Record<MarketIndex, BN>): BN;
getFreeCollateral(marginCategory?: MarginCategory, strict?: boolean, openOrderBalances?: Record<MarketIndex, BN>): BN;
private canBypassWithdrawLimits;
private isBeingLiquidated;
getTotalCollateralValue(marginCategory?: MarginCategory, strict?: boolean, includeOpenOrders?: boolean, openOrderBalances?: Record<MarketIndex, BN>): BN;
getTotalSpotLiabilityValue(marginCategory?: MarginCategory, strict?: boolean, includeOpenOrders?: boolean, openOrderBalances?: Record<MarketIndex, BN>): BN;
private getSpotMarketAssetValue;
private getSpotMarketAssetAndLiabilityValue;
private getWorstCaseTokenAmounts;
private getSpotLiabilityValue;
private getSpotAssetValue;
private getUnrealizedPNL;
private getActivePerpPositions;
private getPerpPositionWithLPSettle;
private getPerpPosition;
private getEmptyPosition;
private getClonedPosition;
getInitialMarginRequirement(openOrderBalances?: Record<MarketIndex, BN>): BN;
private getMarginRequirement;
private getTotalPerpPositionLiability;
private calculateWeightedPerpPositionLiability;
private getSpotMarketLiabilityValue;
}
//# sourceMappingURL=DriftUser.class.d.ts.map