@symmio/trading-core 0.2.0 → 1.0.1

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.
Files changed (37) hide show
  1. package/README.md +2 -2
  2. package/dist/core/config/create-config.d.ts +47 -4
  3. package/dist/core/config/create-config.d.ts.map +1 -1
  4. package/dist/core/config/create-config.js +25 -22
  5. package/dist/core/config/create-config.js.map +1 -1
  6. package/dist/index.d.ts +3 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +142 -138
  9. package/dist/solvers/estimated-price/get-estimated-price.d.ts +58 -0
  10. package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -0
  11. package/dist/solvers/estimated-price/get-estimated-price.js +30 -0
  12. package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -0
  13. package/dist/solvers/estimated-price/index.d.ts +5 -0
  14. package/dist/solvers/estimated-price/index.d.ts.map +1 -0
  15. package/dist/solvers/estimated-price/price-impact.d.ts +25 -0
  16. package/dist/solvers/estimated-price/price-impact.d.ts.map +1 -0
  17. package/dist/solvers/estimated-price/price-impact.js +9 -0
  18. package/dist/solvers/estimated-price/price-impact.js.map +1 -0
  19. package/dist/solvers/estimated-price/query.d.ts +26 -0
  20. package/dist/solvers/estimated-price/query.d.ts.map +1 -0
  21. package/dist/solvers/estimated-price/query.js +28 -0
  22. package/dist/solvers/estimated-price/query.js.map +1 -0
  23. package/dist/solvers/estimated-price/to-estimated-price.d.ts +9 -0
  24. package/dist/solvers/estimated-price/to-estimated-price.d.ts.map +1 -0
  25. package/dist/solvers/estimated-price/to-estimated-price.js +8 -0
  26. package/dist/solvers/estimated-price/to-estimated-price.js.map +1 -0
  27. package/dist/solvers/instant-open/shared/trade-math.d.ts +48 -0
  28. package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
  29. package/dist/solvers/instant-open/shared/trade-math.js +5 -1
  30. package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
  31. package/dist/solvers/types/generated/enigma-solver.js +11 -5
  32. package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
  33. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.d.ts +1 -1
  34. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.js.map +1 -1
  35. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.d.ts +1 -1
  36. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.js.map +1 -1
  37. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -135,141 +135,145 @@ import { searchNotifications as on } from "./notifications/search/search-notific
135
135
  import { searchNotificationsQueryKey as sn, searchNotificationsQueryOptions as cn } from "./notifications/search/query.js";
136
136
  import { getMarkets as ln } from "./solvers/markets/get-markets.js";
137
137
  import { getMarketsQueryKey as un, getMarketsQueryOptions as dn } from "./solvers/markets/query.js";
