@@ -15,7 +15,6 @@ import { BN } from '@coral-xyz/anchor';
1515import { OraclePriceData } from '../oracles/types' ;
1616import { calculateMarketMarginRatio } from './market' ;
1717import { calculateScaledInitialAssetWeight } from './spotBalance' ;
18- import { DriftClient } from '../driftClient' ;
1918import { OneShotUserAccountSubscriber } from '../accounts/userAccount/oneShotUserAccountSubscriber' ;
2019import {
2120 PerpMarketAccount ,
@@ -27,6 +26,7 @@ import { PublicKey } from '@solana/web3.js';
2726import { User } from '../user' ;
2827import { isVariant } from '../types' ;
2928import { assert } from '../assert/assert' ;
29+ import { IDriftClient } from '../driftClient/types' ;
3030
3131export function calculateSizePremiumLiabilityWeight (
3232 size : BN , // AMM_RESERVE_PRECISION
@@ -216,7 +216,7 @@ export function calculatePerpLiabilityValue(
216216 * @returns
217217 */
218218export function calculateMarginUSDCRequiredForTrade (
219- driftClient : DriftClient ,
219+ driftClient : IDriftClient ,
220220 targetMarketIndex : number ,
221221 baseSize : BN ,
222222 userMaxMarginRatio ?: number ,
@@ -256,7 +256,7 @@ export function calculateMarginUSDCRequiredForTrade(
256256 * Returns collateral required in the precision of the target collateral market.
257257 */
258258export function calculateCollateralDepositRequiredForTrade (
259- driftClient : DriftClient ,
259+ driftClient : IDriftClient ,
260260 targetMarketIndex : number ,
261261 baseSize : BN ,
262262 collateralIndex : number ,
@@ -298,7 +298,7 @@ export function calculateCollateralDepositRequiredForTrade(
298298}
299299
300300export function calculateCollateralValueOfDeposit (
301- driftClient : DriftClient ,
301+ driftClient : IDriftClient ,
302302 collateralIndex : number ,
303303 baseSize : BN
304304) : BN {
@@ -345,7 +345,7 @@ export function calculateLiquidationPrice(
345345}
346346
347347export function calculateUserMaxPerpOrderSize (
348- driftClient : DriftClient ,
348+ driftClient : IDriftClient ,
349349 userAccountKey : PublicKey ,
350350 userAccount : UserAccount ,
351351 targetMarketIndex : number ,
0 commit comments