@drift-labs/sdk 0.2.0-master.3 → 0.2.0-master.30
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/README.md +13 -13
- 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/pollingClearingHouseAccountSubscriber.d.ts +16 -16
- package/lib/accounts/pollingClearingHouseAccountSubscriber.js +31 -28
- package/lib/accounts/pollingUserStatsAccountSubscriber.d.ts +27 -0
- package/lib/accounts/pollingUserStatsAccountSubscriber.js +113 -0
- package/lib/accounts/types.d.ts +22 -11
- package/lib/accounts/webSocketClearingHouseAccountSubscriber.d.ts +17 -17
- package/lib/accounts/webSocketClearingHouseAccountSubscriber.js +37 -35
- package/lib/accounts/webSocketUserStatsAccountSubsriber.d.ts +20 -0
- package/lib/accounts/webSocketUserStatsAccountSubsriber.js +47 -0
- package/lib/addresses/marketAddresses.d.ts +1 -3
- package/lib/addresses/pda.d.ts +10 -4
- package/lib/addresses/pda.js +51 -14
- package/lib/admin.d.ts +34 -22
- package/lib/admin.js +182 -73
- package/lib/clearingHouse.d.ts +120 -42
- package/lib/clearingHouse.js +1505 -254
- package/lib/clearingHouseConfig.d.ts +4 -4
- package/lib/clearingHouseUser.d.ts +50 -38
- package/lib/clearingHouseUser.js +410 -190
- 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.d.ts +7 -9
- package/lib/config.js +21 -21
- package/lib/constants/numericConstants.d.ts +18 -12
- package/lib/constants/numericConstants.js +28 -21
- package/lib/constants/perpMarkets.d.ts +18 -0
- package/lib/constants/{markets.js → perpMarkets.js} +7 -7
- package/lib/constants/spotMarkets.d.ts +19 -0
- package/lib/constants/spotMarkets.js +53 -0
- package/lib/dlob/DLOB.d.ts +73 -0
- package/lib/dlob/DLOB.js +553 -0
- package/lib/dlob/DLOBNode.d.ts +52 -0
- package/lib/dlob/DLOBNode.js +82 -0
- package/lib/dlob/NodeList.d.ts +26 -0
- package/lib/dlob/NodeList.js +138 -0
- package/lib/events/eventList.js +3 -0
- package/lib/events/eventSubscriber.d.ts +4 -2
- package/lib/events/eventSubscriber.js +16 -9
- package/lib/events/fetchLogs.d.ts +10 -1
- package/lib/events/fetchLogs.js +27 -7
- package/lib/events/pollingLogProvider.d.ts +2 -1
- package/lib/events/pollingLogProvider.js +6 -2
- package/lib/events/sort.js +8 -11
- package/lib/events/types.d.ts +7 -2
- package/lib/events/types.js +5 -0
- package/lib/examples/makeTradeExample.js +20 -8
- package/lib/factory/bigNum.d.ts +1 -0
- package/lib/factory/bigNum.js +34 -10
- package/lib/idl/clearing_house.json +4313 -1433
- package/lib/idl/{mock_usdc_faucet.json → token_faucet.json} +46 -23
- package/lib/index.d.ts +21 -6
- package/lib/index.js +25 -6
- package/lib/math/amm.d.ts +8 -5
- package/lib/math/amm.js +68 -46
- package/lib/math/auction.js +4 -1
- package/lib/math/conversion.js +1 -1
- package/lib/math/funding.d.ts +6 -6
- package/lib/math/funding.js +11 -10
- package/lib/math/insurance.d.ts +4 -0
- package/lib/math/insurance.js +27 -0
- package/lib/math/margin.d.ts +11 -0
- package/lib/math/margin.js +77 -0
- package/lib/math/market.d.ts +14 -9
- package/lib/math/market.js +69 -7
- package/lib/math/oracles.d.ts +4 -0
- package/lib/math/oracles.js +36 -8
- package/lib/math/orders.d.ts +6 -2
- package/lib/math/orders.js +78 -3
- package/lib/math/position.d.ts +21 -13
- package/lib/math/position.js +76 -36
- package/lib/math/repeg.js +14 -5
- package/lib/math/spotBalance.d.ts +22 -0
- package/lib/math/spotBalance.js +193 -0
- package/lib/math/spotMarket.d.ts +4 -0
- package/lib/math/spotMarket.js +8 -0
- package/lib/math/spotPosition.d.ts +6 -0
- package/lib/math/spotPosition.js +23 -0
- package/lib/math/trade.d.ts +10 -10
- package/lib/math/trade.js +22 -29
- package/lib/oracles/pythClient.js +1 -1
- package/lib/oracles/quoteAssetOracleClient.js +1 -1
- package/lib/oracles/switchboardClient.js +1 -1
- package/lib/orderParams.d.ts +14 -5
- package/lib/orderParams.js +12 -92
- package/lib/serum/serumSubscriber.d.ts +23 -0
- package/lib/serum/serumSubscriber.js +41 -0
- package/lib/serum/types.d.ts +11 -0
- package/lib/serum/types.js +2 -0
- 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.d.ts +1 -1
- package/lib/tx/retryTxSender.js +13 -4
- package/lib/tx/types.d.ts +1 -1
- package/lib/tx/utils.js +1 -1
- package/lib/types.d.ts +474 -123
- package/lib/types.js +99 -5
- package/lib/userMap/userMap.d.ts +25 -0
- package/lib/userMap/userMap.js +73 -0
- package/lib/userMap/userStatsMap.d.ts +19 -0
- package/lib/userMap/userStatsMap.js +68 -0
- 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 +9 -5
- package/src/accounts/bulkUserStatsSubscription.ts +33 -0
- package/src/accounts/bulkUserSubscription.ts +0 -1
- package/src/accounts/fetch.ts +27 -2
- package/src/accounts/pollingClearingHouseAccountSubscriber.ts +46 -42
- package/src/accounts/pollingUserStatsAccountSubscriber.ts +172 -0
- package/src/accounts/types.ts +31 -11
- package/src/accounts/webSocketClearingHouseAccountSubscriber.ts +64 -59
- package/src/accounts/webSocketUserStatsAccountSubsriber.ts +80 -0
- package/src/addresses/marketAddresses.ts +1 -2
- package/src/addresses/pda.ts +88 -14
- package/src/admin.ts +333 -128
- package/src/assert/assert.js +9 -0
- package/src/clearingHouse.ts +2464 -458
- package/src/clearingHouseConfig.ts +4 -3
- package/src/clearingHouseUser.ts +747 -291
- package/src/clearingHouseUserStats.ts +75 -0
- package/src/clearingHouseUserStatsConfig.ts +18 -0
- package/src/config.ts +30 -31
- package/src/constants/numericConstants.ts +41 -25
- package/src/constants/{markets.ts → perpMarkets.ts} +10 -10
- package/src/constants/spotMarkets.ts +72 -0
- package/src/dlob/DLOB.ts +868 -0
- package/src/dlob/DLOBNode.ts +162 -0
- package/src/dlob/NodeList.ts +185 -0
- package/src/events/eventList.js +77 -0
- package/src/events/eventList.ts +3 -0
- package/src/events/eventSubscriber.ts +20 -12
- package/src/events/fetchLogs.ts +35 -8
- package/src/events/pollingLogProvider.ts +10 -2
- package/src/events/sort.ts +11 -15
- package/src/events/types.ts +16 -1
- package/src/examples/makeTradeExample.js +157 -0
- package/src/examples/makeTradeExample.ts +32 -14
- package/src/factory/bigNum.ts +42 -13
- package/src/idl/clearing_house.json +4313 -1433
- package/src/idl/{mock_usdc_faucet.json → token_faucet.json} +46 -23
- package/src/index.ts +21 -6
- package/src/math/amm.ts +136 -66
- package/src/math/auction.ts +5 -1
- package/src/math/conversion.ts +2 -2
- package/src/math/funding.ts +20 -18
- package/src/math/insurance.ts +35 -0
- package/src/math/margin.ts +127 -0
- package/src/math/market.ts +138 -12
- package/src/math/oracles.ts +63 -9
- package/src/math/orders.ts +138 -4
- package/src/math/position.ts +119 -58
- package/src/math/repeg.ts +16 -6
- package/src/math/spotBalance.ts +316 -0
- package/src/math/spotMarket.ts +9 -0
- package/src/math/spotPosition.ts +47 -0
- package/src/math/trade.ts +43 -49
- package/src/oracles/pythClient.ts +2 -2
- package/src/oracles/quoteAssetOracleClient.ts +2 -2
- package/src/oracles/switchboardClient.ts +2 -2
- package/src/orderParams.ts +24 -137
- package/src/serum/serumSubscriber.ts +80 -0
- package/src/serum/types.ts +13 -0
- package/src/slot/SlotSubscriber.ts +11 -1
- package/src/token/index.js +38 -0
- package/src/{mockUSDCFaucet.ts → tokenFaucet.ts} +82 -70
- package/src/tx/retryTxSender.ts +16 -5
- package/src/tx/types.js +2 -0
- package/src/tx/types.ts +2 -1
- package/src/tx/utils.js +17 -0
- package/src/tx/utils.ts +1 -1
- package/src/types.ts +477 -125
- package/src/userMap/userMap.ts +100 -0
- package/src/userMap/userStatsMap.ts +110 -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/tests/bn/test.ts +12 -3
- package/tests/dlob/helpers.ts +374 -0
- package/tests/dlob/test.ts +2865 -0
- package/lib/constants/banks.d.ts +0 -16
- package/lib/constants/banks.js +0 -34
- package/lib/constants/markets.d.ts +0 -19
- package/lib/math/bankBalance.d.ts +0 -9
- package/lib/math/bankBalance.js +0 -75
- package/lib/math/state.d.ts +0 -8
- package/lib/math/state.js +0 -15
- package/lib/orders.d.ts +0 -8
- package/lib/orders.js +0 -134
- package/src/constants/banks.ts +0 -43
- package/src/math/bankBalance.ts +0 -112
- package/src/math/state.ts +0 -14
- package/src/math/utils.js +0 -27
- package/src/math/utils.js.map +0 -1
- package/src/orders.ts +0 -244
- package/src/util/computeUnits.js.map +0 -1
package/src/orders.ts
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isVariant,
|
|
3
|
-
MarketAccount,
|
|
4
|
-
Order,
|
|
5
|
-
PositionDirection,
|
|
6
|
-
UserAccount,
|
|
7
|
-
UserPosition,
|
|
8
|
-
} from './types';
|
|
9
|
-
import { BN, standardizeBaseAssetAmount } from '.';
|
|
10
|
-
import { calculateNewMarketAfterTrade } from './math/market';
|
|
11
|
-
import {
|
|
12
|
-
AMM_TO_QUOTE_PRECISION_RATIO,
|
|
13
|
-
PEG_PRECISION,
|
|
14
|
-
ZERO,
|
|
15
|
-
} from './constants/numericConstants';
|
|
16
|
-
import { calculateMaxBaseAssetAmountToTrade } from './math/amm';
|
|
17
|
-
import {
|
|
18
|
-
findDirectionToClose,
|
|
19
|
-
positionCurrentDirection,
|
|
20
|
-
} from './math/position';
|
|
21
|
-
import { OraclePriceData } from '.';
|
|
22
|
-
|
|
23
|
-
export function calculateNewStateAfterOrder(
|
|
24
|
-
userAccount: UserAccount,
|
|
25
|
-
userPosition: UserPosition,
|
|
26
|
-
market: MarketAccount,
|
|
27
|
-
order: Order
|
|
28
|
-
): [UserAccount, UserPosition, MarketAccount] | null {
|
|
29
|
-
if (isVariant(order.status, 'init')) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const baseAssetAmountToTrade = calculateBaseAssetAmountMarketCanExecute(
|
|
34
|
-
market,
|
|
35
|
-
order
|
|
36
|
-
);
|
|
37
|
-
if (baseAssetAmountToTrade.lt(market.amm.baseAssetAmountStepSize)) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const userAccountAfter = Object.assign({}, userAccount);
|
|
42
|
-
const userPositionAfter = Object.assign({}, userPosition);
|
|
43
|
-
|
|
44
|
-
const currentPositionDirection = positionCurrentDirection(userPosition);
|
|
45
|
-
const increasePosition =
|
|
46
|
-
userPosition.baseAssetAmount.eq(ZERO) ||
|
|
47
|
-
isSameDirection(order.direction, currentPositionDirection);
|
|
48
|
-
|
|
49
|
-
if (increasePosition) {
|
|
50
|
-
const marketAfter = calculateNewMarketAfterTrade(
|
|
51
|
-
baseAssetAmountToTrade,
|
|
52
|
-
order.direction,
|
|
53
|
-
market
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const { quoteAssetAmountSwapped, baseAssetAmountSwapped } =
|
|
57
|
-
calculateAmountSwapped(market, marketAfter);
|
|
58
|
-
|
|
59
|
-
userPositionAfter.baseAssetAmount = userPositionAfter.baseAssetAmount.add(
|
|
60
|
-
baseAssetAmountSwapped
|
|
61
|
-
);
|
|
62
|
-
userPositionAfter.quoteAssetAmount = userPositionAfter.quoteAssetAmount.add(
|
|
63
|
-
quoteAssetAmountSwapped
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
return [userAccountAfter, userPositionAfter, marketAfter];
|
|
67
|
-
} else {
|
|
68
|
-
const reversePosition = baseAssetAmountToTrade.gt(
|
|
69
|
-
userPosition.baseAssetAmount.abs()
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
if (reversePosition) {
|
|
73
|
-
const intermediateMarket = calculateNewMarketAfterTrade(
|
|
74
|
-
userPosition.baseAssetAmount,
|
|
75
|
-
findDirectionToClose(userPosition),
|
|
76
|
-
market
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const { quoteAssetAmountSwapped: baseAssetValue } =
|
|
80
|
-
calculateAmountSwapped(market, intermediateMarket);
|
|
81
|
-
|
|
82
|
-
let pnl;
|
|
83
|
-
if (isVariant(currentPositionDirection, 'long')) {
|
|
84
|
-
pnl = baseAssetValue.sub(userPosition.quoteAssetAmount);
|
|
85
|
-
} else {
|
|
86
|
-
pnl = userPosition.quoteAssetAmount.sub(baseAssetValue);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
userAccountAfter.collateral = userAccountAfter.collateral.add(pnl);
|
|
90
|
-
|
|
91
|
-
const baseAssetAmountLeft = baseAssetAmountToTrade.sub(
|
|
92
|
-
userPosition.baseAssetAmount.abs()
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const marketAfter = calculateNewMarketAfterTrade(
|
|
96
|
-
baseAssetAmountLeft,
|
|
97
|
-
order.direction,
|
|
98
|
-
intermediateMarket
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
const { quoteAssetAmountSwapped, baseAssetAmountSwapped } =
|
|
102
|
-
calculateAmountSwapped(intermediateMarket, marketAfter);
|
|
103
|
-
|
|
104
|
-
userPositionAfter.quoteAssetAmount = quoteAssetAmountSwapped;
|
|
105
|
-
userPositionAfter.baseAssetAmount = baseAssetAmountSwapped;
|
|
106
|
-
|
|
107
|
-
return [userAccountAfter, userPositionAfter, marketAfter];
|
|
108
|
-
} else {
|
|
109
|
-
const marketAfter = calculateNewMarketAfterTrade(
|
|
110
|
-
baseAssetAmountToTrade,
|
|
111
|
-
order.direction,
|
|
112
|
-
market
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
const {
|
|
116
|
-
quoteAssetAmountSwapped: baseAssetValue,
|
|
117
|
-
baseAssetAmountSwapped,
|
|
118
|
-
} = calculateAmountSwapped(market, marketAfter);
|
|
119
|
-
|
|
120
|
-
const costBasisRealized = userPosition.quoteAssetAmount
|
|
121
|
-
.mul(baseAssetAmountSwapped.abs())
|
|
122
|
-
.div(userPosition.baseAssetAmount.abs());
|
|
123
|
-
|
|
124
|
-
let pnl;
|
|
125
|
-
if (isVariant(currentPositionDirection, 'long')) {
|
|
126
|
-
pnl = baseAssetValue.sub(costBasisRealized);
|
|
127
|
-
} else {
|
|
128
|
-
pnl = costBasisRealized.sub(baseAssetValue);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
userAccountAfter.collateral = userAccountAfter.collateral.add(pnl);
|
|
132
|
-
|
|
133
|
-
userPositionAfter.baseAssetAmount = userPositionAfter.baseAssetAmount.add(
|
|
134
|
-
baseAssetAmountSwapped
|
|
135
|
-
);
|
|
136
|
-
userPositionAfter.quoteAssetAmount =
|
|
137
|
-
userPositionAfter.quoteAssetAmount.sub(costBasisRealized);
|
|
138
|
-
|
|
139
|
-
return [userAccountAfter, userPositionAfter, marketAfter];
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function calculateAmountSwapped(
|
|
145
|
-
marketBefore: MarketAccount,
|
|
146
|
-
marketAfter: MarketAccount
|
|
147
|
-
): { quoteAssetAmountSwapped: BN; baseAssetAmountSwapped: BN } {
|
|
148
|
-
return {
|
|
149
|
-
quoteAssetAmountSwapped: marketBefore.amm.quoteAssetReserve
|
|
150
|
-
.sub(marketAfter.amm.quoteAssetReserve)
|
|
151
|
-
.abs()
|
|
152
|
-
.mul(marketBefore.amm.pegMultiplier)
|
|
153
|
-
.div(PEG_PRECISION)
|
|
154
|
-
.div(AMM_TO_QUOTE_PRECISION_RATIO),
|
|
155
|
-
baseAssetAmountSwapped: marketBefore.amm.baseAssetReserve.sub(
|
|
156
|
-
marketAfter.amm.baseAssetReserve
|
|
157
|
-
),
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export function calculateBaseAssetAmountMarketCanExecute(
|
|
162
|
-
market: MarketAccount,
|
|
163
|
-
order: Order,
|
|
164
|
-
oraclePriceData?: OraclePriceData
|
|
165
|
-
): BN {
|
|
166
|
-
if (isVariant(order.orderType, 'limit')) {
|
|
167
|
-
return calculateAmountToTradeForLimit(market, order, oraclePriceData);
|
|
168
|
-
} else if (isVariant(order.orderType, 'triggerLimit')) {
|
|
169
|
-
return calculateAmountToTradeForTriggerLimit(market, order);
|
|
170
|
-
} else if (isVariant(order.orderType, 'market')) {
|
|
171
|
-
return ZERO;
|
|
172
|
-
} else {
|
|
173
|
-
return calculateAmountToTradeForTriggerMarket(market, order);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function calculateAmountToTradeForLimit(
|
|
178
|
-
market: MarketAccount,
|
|
179
|
-
order: Order,
|
|
180
|
-
oraclePriceData?: OraclePriceData
|
|
181
|
-
): BN {
|
|
182
|
-
let limitPrice = order.price;
|
|
183
|
-
if (!order.oraclePriceOffset.eq(ZERO)) {
|
|
184
|
-
if (!oraclePriceData) {
|
|
185
|
-
throw Error(
|
|
186
|
-
'Cant calculate limit price for oracle offset oracle without OraclePriceData'
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
limitPrice = oraclePriceData.price.add(order.oraclePriceOffset);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const [maxAmountToTrade, direction] = calculateMaxBaseAssetAmountToTrade(
|
|
193
|
-
market.amm,
|
|
194
|
-
limitPrice,
|
|
195
|
-
order.direction
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
const baseAssetAmount = standardizeBaseAssetAmount(
|
|
199
|
-
maxAmountToTrade,
|
|
200
|
-
market.amm.baseAssetAmountStepSize
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
// Check that directions are the same
|
|
204
|
-
const sameDirection = isSameDirection(direction, order.direction);
|
|
205
|
-
if (!sameDirection) {
|
|
206
|
-
return ZERO;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return baseAssetAmount.gt(order.baseAssetAmount)
|
|
210
|
-
? order.baseAssetAmount
|
|
211
|
-
: baseAssetAmount;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export function calculateAmountToTradeForTriggerLimit(
|
|
215
|
-
market: MarketAccount,
|
|
216
|
-
order: Order
|
|
217
|
-
): BN {
|
|
218
|
-
if (!order.triggered) {
|
|
219
|
-
return ZERO;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return calculateAmountToTradeForLimit(market, order);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function isSameDirection(
|
|
226
|
-
firstDirection: PositionDirection,
|
|
227
|
-
secondDirection: PositionDirection
|
|
228
|
-
): boolean {
|
|
229
|
-
return (
|
|
230
|
-
(isVariant(firstDirection, 'long') && isVariant(secondDirection, 'long')) ||
|
|
231
|
-
(isVariant(firstDirection, 'short') && isVariant(secondDirection, 'short'))
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function calculateAmountToTradeForTriggerMarket(
|
|
236
|
-
market: MarketAccount,
|
|
237
|
-
order: Order
|
|
238
|
-
): BN {
|
|
239
|
-
if (!order.triggered) {
|
|
240
|
-
return ZERO;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
return order.baseAssetAmount;
|
|
244
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"computeUnits.js","sourceRoot":"","sources":["computeUnits.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,0BAA0B,CAC/C,SAAoB,EACpB,UAAsB,EACtB,WAAmB,EACnB,aAAuB,WAAW;IAElC,MAAM,EAAE,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IACxE,MAAM,YAAY,GAAG,EAAE,CAAC;IACxB,MAAM,KAAK,GAAG,IAAI,MAAM,CACvB,WAAW,SAAS,CAAC,QAAQ,EAAE,gDAAgD,CAC/E,CAAC;IACF,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;YACtB,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5B;IACF,CAAC,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACrB,CAAC;AAlBD,gEAkBC"}
|