138
- import { toMarketFundingInfo as fn } from "./solvers/funding-info/to-funding-info.js";
139
- import { getFundingInfo as pn } from "./solvers/funding-info/get-funding-info.js";
140
- import { projectFundingRate as mn } from "./solvers/funding-info/project-funding-rate.js";
141
- import { getFundingInfoQueryKey as hn, getFundingInfoQueryOptions as gn } from "./solvers/funding-info/query.js";
142
- import { toMarketInfo as _n } from "./solvers/market-info/to-market-info.js";
143
- import { getMarketInfo as vn } from "./solvers/market-info/get-market-info.js";
144
- import { getMarketInfoQueryKey as yn, getMarketInfoQueryOptions as bn } from "./solvers/market-info/query.js";
145
- import { getLockedParams as xn } from "./solvers/locked-params/get-locked-params.js";
146
- import { getLockedParamsQueryKey as Sn, getLockedParamsQueryOptions as Cn } from "./solvers/locked-params/query.js";
147
- import { checkNotionalCap as wn } from "./solvers/notional-cap/check-notional-cap.js";
148
- import { toMarketNotionalCap as Tn } from "./solvers/notional-cap/to-market-notional-cap.js";
149
- import { getNotionalCapAll as En } from "./solvers/notional-cap/get-notional-cap-all.js";
150
- import { getNotionalCapBySymbolId as Dn } from "./solvers/notional-cap/get-notional-cap-by-symbol-id.js";
151
- import { getOpenInterestBySymbolId as On } from "./solvers/notional-cap/get-open-interest-by-symbol-id.js";
152
- import { getNotionalCapBySymbolIdQueryKey as kn, getNotionalCapBySymbolIdQueryOptions as An } from "./solvers/notional-cap/query.js";
153
- import { getNotionalCapAllQueryKey as jn, getNotionalCapAllQueryOptions as Mn } from "./solvers/notional-cap/query-all.js";
154
- import { getOpenInterestBySymbolIdQueryKey as Nn, getOpenInterestBySymbolIdQueryOptions as Pn } from "./solvers/notional-cap/query-open-interest.js";
155
- import { getSolverErrorCodes as Fn } from "./solvers/error-codes/get-solver-error-codes.js";
156
- import { getSolverErrorCodesQueryKey as In, getSolverErrorCodesQueryOptions as Ln } from "./solvers/error-codes/query.js";
157
- import { MUON_APP as Rn, MUON_METHOD_PARTY_A_OVERVIEW as zn, MUON_METHOD_PRICE as Bn, MUON_METHOD_PRICE_RANGE as Vn, MUON_METHOD_SETTLE_UPNL as Hn, MUON_METHOD_UPNL_A as Un, MUON_METHOD_UPNL_A_WITH_SYMBOL_PRICE as Wn, MUON_METHOD_UPNL_B as Gn, MUON_METHOD_UPNL_PAIR as Kn, MUON_METHOD_UPNL_WITH_SYMBOL_PRICE as qn } from "./muon/types.js";
158
- import { getDeallocateUpnlSig as Jn } from "./muon/deallocate-upnl-sig/get-deallocate-upnl-sig.js";
159
- import { getDeallocateUpnlSigQueryKey as Yn, getDeallocateUpnlSigQueryOptions as Xn } from "./muon/deallocate-upnl-sig/query.js";
160
- import { getMuonPartyAOverview as Zn } from "./muon/party-a-overview/get-muon-party-a-overview.js";
161
- import { getMuonPartyAOverviewQueryKey as Qn, getMuonPartyAOverviewQueryOptions as $n } from "./muon/party-a-overview/query.js";
162
- import { getMuonPrice as er } from "./muon/price/get-muon-price.js";
163
- import { getMuonPriceQueryKey as tr, getMuonPriceQueryOptions as nr } from "./muon/price/query.js";
164
- import { getMuonPriceRange as rr } from "./muon/price-range/get-muon-price-range.js";
165
- import { getMuonPriceRangeQueryKey as ir, getMuonPriceRangeQueryOptions as ar } from "./muon/price-range/query.js";
166
- import { getMuonSettleUpnl as or } from "./muon/settle-upnl/get-muon-settle-upnl.js";
167
- import { getMuonSettleUpnlQueryKey as sr, getMuonSettleUpnlQueryOptions as cr } from "./muon/settle-upnl/query.js";
168
- import { getMuonUpnl as lr } from "./muon/upnl/get-muon-upnl.js";
169
- import { getMuonUpnlQueryKey as ur, getMuonUpnlQueryOptions as dr } from "./muon/upnl/query.js";
170
- import { getMuonUpnlA as fr } from "./muon/upnl-a/get-muon-upnl-a.js";
171
- import { getMuonUpnlAQueryKey as pr, getMuonUpnlAQueryOptions as mr } from "./muon/upnl-a/query.js";
172
- import { getMuonUpnlAWithSymbolPrice as hr } from "./muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.js";
173
- import { getMuonUpnlAWithSymbolPriceQueryKey as gr, getMuonUpnlAWithSymbolPriceQueryOptions as _r } from "./muon/upnl-a-with-symbol-price/query.js";
174
- import { getMuonUpnlB as vr } from "./muon/upnl-b/get-muon-upnl-b.js";
175
- import { getMuonUpnlBQueryKey as yr, getMuonUpnlBQueryOptions as br } from "./muon/upnl-b/query.js";
176
- import { getMuonUpnlWithSymbolPrice as xr } from "./muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.js";
177
- import { getMuonUpnlWithSymbolPriceQueryKey as Sr, getMuonUpnlWithSymbolPriceQueryOptions as Cr } from "./muon/upnl-with-symbol-price/query.js";
178
- import { getInstantOpenQuoteId as wr } from "./solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.js";
179
- import { getInstantOpenQuoteIdQueryKey as Tr, getInstantOpenQuoteIdQueryOptions as Er } from "./solvers/instant-open/get-instant-open-quote-id/query.js";
180
- import { getInstantOpens as Dr } from "./solvers/instant-open/get-instant-opens/get-instant-opens.js";
181
- import { getInstantOpensQueryKey as Or, getInstantOpensQueryOptions as kr } from "./solvers/instant-open/get-instant-opens/query.js";
182
- import { ZERO_UPNL_SIG as Ar, buildQuoteMetadata as jr, encodeAddMarginToNextVA as Mr, encodeSendQuoteWithAffiliateAndData as Nr, getFakeSendQuoteMuonSignature as Pr } from "./solvers/instant-open/shared/calldata.js";
183
- import { sendInstantOpen as Fr } from "./solvers/instant-open/shared/hedger-api.js";
184
- import { INSTANT_LAYER_EIP712_DOMAIN_NAME as Ir, INSTANT_LAYER_EIP712_DOMAIN_VERSION as Lr, SIGNED_OPERATION_TYPES as Rr, getInstantLayerEip712Domain as zr, signSignedOperation as Br } from "./solvers/instant-open/shared/eip712.js";
185
- import { buildSignedOperation as Vr, formatSignedOperationPayload as Hr, generateSalt as Ur, signAndFormatInstantOperation as Wr } from "./solvers/instant-open/shared/operations.js";
186
- import { ORDER_TYPE_MARKET as Gr, VIRTUAL_ACCOUNT_ISOLATION_TYPE as Kr, isolationTypeForSide as qr } from "./solvers/instant-open/shared/types.js";
187
- import { MARKET_ORDER_DEADLINE_SECONDS as Jr, calculateMargin as Yr, calculateTradeParams as Xr, computePlatformFee as Zr, getMarketOrderDeadline as Qr, toWeiBigInt as $r } from "./solvers/instant-open/shared/trade-math.js";
188
- import { instantOpen as ei } from "./solvers/instant-open/instant-open/instant-open.js";
189
- import { instantOpenMutationOptions as ti } from "./solvers/instant-open/instant-open/query.js";
190
- import { resolveMarkPrice as ni } from "./solvers/shared/resolvers/resolve-mark-price.js";
191
- import { resolveMarket as ri } from "./solvers/shared/resolvers/resolve-market.js";
192
- import { resolveFeeRates as ii } from "./solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.js";
193
- import { resolveLockedParams as ai } from "./solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.js";
194
- import { prepareInstantOpenParams as oi } from "./solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js";
195
- import { instantOpenAuto as si } from "./solvers/instant-open/instant-open-auto/instant-open-auto.js";
196
- import { instantOpenAutoMutationOptions as ci } from "./solvers/instant-open/instant-open-auto/query.js";
197
- import { validateInstantOpenAgainstMarket as li } from "./solvers/instant-open/shared/quote-constraints.js";
198
- import { ADD_MARGIN_TO_NEXT_VA_SELECTOR as ui, INSTANT_TRADE_REQUIRED_SELECTORS as di, REQUEST_TO_CLOSE_POSITION_SELECTOR as fi, SEND_QUOTE_WITH_AFFILIATE_AND_DATA_SELECTOR as pi } from "./solvers/instant-open/shared/selectors.js";
199
- import { toPendingInstantClose as mi } from "./solvers/instant-close/get-instant-closes/to-pending-instant-close.js";
200
- import { getInstantCloses as hi } from "./solvers/instant-close/get-instant-closes/get-instant-closes.js";
201
- import { getInstantClosesQueryKey as gi, getInstantClosesQueryOptions as _i } from "./solvers/instant-close/get-instant-closes/query.js";
202
- import { encodeRequestToClosePosition as vi } from "./solvers/instant-close/shared/calldata.js";
203
- import { sendInstantClose as yi } from "./solvers/instant-close/shared/hedger-api.js";
204
- import { instantClose as bi } from "./solvers/instant-close/instant-close/instant-close.js";
205
- import { instantCloseMutationOptions as xi } from "./solvers/instant-close/instant-close/query.js";
206
- import { calculateClosePrice as Si, clampClosePrecision as Ci } from "./solvers/instant-close/shared/close-math.js";
207
- import { prepareInstantCloseParams as wi } from "./solvers/instant-close/prepare-instant-close-params/prepare-instant-close-params.js";
208
- import { instantCloseAuto as Ti } from "./solvers/instant-close/instant-close-auto/instant-close-auto.js";
209
- import { instantCloseAutoMutationOptions as Ei } from "./solvers/instant-close/instant-close-auto/query.js";
210
- import { MAX_INSTANT_CLOSE_BULK_ORDERS as Di, instantCloseBulk as Oi } from "./solvers/instant-close/instant-close-bulk/instant-close-bulk.js";
211
- import { instantCloseBulkMutationOptions as ki } from "./solvers/instant-close/instant-close-bulk/query.js";
212
- import { instantCloseBulkAuto as Ai } from "./solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.js";
213
- import { instantCloseBulkAutoMutationOptions as ji } from "./solvers/instant-close/instant-close-bulk-auto/query.js";
214
- import { validateInstantCloseAgainstMarket as Mi } from "./solvers/instant-close/shared/quote-constraints.js";
215
- import { QuoteLifecycle as Ni } from "./quotes/unified-quote.js";
216
- import { applyNotificationToQuotes as Pi, classifyQuoteNotificationAction as Fi } from "./quotes/apply-notification.js";
217
- import { calculateClosePlatformFee as Ii } from "./quotes/fees/calculate-close-platform-fee.js";
218
- import { calculateOpenPlatformFee as Li } from "./quotes/fees/calculate-open-platform-fee.js";
219
- import { fingerprintQuote as Ri } from "./quotes/fingerprint.js";
220
- import { querySubgraph as zi } from "./symmio-subgraph/query-subgraph/query-subgraph.js";
221
- import { getQuerySubgraphQueryKey as Bi, querySubgraphQueryOptions as Vi } from "./symmio-subgraph/query-subgraph/query.js";
222
- import { toQuoteEventRow as Hi } from "./quotes/get-quote-events-by-type/to-quote-event-row.js";
223
- import { DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE as Ui, getQuoteEventsByType as Wi } from "./quotes/get-quote-events-by-type/get-quote-events-by-type.js";
224
- import { getQuoteEventsByTypeQueryKey as Gi, getQuoteEventsByTypeQueryOptions as Ki } from "./quotes/get-quote-events-by-type/query.js";
225
- import { PRICE_HISTORY_EVENT_TYPES as qi, QuoteEventType as Ji } from "./quotes/get-quote-events-by-type/types.js";
226
- import { toQuoteFundingRow as Yi } from "./quotes/get-quote-funding/to-funding-row.js";
227
- import { getQuoteFunding as Xi } from "./quotes/get-quote-funding/get-quote-funding.js";
228
- import { getQuoteFundingQueryKey as Zi, getQuoteFundingQueryOptions as Qi } from "./quotes/get-quote-funding/query.js";
229
- import { QuoteCloseEventType as $i, QuoteCloseType as ea } from "./quotes/get-quote-history/types.js";
230
- import { closeTypeToEventTypes as ta, eventTypeToCloseType as na, eventTypeToQuoteStatus as ra } from "./quotes/get-quote-history/close-type.js";
231
- import { toQuoteHistoryRow as ia } from "./quotes/get-quote-history/to-history-row.js";
232
- import { getQuoteHistory as aa } from "./quotes/get-quote-history/get-quote-history.js";
233
- import { getQuoteHistoryQueryKey as oa, getQuoteHistoryQueryOptions as sa } from "./quotes/get-quote-history/query.js";
234
- import { lifecycleFromQuoteStatus as ca, toUnifiedQuoteFromInstantClose as la, toUnifiedQuoteFromInstantOpen as ua, toUnifiedQuoteFromOnchain as da } from "./quotes/to-unified-quote.js";
235
- import { reconcileQuotes as fa } from "./quotes/reconcile-quotes.js";
236
- import { resolveQuoteAccounts as pa } from "./quotes/resolve-quote-accounts.js";
237
- import { getSubAccountQuotes as ma } from "./quotes/get-sub-account-quotes/get-sub-account-quotes.js";
238
- import { getSubAccountQuotesQueryKey as ha, getSubAccountQuotesQueryOptions as ga } from "./quotes/get-sub-account-quotes/query.js";
239
- import { isActivePosition as _a, isPendingOrder as va, partitionQuotes as ya } from "./quotes/grouping/partition-quotes.js";
240
- import { aggregateGroupMetrics as ba } from "./quotes/grouping/aggregate-metrics.js";
241
- import { resolveQuoteGroupingStrategy as xa } from "./quotes/grouping/group-strategy.js";
242
- import { groupQuotes as Sa } from "./quotes/grouping/group-quotes.js";
243
- import { calculateLiquidationPrice as Ca } from "./quotes/liquidation/calculate-liquidation-price.js";
244
- import { shouldAccelerateOnchainReads as wa, shouldAccelerateQuotePolling as Ta } from "./quotes/should-accelerate.js";
245
- import { calculateQuoteLeverage as Ea } from "./quotes/upnl/calculate-quote-leverage.js";
246
- import { calculateQuotePnl as Da } from "./quotes/upnl/calculate-quote-pnl.js";
247
- import { calculateQuoteUpnl as Oa } from "./quotes/upnl/calculate-quote-upnl.js";
248
- import { getTpSlConfig as ka } from "./tpsl/config/get-tpsl-config.js";
249
- import { getTpSlConfigQueryKey as Aa, getTpSlConfigQueryOptions as ja } from "./tpsl/config/query.js";
250
- import { ZERO_LEG as Ma, buildConditionalOrderMessage as Na, buildTpSlDeleteMessage as Pa, generateTpSlSalt as Fa, toSignableTpSlMessage as Ia } from "./tpsl/set-quote-tpsl/build-conditional-order-message.js";
251
- import { signTpSlRequest as La } from "./tpsl/set-quote-tpsl/sign-tpsl-request.js";
252
- import { getTpSlDeleteSigningSpec as Ra } from "./tpsl/signing-spec/get-tpsl-delete-signing-spec.js";
253
- import { deleteQuoteTpSl as za } from "./tpsl/delete-quote-tpsl/delete-quote-tpsl.js";
254
- import { deleteQuoteTpSlMutationOptions as Ba } from "./tpsl/delete-quote-tpsl/query.js";
255
- import { getQuoteTpSl as Va } from "./tpsl/get-quote-tpsl/get-quote-tpsl.js";
256
- import { getQuoteTpSlQueryKey as Ha, getQuoteTpSlQueryOptions as Ua } from "./tpsl/get-quote-tpsl/query.js";
257
- import { buildConditionalOrderLeg as Wa } from "./tpsl/set-quote-tpsl/build-conditional-order-leg.js";
258
- import { getTpSlSigningSpec as Ga } from "./tpsl/signing-spec/get-tpsl-signing-spec.js";
259
- import { DEFAULT_TPSL_SLIPPAGE_LOWCAPS as Ka, priceSlippageCalculation as qa } from "./tpsl/slippage.js";
260
- import { setQuoteTpSl as Ja } from "./tpsl/set-quote-tpsl/set-quote-tpsl.js";
261
- import { setQuoteTpSlMutationOptions as Ya } from "./tpsl/set-quote-tpsl/query.js";
262
- import { getTpSlDeleteSigningSpecQueryKey as Xa, getTpSlDeleteSigningSpecQueryOptions as Za } from "./tpsl/signing-spec/delete-query.js";
263
- import { getTpSlSigningSpecQueryKey as Qa, getTpSlSigningSpecQueryOptions as $a } from "./tpsl/signing-spec/query.js";
264
- import { validateTpSl as eo } from "./tpsl/validate-tpsl.js";
265
- import { parseTpSlFrame as to } from "./websocket/tpsl/parse-tpsl-frame.js";
266
- import { watchTpSlNotifications as no } from "./websocket/tpsl/watch-tpsl-notifications.js";
267
- import { BalanceChangeType as ro, BalanceHistoryFilter as io, MarginTransferType as ao } from "./balance-history/get-balance-history/types.js";
268
- import { balanceHistoryFilterToTypes as oo } from "./balance-history/get-balance-history/balance-history-filter.js";
269
- import { toBalanceHistoryRow as so } from "./balance-history/get-balance-history/to-balance-history-row.js";
270
- import { getBalanceHistory as co } from "./balance-history/get-balance-history/get-balance-history.js";
271
- import { getBalanceHistoryQueryKey as lo, getBalanceHistoryQueryOptions as uo } from "./balance-history/get-balance-history/query.js";
272
- import { toTransferRow as fo } from "./transfers/get-transfer-history/to-transfer-row.js";
273
- import { getTransferHistory as po } from "./transfers/get-transfer-history/get-transfer-history.js";
274
- import { getTransferHistoryQueryKey as mo, getTransferHistoryQueryOptions as ho } from "./transfers/get-transfer-history/query.js";
275
- export { ui as ADD_MARGIN_TO_NEXT_VA_SELECTOR, Zt as ActionStatus, ro as BalanceChangeType, io as BalanceHistoryFilter, Ui as DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE, Ka as DEFAULT_TPSL_SLIPPAGE_LOWCAPS, Ir as INSTANT_LAYER_EIP712_DOMAIN_NAME, Lr as INSTANT_LAYER_EIP712_DOMAIN_VERSION, di as INSTANT_TRADE_REQUIRED_SELECTORS, Jr as MARKET_ORDER_DEADLINE_SECONDS, Di as MAX_INSTANT_CLOSE_BULK_ORDERS, Rn as MUON_APP, zn as MUON_METHOD_PARTY_A_OVERVIEW, Bn as MUON_METHOD_PRICE, Vn as MUON_METHOD_PRICE_RANGE, Hn as MUON_METHOD_SETTLE_UPNL, Un as MUON_METHOD_UPNL_A, Wn as MUON_METHOD_UPNL_A_WITH_SYMBOL_PRICE, Gn as MUON_METHOD_UPNL_B, Kn as MUON_METHOD_UPNL_PAIR, qn as MUON_METHOD_UPNL_WITH_SYMBOL_PRICE, ao as MarginTransferType, Qt as NotificationType, Gr as ORDER_TYPE_MARKET, jt as OrderType, qi as PRICE_HISTORY_EVENT_TYPES, Mt as PositionType, $i as QuoteCloseEventType, ea as QuoteCloseType, Ji as QuoteEventType, Ni as QuoteLifecycle, Nt as QuoteStatus, fi as REQUEST_TO_CLOSE_POSITION_SELECTOR, pi as SEND_QUOTE_WITH_AFFILIATE_AND_DATA_SELECTOR, Rr as SIGNED_OPERATION_TYPES, ge as SubAccountIsolationType, r as SymmApiError, i as SymmError, a as SymmioSupportedChainId, Kr as VIRTUAL_ACCOUNT_ISOLATION_TYPE, Pt as WithdrawStatus, Ma as ZERO_LEG, Ar as ZERO_UPNL_SIG, e as accountLayerAbi, f as addMargin, F as addMarginMutationOptions, ba as aggregateGroupMetrics, Le as allocate, rt as allocateMutationOptions, Pi as applyNotificationToQuotes, ve as approveCollateral, xe as approveCollateralMutationOptions, oo as balanceHistoryFilterToTypes, Wa as buildConditionalOrderLeg, Na as buildConditionalOrderMessage, jr as buildQuoteMetadata, Vr as buildSignedOperation, Xt as buildSubscribeMessage, Pa as buildTpSlDeleteMessage, Ii as calculateClosePlatformFee, Si as calculateClosePrice, Ca as calculateLiquidationPrice, Yr as calculateMargin, Li as calculateOpenPlatformFee, Ea as calculateQuoteLeverage, Da as calculateQuotePnl, Oa as calculateQuoteUpnl, Xr as calculateTradeParams, wn as checkNotionalCap, Ci as clampClosePrecision, $t as classifyNotification, Fi as classifyQuoteNotificationAction, ta as closeTypeToEventTypes, Zr as computePlatformFee, nt as createClassicWithdrawPart, l as createConfig, m as createSubAccounts, I as createSubAccountsMutationOptions, Re as deallocate, it as deallocateMutationOptions, za as deleteQuoteTpSl, Ba as deleteQuoteTpSlMutationOptions, g as deleteSubAccount, L as deleteSubAccountMutationOptions, v as depositAndAllocateForAccount, R as depositAndAllocateForAccountMutationOptions, b as depositForAccount, z as depositForAccountMutationOptions, S as editAccountName, B as editAccountNameMutationOptions, Mr as encodeAddMarginToNextVA, vi as encodeRequestToClosePosition, Nr as encodeSendQuoteWithAffiliateAndData, na as eventTypeToCloseType, ra as eventTypeToQuoteStatus, V as filterQueryOptions, Be as finalizeWithdrawRequest, at as finalizeWithdrawRequestMutationOptions, Ri as fingerprintQuote, Hr as formatSignedOperationPayload, Ur as generateSalt, Fa as generateTpSlSalt, C as getAccountBalanceInfo, H as getAccountBalanceInfoQueryKey, U as getAccountBalanceInfoQueryOptions, w as getAccountBalanceOf, W as getAccountBalanceOfQueryKey, G as getAccountBalanceOfQueryOptions, co as getBalanceHistory, lo as getBalanceHistoryQueryKey, uo as getBalanceHistoryQueryOptions, o as getChainConfig, ye as getCollateralAllowance, Se as getCollateralAllowanceQueryKey, Ce as getCollateralAllowanceQueryOptions, be as getCollateralBalance, we as getCollateralBalanceQueryKey, Te as getCollateralBalanceQueryOptions, Jn as getDeallocateUpnlSig, Yn as getDeallocateUpnlSigQueryKey, Xn as getDeallocateUpnlSigQueryOptions, De as getDelegationExpiry, je as getDelegationExpiryQueryKey, Me as getDelegationExpiryQueryOptions, Ft as getEnigmaPriceServiceHealth, It as getEnigmaPriceServiceHealthQueryKey, Lt as getEnigmaPriceServiceHealthQueryOptions, Rt as getEnigmaPriceServiceMetadata, zt as getEnigmaPriceServiceMetadataQueryKey, Bt as getEnigmaPriceServiceMetadataQueryOptions, Vt as getEnigmaPriceServicePricesByAddresses, Ht as getEnigmaPriceServicePricesByAddressesQueryKey, Ut as getEnigmaPriceServicePricesByAddressesQueryOptions, Wt as getEnigmaPriceServicePricesByNames, Gt as getEnigmaPriceServicePricesByNamesQueryKey, Kt as getEnigmaPriceServicePricesByNamesQueryOptions, qt as getEnigmaPriceServiceSymbolsInfo, Jt as getEnigmaPriceServiceSymbolsInfoQueryKey, Yt as getEnigmaPriceServiceSymbolsInfoQueryOptions, Pr as getFakeSendQuoteMuonSignature, Ve as getFeeForUser, ot as getFeeForUserQueryKey, st as getFeeForUserQueryOptions, pn as getFundingInfo, hn as getFundingInfoQueryKey, gn as getFundingInfoQueryOptions, hi as getInstantCloses, gi as getInstantClosesQueryKey, _i as getInstantClosesQueryOptions, zr as getInstantLayerEip712Domain, wr as getInstantOpenQuoteId, Tr as getInstantOpenQuoteIdQueryKey, Er as getInstantOpenQuoteIdQueryOptions, Dr as getInstantOpens, Or as getInstantOpensQueryKey, kr as getInstantOpensQueryOptions, Oe as getIsDelegationActive, Ne as getIsDelegationActiveQueryKey, Pe as getIsDelegationActiveQueryOptions, He as getLastWithdrawRequestId, ct as getLastWithdrawRequestIdQueryKey, lt as getLastWithdrawRequestIdQueryOptions, xn as getLockedParams, Sn as getLockedParamsQueryKey, Cn as getLockedParamsQueryOptions, vn as getMarketInfo, yn as getMarketInfoQueryKey, bn as getMarketInfoQueryOptions, Qr as getMarketOrderDeadline, ln as getMarkets, un as getMarketsQueryKey, dn as getMarketsQueryOptions, Zn as getMuonPartyAOverview, Qn as getMuonPartyAOverviewQueryKey, $n as getMuonPartyAOverviewQueryOptions, er as getMuonPrice, tr as getMuonPriceQueryKey, nr as getMuonPriceQueryOptions, rr as getMuonPriceRange, ir as getMuonPriceRangeQueryKey, ar as getMuonPriceRangeQueryOptions, or as getMuonSettleUpnl, sr as getMuonSettleUpnlQueryKey, cr as getMuonSettleUpnlQueryOptions, lr as getMuonUpnl, fr as getMuonUpnlA, pr as getMuonUpnlAQueryKey, mr as getMuonUpnlAQueryOptions, hr as getMuonUpnlAWithSymbolPrice, gr as getMuonUpnlAWithSymbolPriceQueryKey, _r as getMuonUpnlAWithSymbolPriceQueryOptions, vr as getMuonUpnlB, yr as getMuonUpnlBQueryKey, br as getMuonUpnlBQueryOptions, ur as getMuonUpnlQueryKey, dr as getMuonUpnlQueryOptions, xr as getMuonUpnlWithSymbolPrice, Sr as getMuonUpnlWithSymbolPriceQueryKey, Cr as getMuonUpnlWithSymbolPriceQueryOptions, En as getNotionalCapAll, jn as getNotionalCapAllQueryKey, Mn as getNotionalCapAllQueryOptions, Dn as getNotionalCapBySymbolId, kn as getNotionalCapBySymbolIdQueryKey, An as getNotionalCapBySymbolIdQueryOptions, Ue as getOnchainContractMarkets, ut as getOnchainContractMarketsQueryKey, dt as getOnchainContractMarketsQueryOptions, On as getOpenInterestBySymbolId, Nn as getOpenInterestBySymbolIdQueryKey, Pn as getOpenInterestBySymbolIdQueryOptions, We as getPartyAOpenPositions, ft as getPartyAOpenPositionsQueryKey, pt as getPartyAOpenPositionsQueryOptions, Ge as getPartyAPendingQuotes, mt as getPartyAPendingQuotesQueryKey, ht as getPartyAPendingQuotesQueryOptions, Ke as getPendingWithdrawRequests, gt as getPendingWithdrawRequestsQueryKey, _t as getPendingWithdrawRequestsQueryOptions, M as getPredictedNextVirtualAccount, oe as getPredictedNextVirtualAccountQueryKey, se as getPredictedNextVirtualAccountQueryOptions, Bi as getQuerySubgraphQueryKey, qe as getQuote, Wi as getQuoteEventsByType, Gi as getQuoteEventsByTypeQueryKey, Ki as getQuoteEventsByTypeQueryOptions, Xi as getQuoteFunding, Zi as getQuoteFundingQueryKey, Qi as getQuoteFundingQueryOptions, aa as getQuoteHistory, oa as getQuoteHistoryQueryKey, sa as getQuoteHistoryQueryOptions, vt as getQuoteQueryKey, yt as getQuoteQueryOptions, Va as getQuoteTpSl, Ha as getQuoteTpSlQueryKey, Ua as getQuoteTpSlQueryOptions, Fn as getSolverErrorCodes, In as getSolverErrorCodesQueryKey, Ln as getSolverErrorCodesQueryOptions, T as getSubAccount, K as getSubAccountQueryKey, q as getSubAccountQueryOptions, ma as getSubAccountQuotes, ha as getSubAccountQuotesQueryKey, ga as getSubAccountQuotesQueryOptions, E as getSubAccountVirtualNonce, J as getSubAccountVirtualNonceQueryKey, Y as getSubAccountVirtualNonceQueryOptions, D as getSubAccountsCountOfUser, X as getSubAccountsCountOfUserQueryKey, Z as getSubAccountsCountOfUserQueryOptions, ka as getTpSlConfig, Aa as getTpSlConfigQueryKey, ja as getTpSlConfigQueryOptions, Ra as getTpSlDeleteSigningSpec, Xa as getTpSlDeleteSigningSpecQueryKey, Za as getTpSlDeleteSigningSpecQueryOptions, Ga as getTpSlSigningSpec, Qa as getTpSlSigningSpecQueryKey, $a as getTpSlSigningSpecQueryOptions, po as getTransferHistory, mo as getTransferHistoryQueryKey, ho as getTransferHistoryQueryOptions, O as getUserSubAccounts, k as getUserSubAccountsAddresses, ee as getUserSubAccountsAddressesQueryKey, te as getUserSubAccountsAddressesQueryOptions, Q as getUserSubAccountsQueryKey, $ as getUserSubAccountsQueryOptions, A as getVirtualAccount, ne as getVirtualAccountQueryKey, re as getVirtualAccountQueryOptions, j as getVirtualAccountsAddressesOfSubAccount, ie as getVirtualAccountsAddressesOfSubAccountQueryKey, ae as getVirtualAccountsAddressesOfSubAccountQueryOptions, Je as getWithdrawRequests, bt as getWithdrawRequestsQueryKey, xt as getWithdrawRequestsQueryOptions, Ye as getWithdrawableTime, St as getWithdrawableTimeQueryKey, Ct as getWithdrawableTimeQueryOptions, Ae as grantDelegation, Fe as grantDelegationMutationOptions, Sa as groupQuotes, Xe as initiateWithdraw, wt as initiateWithdrawMutationOptions, bi as instantClose, Ti as instantCloseAuto, Ei as instantCloseAutoMutationOptions, Oi as instantCloseBulk, Ai as instantCloseBulkAuto, ji as instantCloseBulkAutoMutationOptions, ki as instantCloseBulkMutationOptions, xi as instantCloseMutationOptions, t as instantLayerAbi, ei as instantOpen, si as instantOpenAuto, ci as instantOpenAutoMutationOptions, ti as instantOpenMutationOptions, _a as isActivePosition, s as isChainSupported, va as isPendingOrder, qr as isolationTypeForSide, ca as lifecycleFromQuoteStatus, c as listSupportedChains, en as normalizeNotification, tn as parseNotificationFrame, rn as parsePriceFrame, to as parseTpSlFrame, ya as partitionQuotes, wi as prepareInstantCloseParams, oi as prepareInstantOpenParams, qa as priceSlippageCalculation, mn as projectFundingRate, zi as querySubgraph, Vi as querySubgraphQueryOptions, fa as reconcileQuotes, P as removeMargin, ce as removeMarginMutationOptions, Ze as requestCancelWithdraw, Tt as requestCancelWithdrawMutationOptions, ii as resolveFeeRates, ai as resolveLockedParams, ni as resolveMarkPrice, ri as resolveMarket, pa as resolveQuoteAccounts, xa as resolveQuoteGroupingStrategy, on as searchNotifications, sn as searchNotificationsQueryKey, cn as searchNotificationsQueryOptions, yi as sendInstantClose, Fr as sendInstantOpen, Ja as setQuoteTpSl, Ya as setQuoteTpSlMutationOptions, wa as shouldAccelerateOnchainReads, Ta as shouldAccelerateQuotePolling, u as shouldSimulateBeforeWrite, Wr as signAndFormatInstantOperation, Br as signSignedOperation, La as signTpSlRequest, d as simulateAddMargin, le as simulateAddMarginMutationOptions, Qe as simulateAllocate, Et as simulateAllocateMutationOptions, _e as simulateApproveCollateral, Ee as simulateApproveCollateralMutationOptions, p as simulateCreateSubAccounts, ue as simulateCreateSubAccountsMutationOptions, $e as simulateDeallocate, Dt as simulateDeallocateMutationOptions, h as simulateDeleteSubAccount, de as simulateDeleteSubAccountMutationOptions, _ as simulateDepositAndAllocateForAccount, fe as simulateDepositAndAllocateForAccountMutationOptions, y as simulateDepositForAccount, pe as simulateDepositForAccountMutationOptions, x as simulateEditAccountName, me as simulateEditAccountNameMutationOptions, ze as simulateFinalizeWithdrawRequest, Ot as simulateFinalizeWithdrawRequestMutationOptions, ke as simulateGrantDelegation, Ie as simulateGrantDelegationMutationOptions, et as simulateInitiateWithdraw, kt as simulateInitiateWithdrawMutationOptions, N as simulateRemoveMargin, he as simulateRemoveMarginMutationOptions, tt as simulateRequestCancelWithdraw, At as simulateRequestCancelWithdrawMutationOptions, n as symmioAbi, so as toBalanceHistoryRow, fn as toMarketFundingInfo, _n as toMarketInfo, Tn as toMarketNotionalCap, mi as toPendingInstantClose, Hi as toQuoteEventRow, Yi as toQuoteFundingRow, ia as toQuoteHistoryRow, Ia as toSignableTpSlMessage, fo as toTransferRow, la as toUnifiedQuoteFromInstantClose, ua as toUnifiedQuoteFromInstantOpen, da as toUnifiedQuoteFromOnchain, $r as toWeiBigInt, Mi as validateInstantCloseAgainstMarket, li as validateInstantOpenAgainstMarket, eo as validateTpSl, an as watchEnigmaPrices, nn as watchNotifications, no as watchTpSlNotifications };
138
+ import { toEstimatedPrice as fn } from "./solvers/estimated-price/to-estimated-price.js";
139
+ import { getEstimatedPrice as pn } from "./solvers/estimated-price/get-estimated-price.js";
140
+ import { calculatePriceImpact as mn } from "./solvers/estimated-price/price-impact.js";
141
+ import { getEstimatedPriceQueryKey as hn, getEstimatedPriceQueryOptions as gn } from "./solvers/estimated-price/query.js";
142
+ import { toMarketFundingInfo as _n } from "./solvers/funding-info/to-funding-info.js";
143
+ import { getFundingInfo as vn } from "./solvers/funding-info/get-funding-info.js";
144
+ import { projectFundingRate as yn } from "./solvers/funding-info/project-funding-rate.js";
145
+ import { getFundingInfoQueryKey as bn, getFundingInfoQueryOptions as xn } from "./solvers/funding-info/query.js";
146
+ import { toMarketInfo as Sn } from "./solvers/market-info/to-market-info.js";
147
+ import { getMarketInfo as Cn } from "./solvers/market-info/get-market-info.js";
148
+ import { getMarketInfoQueryKey as wn, getMarketInfoQueryOptions as Tn } from "./solvers/market-info/query.js";
149
+ import { getLockedParams as En } from "./solvers/locked-params/get-locked-params.js";
150
+ import { getLockedParamsQueryKey as Dn, getLockedParamsQueryOptions as On } from "./solvers/locked-params/query.js";
151
+ import { checkNotionalCap as kn } from "./solvers/notional-cap/check-notional-cap.js";
152
+ import { toMarketNotionalCap as An } from "./solvers/notional-cap/to-market-notional-cap.js";
153
+ import { getNotionalCapAll as jn } from "./solvers/notional-cap/get-notional-cap-all.js";
154
+ import { getNotionalCapBySymbolId as Mn } from "./solvers/notional-cap/get-notional-cap-by-symbol-id.js";
155
+ import { getOpenInterestBySymbolId as Nn } from "./solvers/notional-cap/get-open-interest-by-symbol-id.js";
156
+ import { getNotionalCapBySymbolIdQueryKey as Pn, getNotionalCapBySymbolIdQueryOptions as Fn } from "./solvers/notional-cap/query.js";
157
+ import { getNotionalCapAllQueryKey as In, getNotionalCapAllQueryOptions as Ln } from "./solvers/notional-cap/query-all.js";
158
+ import { getOpenInterestBySymbolIdQueryKey as Rn, getOpenInterestBySymbolIdQueryOptions as zn } from "./solvers/notional-cap/query-open-interest.js";
159
+ import { getSolverErrorCodes as Bn } from "./solvers/error-codes/get-solver-error-codes.js";
160
+ import { getSolverErrorCodesQueryKey as Vn, getSolverErrorCodesQueryOptions as Hn } from "./solvers/error-codes/query.js";
161
+ import { MUON_APP as Un, MUON_METHOD_PARTY_A_OVERVIEW as Wn, MUON_METHOD_PRICE as Gn, MUON_METHOD_PRICE_RANGE as Kn, MUON_METHOD_SETTLE_UPNL as qn, MUON_METHOD_UPNL_A as Jn, MUON_METHOD_UPNL_A_WITH_SYMBOL_PRICE as Yn, MUON_METHOD_UPNL_B as Xn, MUON_METHOD_UPNL_PAIR as Zn, MUON_METHOD_UPNL_WITH_SYMBOL_PRICE as Qn } from "./muon/types.js";
162
+ import { getDeallocateUpnlSig as $n } from "./muon/deallocate-upnl-sig/get-deallocate-upnl-sig.js";
163
+ import { getDeallocateUpnlSigQueryKey as er, getDeallocateUpnlSigQueryOptions as tr } from "./muon/deallocate-upnl-sig/query.js";
164
+ import { getMuonPartyAOverview as nr } from "./muon/party-a-overview/get-muon-party-a-overview.js";
165
+ import { getMuonPartyAOverviewQueryKey as rr, getMuonPartyAOverviewQueryOptions as ir } from "./muon/party-a-overview/query.js";
166
+ import { getMuonPrice as ar } from "./muon/price/get-muon-price.js";
167
+ import { getMuonPriceQueryKey as or, getMuonPriceQueryOptions as sr } from "./muon/price/query.js";
168
+ import { getMuonPriceRange as cr } from "./muon/price-range/get-muon-price-range.js";
169
+ import { getMuonPriceRangeQueryKey as lr, getMuonPriceRangeQueryOptions as ur } from "./muon/price-range/query.js";
170
+ import { getMuonSettleUpnl as dr } from "./muon/settle-upnl/get-muon-settle-upnl.js";
171
+ import { getMuonSettleUpnlQueryKey as fr, getMuonSettleUpnlQueryOptions as pr } from "./muon/settle-upnl/query.js";
172
+ import { getMuonUpnl as mr } from "./muon/upnl/get-muon-upnl.js";
173
+ import { getMuonUpnlQueryKey as hr, getMuonUpnlQueryOptions as gr } from "./muon/upnl/query.js";
174
+ import { getMuonUpnlA as _r } from "./muon/upnl-a/get-muon-upnl-a.js";
175
+ import { getMuonUpnlAQueryKey as vr, getMuonUpnlAQueryOptions as yr } from "./muon/upnl-a/query.js";
176
+ import { getMuonUpnlAWithSymbolPrice as br } from "./muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.js";
177
+ import { getMuonUpnlAWithSymbolPriceQueryKey as xr, getMuonUpnlAWithSymbolPriceQueryOptions as Sr } from "./muon/upnl-a-with-symbol-price/query.js";
178
+ import { getMuonUpnlB as Cr } from "./muon/upnl-b/get-muon-upnl-b.js";
179
+ import { getMuonUpnlBQueryKey as wr, getMuonUpnlBQueryOptions as Tr } from "./muon/upnl-b/query.js";
180
+ import { getMuonUpnlWithSymbolPrice as Er } from "./muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.js";
181
+ import { getMuonUpnlWithSymbolPriceQueryKey as Dr, getMuonUpnlWithSymbolPriceQueryOptions as Or } from "./muon/upnl-with-symbol-price/query.js";
182
+ import { getInstantOpenQuoteId as kr } from "./solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.js";
183
+ import { getInstantOpenQuoteIdQueryKey as Ar, getInstantOpenQuoteIdQueryOptions as jr } from "./solvers/instant-open/get-instant-open-quote-id/query.js";
184
+ import { getInstantOpens as Mr } from "./solvers/instant-open/get-instant-opens/get-instant-opens.js";
185
+ import { getInstantOpensQueryKey as Nr, getInstantOpensQueryOptions as Pr } from "./solvers/instant-open/get-instant-opens/query.js";
186
+ import { ZERO_UPNL_SIG as Fr, buildQuoteMetadata as Ir, encodeAddMarginToNextVA as Lr, encodeSendQuoteWithAffiliateAndData as Rr, getFakeSendQuoteMuonSignature as zr } from "./solvers/instant-open/shared/calldata.js";
187
+ import { sendInstantOpen as Br } from "./solvers/instant-open/shared/hedger-api.js";
188
+ import { INSTANT_LAYER_EIP712_DOMAIN_NAME as Vr, INSTANT_LAYER_EIP712_DOMAIN_VERSION as Hr, SIGNED_OPERATION_TYPES as Ur, getInstantLayerEip712Domain as Wr, signSignedOperation as Gr } from "./solvers/instant-open/shared/eip712.js";
189
+ import { buildSignedOperation as Kr, formatSignedOperationPayload as qr, generateSalt as Jr, signAndFormatInstantOperation as Yr } from "./solvers/instant-open/shared/operations.js";
190
+ import { ORDER_TYPE_MARKET as Xr, VIRTUAL_ACCOUNT_ISOLATION_TYPE as Zr, isolationTypeForSide as Qr } from "./solvers/instant-open/shared/types.js";
191
+ import { MARKET_ORDER_DEADLINE_SECONDS as $r, calculateAvailableInstantOpenMargin as ei, calculateMargin as ti, calculateTradeParams as ni, computePlatformFee as ri, getMarketOrderDeadline as ii, toWeiBigInt as ai } from "./solvers/instant-open/shared/trade-math.js";
192
+ import { instantOpen as oi } from "./solvers/instant-open/instant-open/instant-open.js";
193
+ import { instantOpenMutationOptions as si } from "./solvers/instant-open/instant-open/query.js";
194
+ import { resolveMarkPrice as ci } from "./solvers/shared/resolvers/resolve-mark-price.js";
195
+ import { resolveMarket as li } from "./solvers/shared/resolvers/resolve-market.js";
196
+ import { resolveFeeRates as ui } from "./solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.js";
197
+ import { resolveLockedParams as di } from "./solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.js";
198
+ import { prepareInstantOpenParams as fi } from "./solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js";
199
+ import { instantOpenAuto as pi } from "./solvers/instant-open/instant-open-auto/instant-open-auto.js";
200
+ import { instantOpenAutoMutationOptions as mi } from "./solvers/instant-open/instant-open-auto/query.js";
201
+ import { validateInstantOpenAgainstMarket as hi } from "./solvers/instant-open/shared/quote-constraints.js";
202
+ import { ADD_MARGIN_TO_NEXT_VA_SELECTOR as gi, INSTANT_TRADE_REQUIRED_SELECTORS as _i, REQUEST_TO_CLOSE_POSITION_SELECTOR as vi, SEND_QUOTE_WITH_AFFILIATE_AND_DATA_SELECTOR as yi } from "./solvers/instant-open/shared/selectors.js";
203
+ import { toPendingInstantClose as bi } from "./solvers/instant-close/get-instant-closes/to-pending-instant-close.js";
204
+ import { getInstantCloses as xi } from "./solvers/instant-close/get-instant-closes/get-instant-closes.js";
205
+ import { getInstantClosesQueryKey as Si, getInstantClosesQueryOptions as Ci } from "./solvers/instant-close/get-instant-closes/query.js";
206
+ import { encodeRequestToClosePosition as wi } from "./solvers/instant-close/shared/calldata.js";
207
+ import { sendInstantClose as Ti } from "./solvers/instant-close/shared/hedger-api.js";
208
+ import { instantClose as Ei } from "./solvers/instant-close/instant-close/instant-close.js";
209
+ import { instantCloseMutationOptions as Di } from "./solvers/instant-close/instant-close/query.js";
210
+ import { calculateClosePrice as Oi, clampClosePrecision as ki } from "./solvers/instant-close/shared/close-math.js";
211
+ import { prepareInstantCloseParams as Ai } from "./solvers/instant-close/prepare-instant-close-params/prepare-instant-close-params.js";
212
+ import { instantCloseAuto as ji } from "./solvers/instant-close/instant-close-auto/instant-close-auto.js";
213
+ import { instantCloseAutoMutationOptions as Mi } from "./solvers/instant-close/instant-close-auto/query.js";
214
+ import { MAX_INSTANT_CLOSE_BULK_ORDERS as Ni, instantCloseBulk as Pi } from "./solvers/instant-close/instant-close-bulk/instant-close-bulk.js";
215
+ import { instantCloseBulkMutationOptions as Fi } from "./solvers/instant-close/instant-close-bulk/query.js";
216
+ import { instantCloseBulkAuto as Ii } from "./solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.js";
217
+ import { instantCloseBulkAutoMutationOptions as Li } from "./solvers/instant-close/instant-close-bulk-auto/query.js";
218
+ import { validateInstantCloseAgainstMarket as Ri } from "./solvers/instant-close/shared/quote-constraints.js";
219
+ import { QuoteLifecycle as zi } from "./quotes/unified-quote.js";
220
+ import { applyNotificationToQuotes as Bi, classifyQuoteNotificationAction as Vi } from "./quotes/apply-notification.js";
221
+ import { calculateClosePlatformFee as Hi } from "./quotes/fees/calculate-close-platform-fee.js";
222
+ import { calculateOpenPlatformFee as Ui } from "./quotes/fees/calculate-open-platform-fee.js";
223
+ import { fingerprintQuote as Wi } from "./quotes/fingerprint.js";
224
+ import { querySubgraph as Gi } from "./symmio-subgraph/query-subgraph/query-subgraph.js";
225
+ import { getQuerySubgraphQueryKey as Ki, querySubgraphQueryOptions as qi } from "./symmio-subgraph/query-subgraph/query.js";
226
+ import { toQuoteEventRow as Ji } from "./quotes/get-quote-events-by-type/to-quote-event-row.js";
227
+ import { DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE as Yi, getQuoteEventsByType as Xi } from "./quotes/get-quote-events-by-type/get-quote-events-by-type.js";
228
+ import { getQuoteEventsByTypeQueryKey as Zi, getQuoteEventsByTypeQueryOptions as Qi } from "./quotes/get-quote-events-by-type/query.js";
229
+ import { PRICE_HISTORY_EVENT_TYPES as $i, QuoteEventType as ea } from "./quotes/get-quote-events-by-type/types.js";
230
+ import { toQuoteFundingRow as ta } from "./quotes/get-quote-funding/to-funding-row.js";
231
+ import { getQuoteFunding as na } from "./quotes/get-quote-funding/get-quote-funding.js";
232
+ import { getQuoteFundingQueryKey as ra, getQuoteFundingQueryOptions as ia } from "./quotes/get-quote-funding/query.js";
233
+ import { QuoteCloseEventType as aa, QuoteCloseType as oa } from "./quotes/get-quote-history/types.js";
234
+ import { closeTypeToEventTypes as sa, eventTypeToCloseType as ca, eventTypeToQuoteStatus as la } from "./quotes/get-quote-history/close-type.js";
235
+ import { toQuoteHistoryRow as ua } from "./quotes/get-quote-history/to-history-row.js";
236
+ import { getQuoteHistory as da } from "./quotes/get-quote-history/get-quote-history.js";
237
+ import { getQuoteHistoryQueryKey as fa, getQuoteHistoryQueryOptions as pa } from "./quotes/get-quote-history/query.js";
238
+ import { lifecycleFromQuoteStatus as ma, toUnifiedQuoteFromInstantClose as ha, toUnifiedQuoteFromInstantOpen as ga, toUnifiedQuoteFromOnchain as _a } from "./quotes/to-unified-quote.js";
239
+ import { reconcileQuotes as va } from "./quotes/reconcile-quotes.js";
240
+ import { resolveQuoteAccounts as ya } from "./quotes/resolve-quote-accounts.js";
241
+ import { getSubAccountQuotes as ba } from "./quotes/get-sub-account-quotes/get-sub-account-quotes.js";
242
+ import { getSubAccountQuotesQueryKey as xa, getSubAccountQuotesQueryOptions as Sa } from "./quotes/get-sub-account-quotes/query.js";
243
+ import { isActivePosition as Ca, isPendingOrder as wa, partitionQuotes as Ta } from "./quotes/grouping/partition-quotes.js";
244
+ import { aggregateGroupMetrics as Ea } from "./quotes/grouping/aggregate-metrics.js";
245
+ import { resolveQuoteGroupingStrategy as Da } from "./quotes/grouping/group-strategy.js";
246
+ import { groupQuotes as Oa } from "./quotes/grouping/group-quotes.js";
247
+ import { calculateLiquidationPrice as ka } from "./quotes/liquidation/calculate-liquidation-price.js";
248
+ import { shouldAccelerateOnchainReads as Aa, shouldAccelerateQuotePolling as ja } from "./quotes/should-accelerate.js";
249
+ import { calculateQuoteLeverage as Ma } from "./quotes/upnl/calculate-quote-leverage.js";
250
+ import { calculateQuotePnl as Na } from "./quotes/upnl/calculate-quote-pnl.js";
251
+ import { calculateQuoteUpnl as Pa } from "./quotes/upnl/calculate-quote-upnl.js";
252
+ import { getTpSlConfig as Fa } from "./tpsl/config/get-tpsl-config.js";
253
+ import { getTpSlConfigQueryKey as Ia, getTpSlConfigQueryOptions as La } from "./tpsl/config/query.js";
254
+ import { ZERO_LEG as Ra, buildConditionalOrderMessage as za, buildTpSlDeleteMessage as Ba, generateTpSlSalt as Va, toSignableTpSlMessage as Ha } from "./tpsl/set-quote-tpsl/build-conditional-order-message.js";
255
+ import { signTpSlRequest as Ua } from "./tpsl/set-quote-tpsl/sign-tpsl-request.js";
256
+ import { getTpSlDeleteSigningSpec as Wa } from "./tpsl/signing-spec/get-tpsl-delete-signing-spec.js";
257
+ import { deleteQuoteTpSl as Ga } from "./tpsl/delete-quote-tpsl/delete-quote-tpsl.js";
258
+ import { deleteQuoteTpSlMutationOptions as Ka } from "./tpsl/delete-quote-tpsl/query.js";
259
+ import { getQuoteTpSl as qa } from "./tpsl/get-quote-tpsl/get-quote-tpsl.js";
260
+ import { getQuoteTpSlQueryKey as Ja, getQuoteTpSlQueryOptions as Ya } from "./tpsl/get-quote-tpsl/query.js";
261
+ import { buildConditionalOrderLeg as Xa } from "./tpsl/set-quote-tpsl/build-conditional-order-leg.js";
262
+ import { getTpSlSigningSpec as Za } from "./tpsl/signing-spec/get-tpsl-signing-spec.js";
263
+ import { DEFAULT_TPSL_SLIPPAGE_LOWCAPS as Qa, priceSlippageCalculation as $a } from "./tpsl/slippage.js";
264
+ import { setQuoteTpSl as eo } from "./tpsl/set-quote-tpsl/set-quote-tpsl.js";
265
+ import { setQuoteTpSlMutationOptions as to } from "./tpsl/set-quote-tpsl/query.js";
266
+ import { getTpSlDeleteSigningSpecQueryKey as no, getTpSlDeleteSigningSpecQueryOptions as ro } from "./tpsl/signing-spec/delete-query.js";
267
+ import { getTpSlSigningSpecQueryKey as io, getTpSlSigningSpecQueryOptions as ao } from "./tpsl/signing-spec/query.js";
268
+ import { validateTpSl as oo } from "./tpsl/validate-tpsl.js";
269
+ import { parseTpSlFrame as so } from "./websocket/tpsl/parse-tpsl-frame.js";
270
+ import { watchTpSlNotifications as co } from "./websocket/tpsl/watch-tpsl-notifications.js";
271
+ import { BalanceChangeType as lo, BalanceHistoryFilter as uo, MarginTransferType as fo } from "./balance-history/get-balance-history/types.js";
272
+ import { balanceHistoryFilterToTypes as po } from "./balance-history/get-balance-history/balance-history-filter.js";
273
+ import { toBalanceHistoryRow as mo } from "./balance-history/get-balance-history/to-balance-history-row.js";
274
+ import { getBalanceHistory as ho } from "./balance-history/get-balance-history/get-balance-history.js";
275
+ import { getBalanceHistoryQueryKey as go, getBalanceHistoryQueryOptions as _o } from "./balance-history/get-balance-history/query.js";
276
+ import { toTransferRow as vo } from "./transfers/get-transfer-history/to-transfer-row.js";
277
+ import { getTransferHistory as yo } from "./transfers/get-transfer-history/get-transfer-history.js";
278
+ import { getTransferHistoryQueryKey as bo, getTransferHistoryQueryOptions as xo } from "./transfers/get-transfer-history/query.js";
279
+ export { gi as ADD_MARGIN_TO_NEXT_VA_SELECTOR, Zt as ActionStatus, lo as BalanceChangeType, uo as BalanceHistoryFilter, Yi as DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE, Qa as DEFAULT_TPSL_SLIPPAGE_LOWCAPS, Vr as INSTANT_LAYER_EIP712_DOMAIN_NAME, Hr as INSTANT_LAYER_EIP712_DOMAIN_VERSION, _i as INSTANT_TRADE_REQUIRED_SELECTORS, $r as MARKET_ORDER_DEADLINE_SECONDS, Ni as MAX_INSTANT_CLOSE_BULK_ORDERS, Un as MUON_APP, Wn as MUON_METHOD_PARTY_A_OVERVIEW, Gn as MUON_METHOD_PRICE, Kn as MUON_METHOD_PRICE_RANGE, qn as MUON_METHOD_SETTLE_UPNL, Jn as MUON_METHOD_UPNL_A, Yn as MUON_METHOD_UPNL_A_WITH_SYMBOL_PRICE, Xn as MUON_METHOD_UPNL_B, Zn as MUON_METHOD_UPNL_PAIR, Qn as MUON_METHOD_UPNL_WITH_SYMBOL_PRICE, fo as MarginTransferType, Qt as NotificationType, Xr as ORDER_TYPE_MARKET, jt as OrderType, $i as PRICE_HISTORY_EVENT_TYPES, Mt as PositionType, aa as QuoteCloseEventType, oa as QuoteCloseType, ea as QuoteEventType, zi as QuoteLifecycle, Nt as QuoteStatus, vi as REQUEST_TO_CLOSE_POSITION_SELECTOR, yi as SEND_QUOTE_WITH_AFFILIATE_AND_DATA_SELECTOR, Ur as SIGNED_OPERATION_TYPES, ge as SubAccountIsolationType, r as SymmApiError, i as SymmError, a as SymmioSupportedChainId, Zr as VIRTUAL_ACCOUNT_ISOLATION_TYPE, Pt as WithdrawStatus, Ra as ZERO_LEG, Fr as ZERO_UPNL_SIG, e as accountLayerAbi, f as addMargin, F as addMarginMutationOptions, Ea as aggregateGroupMetrics, Le as allocate, rt as allocateMutationOptions, Bi as applyNotificationToQuotes, ve as approveCollateral, xe as approveCollateralMutationOptions, po as balanceHistoryFilterToTypes, Xa as buildConditionalOrderLeg, za as buildConditionalOrderMessage, Ir as buildQuoteMetadata, Kr as buildSignedOperation, Xt as buildSubscribeMessage, Ba as buildTpSlDeleteMessage, ei as calculateAvailableInstantOpenMargin, Hi as calculateClosePlatformFee, Oi as calculateClosePrice, ka as calculateLiquidationPrice, ti as calculateMargin, Ui as calculateOpenPlatformFee, mn as calculatePriceImpact, Ma as calculateQuoteLeverage, Na as calculateQuotePnl, Pa as calculateQuoteUpnl, ni as calculateTradeParams, kn as checkNotionalCap, ki as clampClosePrecision, $t as classifyNotification, Vi as classifyQuoteNotificationAction, sa as closeTypeToEventTypes, ri as computePlatformFee, nt as createClassicWithdrawPart, l as createConfig, m as createSubAccounts, I as createSubAccountsMutationOptions, Re as deallocate, it as deallocateMutationOptions, Ga as deleteQuoteTpSl, Ka as deleteQuoteTpSlMutationOptions, g as deleteSubAccount, L as deleteSubAccountMutationOptions, v as depositAndAllocateForAccount, R as depositAndAllocateForAccountMutationOptions, b as depositForAccount, z as depositForAccountMutationOptions, S as editAccountName, B as editAccountNameMutationOptions, Lr as encodeAddMarginToNextVA, wi as encodeRequestToClosePosition, Rr as encodeSendQuoteWithAffiliateAndData, ca as eventTypeToCloseType, la as eventTypeToQuoteStatus, V as filterQueryOptions, Be as finalizeWithdrawRequest, at as finalizeWithdrawRequestMutationOptions, Wi as fingerprintQuote, qr as formatSignedOperationPayload, Jr as generateSalt, Va as generateTpSlSalt, C as getAccountBalanceInfo, H as getAccountBalanceInfoQueryKey, U as getAccountBalanceInfoQueryOptions, w as getAccountBalanceOf, W as getAccountBalanceOfQueryKey, G as getAccountBalanceOfQueryOptions, ho as getBalanceHistory, go as getBalanceHistoryQueryKey, _o as getBalanceHistoryQueryOptions, o as getChainConfig, ye as getCollateralAllowance, Se as getCollateralAllowanceQueryKey, Ce as getCollateralAllowanceQueryOptions, be as getCollateralBalance, we as getCollateralBalanceQueryKey, Te as getCollateralBalanceQueryOptions, $n as getDeallocateUpnlSig, er as getDeallocateUpnlSigQueryKey, tr as getDeallocateUpnlSigQueryOptions, De as getDelegationExpiry, je as getDelegationExpiryQueryKey, Me as getDelegationExpiryQueryOptions, Ft as getEnigmaPriceServiceHealth, It as getEnigmaPriceServiceHealthQueryKey, Lt as getEnigmaPriceServiceHealthQueryOptions, Rt as getEnigmaPriceServiceMetadata, zt as getEnigmaPriceServiceMetadataQueryKey, Bt as getEnigmaPriceServiceMetadataQueryOptions, Vt as getEnigmaPriceServicePricesByAddresses, Ht as getEnigmaPriceServicePricesByAddressesQueryKey, Ut as getEnigmaPriceServicePricesByAddressesQueryOptions, Wt as getEnigmaPriceServicePricesByNames, Gt as getEnigmaPriceServicePricesByNamesQueryKey, Kt as getEnigmaPriceServicePricesByNamesQueryOptions, qt as getEnigmaPriceServiceSymbolsInfo, Jt as getEnigmaPriceServiceSymbolsInfoQueryKey, Yt as getEnigmaPriceServiceSymbolsInfoQueryOptions, pn as getEstimatedPrice, hn as getEstimatedPriceQueryKey, gn as getEstimatedPriceQueryOptions, zr as getFakeSendQuoteMuonSignature, Ve as getFeeForUser, ot as getFeeForUserQueryKey, st as getFeeForUserQueryOptions, vn as getFundingInfo, bn as getFundingInfoQueryKey, xn as getFundingInfoQueryOptions, xi as getInstantCloses, Si as getInstantClosesQueryKey, Ci as getInstantClosesQueryOptions, Wr as getInstantLayerEip712Domain, kr as getInstantOpenQuoteId, Ar as getInstantOpenQuoteIdQueryKey, jr as getInstantOpenQuoteIdQueryOptions, Mr as getInstantOpens, Nr as getInstantOpensQueryKey, Pr as getInstantOpensQueryOptions, Oe as getIsDelegationActive, Ne as getIsDelegationActiveQueryKey, Pe as getIsDelegationActiveQueryOptions, He as getLastWithdrawRequestId, ct as getLastWithdrawRequestIdQueryKey, lt as getLastWithdrawRequestIdQueryOptions, En as getLockedParams, Dn as getLockedParamsQueryKey, On as getLockedParamsQueryOptions, Cn as getMarketInfo, wn as getMarketInfoQueryKey, Tn as getMarketInfoQueryOptions, ii as getMarketOrderDeadline, ln as getMarkets, un as getMarketsQueryKey, dn as getMarketsQueryOptions, nr as getMuonPartyAOverview, rr as getMuonPartyAOverviewQueryKey, ir as getMuonPartyAOverviewQueryOptions, ar as getMuonPrice, or as getMuonPriceQueryKey, sr as getMuonPriceQueryOptions, cr as getMuonPriceRange, lr as getMuonPriceRangeQueryKey, ur as getMuonPriceRangeQueryOptions, dr as getMuonSettleUpnl, fr as getMuonSettleUpnlQueryKey, pr as getMuonSettleUpnlQueryOptions, mr as getMuonUpnl, _r as getMuonUpnlA, vr as getMuonUpnlAQueryKey, yr as getMuonUpnlAQueryOptions, br as getMuonUpnlAWithSymbolPrice, xr as getMuonUpnlAWithSymbolPriceQueryKey, Sr as getMuonUpnlAWithSymbolPriceQueryOptions, Cr as getMuonUpnlB, wr as getMuonUpnlBQueryKey, Tr as getMuonUpnlBQueryOptions, hr as getMuonUpnlQueryKey, gr as getMuonUpnlQueryOptions, Er as getMuonUpnlWithSymbolPrice, Dr as getMuonUpnlWithSymbolPriceQueryKey, Or as getMuonUpnlWithSymbolPriceQueryOptions, jn as getNotionalCapAll, In as getNotionalCapAllQueryKey, Ln as getNotionalCapAllQueryOptions, Mn as getNotionalCapBySymbolId, Pn as getNotionalCapBySymbolIdQueryKey, Fn as getNotionalCapBySymbolIdQueryOptions, Ue as getOnchainContractMarkets, ut as getOnchainContractMarketsQueryKey, dt as getOnchainContractMarketsQueryOptions, Nn as getOpenInterestBySymbolId, Rn as getOpenInterestBySymbolIdQueryKey, zn as getOpenInterestBySymbolIdQueryOptions, We as getPartyAOpenPositions, ft as getPartyAOpenPositionsQueryKey, pt as getPartyAOpenPositionsQueryOptions, Ge as getPartyAPendingQuotes, mt as getPartyAPendingQuotesQueryKey, ht as getPartyAPendingQuotesQueryOptions, Ke as getPendingWithdrawRequests, gt as getPendingWithdrawRequestsQueryKey, _t as getPendingWithdrawRequestsQueryOptions, M as getPredictedNextVirtualAccount, oe as getPredictedNextVirtualAccountQueryKey, se as getPredictedNextVirtualAccountQueryOptions, Ki as getQuerySubgraphQueryKey, qe as getQuote, Xi as getQuoteEventsByType, Zi as getQuoteEventsByTypeQueryKey, Qi as getQuoteEventsByTypeQueryOptions, na as getQuoteFunding, ra as getQuoteFundingQueryKey, ia as getQuoteFundingQueryOptions, da as getQuoteHistory, fa as getQuoteHistoryQueryKey, pa as getQuoteHistoryQueryOptions, vt as getQuoteQueryKey, yt as getQuoteQueryOptions, qa as getQuoteTpSl, Ja as getQuoteTpSlQueryKey, Ya as getQuoteTpSlQueryOptions, Bn as getSolverErrorCodes, Vn as getSolverErrorCodesQueryKey, Hn as getSolverErrorCodesQueryOptions, T as getSubAccount, K as getSubAccountQueryKey, q as getSubAccountQueryOptions, ba as getSubAccountQuotes, xa as getSubAccountQuotesQueryKey, Sa as getSubAccountQuotesQueryOptions, E as getSubAccountVirtualNonce, J as getSubAccountVirtualNonceQueryKey, Y as getSubAccountVirtualNonceQueryOptions, D as getSubAccountsCountOfUser, X as getSubAccountsCountOfUserQueryKey, Z as getSubAccountsCountOfUserQueryOptions, Fa as getTpSlConfig, Ia as getTpSlConfigQueryKey, La as getTpSlConfigQueryOptions, Wa as getTpSlDeleteSigningSpec, no as getTpSlDeleteSigningSpecQueryKey, ro as getTpSlDeleteSigningSpecQueryOptions, Za as getTpSlSigningSpec, io as getTpSlSigningSpecQueryKey, ao as getTpSlSigningSpecQueryOptions, yo as getTransferHistory, bo as getTransferHistoryQueryKey, xo as getTransferHistoryQueryOptions, O as getUserSubAccounts, k as getUserSubAccountsAddresses, ee as getUserSubAccountsAddressesQueryKey, te as getUserSubAccountsAddressesQueryOptions, Q as getUserSubAccountsQueryKey, $ as getUserSubAccountsQueryOptions, A as getVirtualAccount, ne as getVirtualAccountQueryKey, re as getVirtualAccountQueryOptions, j as getVirtualAccountsAddressesOfSubAccount, ie as getVirtualAccountsAddressesOfSubAccountQueryKey, ae as getVirtualAccountsAddressesOfSubAccountQueryOptions, Je as getWithdrawRequests, bt as getWithdrawRequestsQueryKey, xt as getWithdrawRequestsQueryOptions, Ye as getWithdrawableTime, St as getWithdrawableTimeQueryKey, Ct as getWithdrawableTimeQueryOptions, Ae as grantDelegation, Fe as grantDelegationMutationOptions, Oa as groupQuotes, Xe as initiateWithdraw, wt as initiateWithdrawMutationOptions, Ei as instantClose, ji as instantCloseAuto, Mi as instantCloseAutoMutationOptions, Pi as instantCloseBulk, Ii as instantCloseBulkAuto, Li as instantCloseBulkAutoMutationOptions, Fi as instantCloseBulkMutationOptions, Di as instantCloseMutationOptions, t as instantLayerAbi, oi as instantOpen, pi as instantOpenAuto, mi as instantOpenAutoMutationOptions, si as instantOpenMutationOptions, Ca as isActivePosition, s as isChainSupported, wa as isPendingOrder, Qr as isolationTypeForSide, ma as lifecycleFromQuoteStatus, c as listSupportedChains, en as normalizeNotification, tn as parseNotificationFrame, rn as parsePriceFrame, so as parseTpSlFrame, Ta as partitionQuotes, Ai as prepareInstantCloseParams, fi as prepareInstantOpenParams, $a as priceSlippageCalculation, yn as projectFundingRate, Gi as querySubgraph, qi as querySubgraphQueryOptions, va as reconcileQuotes, P as removeMargin, ce as removeMarginMutationOptions, Ze as requestCancelWithdraw, Tt as requestCancelWithdrawMutationOptions, ui as resolveFeeRates, di as resolveLockedParams, ci as resolveMarkPrice, li as resolveMarket, ya as resolveQuoteAccounts, Da as resolveQuoteGroupingStrategy, on as searchNotifications, sn as searchNotificationsQueryKey, cn as searchNotificationsQueryOptions, Ti as sendInstantClose, Br as sendInstantOpen, eo as setQuoteTpSl, to as setQuoteTpSlMutationOptions, Aa as shouldAccelerateOnchainReads, ja as shouldAccelerateQuotePolling, u as shouldSimulateBeforeWrite, Yr as signAndFormatInstantOperation, Gr as signSignedOperation, Ua as signTpSlRequest, d as simulateAddMargin, le as simulateAddMarginMutationOptions, Qe as simulateAllocate, Et as simulateAllocateMutationOptions, _e as simulateApproveCollateral, Ee as simulateApproveCollateralMutationOptions, p as simulateCreateSubAccounts, ue as simulateCreateSubAccountsMutationOptions, $e as simulateDeallocate, Dt as simulateDeallocateMutationOptions, h as simulateDeleteSubAccount, de as simulateDeleteSubAccountMutationOptions, _ as simulateDepositAndAllocateForAccount, fe as simulateDepositAndAllocateForAccountMutationOptions, y as simulateDepositForAccount, pe as simulateDepositForAccountMutationOptions, x as simulateEditAccountName, me as simulateEditAccountNameMutationOptions, ze as simulateFinalizeWithdrawRequest, Ot as simulateFinalizeWithdrawRequestMutationOptions, ke as simulateGrantDelegation, Ie as simulateGrantDelegationMutationOptions, et as simulateInitiateWithdraw, kt as simulateInitiateWithdrawMutationOptions, N as simulateRemoveMargin, he as simulateRemoveMarginMutationOptions, tt as simulateRequestCancelWithdraw, At as simulateRequestCancelWithdrawMutationOptions, n as symmioAbi, mo as toBalanceHistoryRow, fn as toEstimatedPrice, _n as toMarketFundingInfo, Sn as toMarketInfo, An as toMarketNotionalCap, bi as toPendingInstantClose, Ji as toQuoteEventRow, ta as toQuoteFundingRow, ua as toQuoteHistoryRow, Ha as toSignableTpSlMessage, vo as toTransferRow, ha as toUnifiedQuoteFromInstantClose, ga as toUnifiedQuoteFromInstantOpen, _a as toUnifiedQuoteFromOnchain, ai as toWeiBigInt, Ri as validateInstantCloseAgainstMarket, hi as validateInstantOpenAgainstMarket, oo as validateTpSl, an as watchEnigmaPrices, nn as watchNotifications, co as watchTpSlNotifications };
@@ -0,0 +1,58 @@
1
+ import { Config } from '../../core/config/index.js';
2
+ import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
3
+ import { PositionType } from '../../symmio-contracts/symmio/types.js';
4
+ /** Whether a price estimate is for **opening** or **closing** a position. */
5
+ export type EstimatedPriceEntry = "open" | "close";
6
+ /**
7
+ * Parameters for {@link getEstimatedPrice}.
8
+ */
9
+ export type GetEstimatedPriceParameters = Compute<ChainIdParameter & {
10
+ /** Solver market id. */
11
+ symbolId: number;
12
+ /** Order quantity (decimal string). */
13
+ quantity: string;
14
+ /** Long or short. */
15
+ positionType: PositionType;
16
+ /** Whether this estimate is for an open or a close. */
17
+ entry: EstimatedPriceEntry;
18
+ /**
19
+ * The price **sent to the solver** — the slippage-adjusted request price the
20
+ * caller computed for the open/close, **not** the raw mark price. The solver
21
+ * prices the fill relative to it.
22
+ */
23
+ price: string;
24
+ }>;
25
+ /**
26
+ * Return type of {@link getEstimatedPrice}.
27
+ */
28
+ export interface GetEstimatedPriceReturnType {
29
+ /** Estimated execution price (decimal string); `"0"` when the solver omits it. */
30
+ estimatedPrice: string;
31
+ }
32
+ /**
33
+ * Ask the solver what price an open or close would actually fill at — a
34
+ * read-only simulation of the trade (`GET /estimated-price`; nothing is
35
+ * submitted). Pass the order `quantity`, the side, whether it's an open or
36
+ * close, and the slippage-adjusted request `price`; the solver returns the price
37
+ * it would fill at, from which the UI derives price impact (see
38
+ * {@link calculatePriceImpact}) and — for a close — an estimated PnL.
39
+ *
40
+ * @param config - The SDK config.
41
+ * @param parameters - Market, quantity, side, entry (open/close), and request price.
42
+ * @returns The estimated execution price.
43
+ * @throws {SymmApiError} when the solver request fails.
44
+ * @throws {SymmError} when the chain is unsupported.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const { estimatedPrice } = await getEstimatedPrice(config, {
49
+ * symbolId: 1,
50
+ * quantity: "1000",
51
+ * positionType: PositionType.LONG,
52
+ * entry: "open",
53
+ * price: requestPrice, // slippage-adjusted, from calculateTradeParams
54
+ * });
55
+ * ```
56
+ */
57
+ export declare function getEstimatedPrice(config: Config, parameters: GetEstimatedPriceParameters): Promise<GetEstimatedPriceReturnType>;
58
+ //# sourceMappingURL=get-estimated-price.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,gBAAgB,GAAG;IACjB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,uDAAuD;IACvD,KAAK,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kFAAkF;IAClF,cAAc,EAAE,MAAM,CAAC;CACxB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,2BAA2B,GACtC,OAAO,CAAC,2BAA2B,CAAC,CA0BtC"}
@@ -0,0 +1,30 @@
1
+ import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
2
+ import { PositionType as n } from "../../symmio-contracts/symmio/types.js";
3
+ import { getEstimatedPrice as r } from "../types/generated/enigma-solver.js";
4
+ import { toEstimatedPrice as i } from "./to-estimated-price.js";
5
+ import { isAxiosError as a } from "axios";
6
+ //#region src/solvers/estimated-price/get-estimated-price.ts
7
+ function o(e) {
8
+ return e === n.SHORT ? "short" : "long";
9
+ }
10
+ async function s(n, s) {
11
+ let { solver: c } = n.getChainConfig(s.chainId);
12
+ try {
13
+ return i((await r({
14
+ symbol_id: s.symbolId,
15
+ quantity: s.quantity,
16
+ position_type: o(s.positionType),
17
+ entry: s.entry,
18
+ price: s.price
19
+ }, { baseURL: c.url })).data);
20
+ } catch (n) {
21
+ throw n instanceof t ? n : a(n) ? e.fromAxios(n, {
22
+ code: "FETCH_ESTIMATED_PRICE_FAILED",
23
+ baseURL: c.url
24
+ }) : new t("api", "FETCH_ESTIMATED_PRICE_FAILED", `Failed to fetch estimated price: ${n instanceof Error ? n.message : String(n)}`, { cause: n instanceof Error ? n : void 0 });
25
+ }
26
+ }
27
+ //#endregion
28
+ export { s as getEstimatedPrice };
29
+
30
+ //# sourceMappingURL=get-estimated-price.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\nimport { getEstimatedPrice as requestEstimatedPrice } from \"../types/generated/enigma-solver\";\nimport { toEstimatedPrice } from \"./to-estimated-price\";\n\n/** Whether a price estimate is for **opening** or **closing** a position. */\nexport type EstimatedPriceEntry = \"open\" | \"close\";\n\n/**\n * Parameters for {@link getEstimatedPrice}.\n */\nexport type GetEstimatedPriceParameters = Compute<\n ChainIdParameter & {\n /** Solver market id. */\n symbolId: number;\n /** Order quantity (decimal string). */\n quantity: string;\n /** Long or short. */\n positionType: PositionType;\n /** Whether this estimate is for an open or a close. */\n entry: EstimatedPriceEntry;\n /**\n * The price **sent to the solver** — the slippage-adjusted request price the\n * caller computed for the open/close, **not** the raw mark price. The solver\n * prices the fill relative to it.\n */\n price: string;\n }\n>;\n\n/**\n * Return type of {@link getEstimatedPrice}.\n */\nexport interface GetEstimatedPriceReturnType {\n /** Estimated execution price (decimal string); `\"0\"` when the solver omits it. */\n estimatedPrice: string;\n}\n\n/** Solver wire value for a position side (`\"long\"` / `\"short\"`). */\nfunction positionTypeToWire(positionType: PositionType): string {\n return positionType === PositionType.SHORT ? \"short\" : \"long\";\n}\n\n/**\n * Ask the solver what price an open or close would actually fill at — a\n * read-only simulation of the trade (`GET /estimated-price`; nothing is\n * submitted). Pass the order `quantity`, the side, whether it's an open or\n * close, and the slippage-adjusted request `price`; the solver returns the price\n * it would fill at, from which the UI derives price impact (see\n * {@link calculatePriceImpact}) and — for a close — an estimated PnL.\n *\n * @param config - The SDK config.\n * @param parameters - Market, quantity, side, entry (open/close), and request price.\n * @returns The estimated execution price.\n * @throws {SymmApiError} when the solver request fails.\n * @throws {SymmError} when the chain is unsupported.\n *\n * @example\n * ```ts\n * const { estimatedPrice } = await getEstimatedPrice(config, {\n * symbolId: 1,\n * quantity: \"1000\",\n * positionType: PositionType.LONG,\n * entry: \"open\",\n * price: requestPrice, // slippage-adjusted, from calculateTradeParams\n * });\n * ```\n */\nexport async function getEstimatedPrice(\n config: Config,\n parameters: GetEstimatedPriceParameters,\n): Promise<GetEstimatedPriceReturnType> {\n const { solver } = config.getChainConfig(parameters.chainId);\n try {\n const response = await requestEstimatedPrice(\n {\n symbol_id: parameters.symbolId,\n quantity: parameters.quantity,\n position_type: positionTypeToWire(parameters.positionType),\n entry: parameters.entry,\n price: parameters.price,\n },\n { baseURL: solver.url },\n );\n return toEstimatedPrice(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_ESTIMATED_PRICE_FAILED\", baseURL: solver.url });\n }\n throw new SymmError(\n \"api\",\n \"FETCH_ESTIMATED_PRICE_FAILED\",\n `Failed to fetch estimated price: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;AA0CA,SAAS,EAAmB,GAAoC;CAC9D,OAAO,MAAiB,EAAa,QAAQ,UAAU;AACzD;AA2BA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,EAAE,cAAW,EAAO,eAAe,EAAW,OAAO;CAC3D,IAAI;EAWF,OAAO,GAAiB,MAVD,EACrB;GACE,WAAW,EAAW;GACtB,UAAU,EAAW;GACrB,eAAe,EAAmB,EAAW,YAAY;GACzD,OAAO,EAAW;GAClB,OAAO,EAAW;EACpB,GACA,EAAE,SAAS,EAAO,IAAI,CACxB,GACiC,IAAI;CACvC,SAAS,GAAK;EAKZ,MAJI,aAAe,IAAiB,IAChC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAgC,SAAS,EAAO;EAAI,CAAC,IAE3F,IAAI,EACR,OACA,gCACA,oCAAoC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KACnF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
@@ -0,0 +1,5 @@
1
+ export * from './get-estimated-price.js';
2
+ export * from './price-impact.js';
3
+ export * from './query.js';
4
+ export * from './to-estimated-price.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Parameters for {@link calculatePriceImpact}.
3
+ */
4
+ export interface CalculatePriceImpactParameters {
5
+ /** Estimated execution price (decimal string). */
6
+ estimatedPrice: string;
7
+ /** Reference price to measure the impact against (decimal string), e.g. the mark. */
8
+ referencePrice: string;
9
+ }
10
+ /**
11
+ * Signed **price-impact percent** of an estimated fill versus a reference price:
12
+ * `(estimated − reference) / reference × 100`. Returns `0` when either input is
13
+ * non-finite or the reference is `0`.
14
+ *
15
+ * The sign is direction-neutral (just the % difference); the UI interprets it by
16
+ * side — for a **long open** a positive impact is worse (you fill above the
17
+ * reference), for a **short open** a negative impact is worse.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const impact = calculatePriceImpact({ estimatedPrice, referencePrice: markPrice }); // e.g. 0.42 → +0.42%
22
+ * ```
23
+ */
24
+ export declare function calculatePriceImpact(parameters: CalculatePriceImpactParameters): number;
25
+ //# sourceMappingURL=price-impact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price-impact.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/price-impact.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,kDAAkD;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,8BAA8B,GAAG,MAAM,CAKvF"}
@@ -0,0 +1,9 @@
1
+ //#region src/solvers/estimated-price/price-impact.ts
2
+ function e(e) {
3
+ let t = Number(e.estimatedPrice), n = Number(e.referencePrice);
4
+ return !Number.isFinite(t) || !Number.isFinite(n) || n === 0 ? 0 : (t - n) / n * 100;
5
+ }
6
+ //#endregion
7
+ export { e as calculatePriceImpact };
8
+
9
+ //# sourceMappingURL=price-impact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price-impact.js","names":[],"sources":["../../../src/solvers/estimated-price/price-impact.ts"],"sourcesContent":["/**\n * Parameters for {@link calculatePriceImpact}.\n */\nexport interface CalculatePriceImpactParameters {\n /** Estimated execution price (decimal string). */\n estimatedPrice: string;\n /** Reference price to measure the impact against (decimal string), e.g. the mark. */\n referencePrice: string;\n}\n\n/**\n * Signed **price-impact percent** of an estimated fill versus a reference price:\n * `(estimated − reference) / reference × 100`. Returns `0` when either input is\n * non-finite or the reference is `0`.\n *\n * The sign is direction-neutral (just the % difference); the UI interprets it by\n * side — for a **long open** a positive impact is worse (you fill above the\n * reference), for a **short open** a negative impact is worse.\n *\n * @example\n * ```ts\n * const impact = calculatePriceImpact({ estimatedPrice, referencePrice: markPrice }); // e.g. 0.42 → +0.42%\n * ```\n */\nexport function calculatePriceImpact(parameters: CalculatePriceImpactParameters): number {\n const estimated = Number(parameters.estimatedPrice);\n const reference = Number(parameters.referencePrice);\n if (!Number.isFinite(estimated) || !Number.isFinite(reference) || reference === 0) return 0;\n return ((estimated - reference) / reference) * 100;\n}\n"],"mappings":";AAwBA,SAAgB,EAAqB,GAAoD;CACvF,IAAM,IAAY,OAAO,EAAW,cAAc,GAC5C,IAAY,OAAO,EAAW,cAAc;CAElD,OADI,CAAC,OAAO,SAAS,CAAS,KAAK,CAAC,OAAO,SAAS,CAAS,KAAK,MAAc,IAAU,KACjF,IAAY,KAAa,IAAa;AACjD"}
@@ -0,0 +1,26 @@
1
+ import { Config } from '../../core/config/index.js';
2
+ import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
3
+ import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
4
+ import { GetEstimatedPriceParameters, GetEstimatedPriceReturnType } from './get-estimated-price.js';
5
+ /** Data resolved by the {@link getEstimatedPriceQueryOptions} query. */
6
+ export type GetEstimatedPriceData = GetEstimatedPriceReturnType;
7
+ /** Build the TanStack Query key for {@link getEstimatedPriceQueryOptions}. */
8
+ export declare function getEstimatedPriceQueryKey(options: Compute<GetEstimatedPriceParameters & ConfigKeyParameter>): readonly ["getEstimatedPrice", Record<string, unknown>];
9
+ /** Query-key type produced by {@link getEstimatedPriceQueryKey}. */
10
+ export type GetEstimatedPriceQueryKey = ReturnType<typeof getEstimatedPriceQueryKey>;
11
+ /** Options accepted by {@link getEstimatedPriceQueryOptions}. */
12
+ export type GetEstimatedPriceOptions = Compute<GetEstimatedPriceParameters & QueryParameter<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>>;
13
+ /** TanStack Query options returned by {@link getEstimatedPriceQueryOptions}. */
14
+ export type GetEstimatedPriceQueryOptions = SymmioQueryOptions<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>;
15
+ /**
16
+ * Build TanStack Query options for {@link getEstimatedPrice}. Disabled until
17
+ * `quantity` and `price` are non-empty, so the estimate does not fire on partial
18
+ * input.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * useQuery(getEstimatedPriceQueryOptions(config, { symbolId, quantity, positionType, entry: "open", price }));
23
+ * ```
24
+ */
25
+ export declare function getEstimatedPriceQueryOptions(config: Config, options: GetEstimatedPriceOptions): GetEstimatedPriceQueryOptions;
26
+ //# sourceMappingURL=query.d.ts.map