@symmio/trading-core 0.2.0 → 1.0.0
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 +2 -2
- package/dist/core/config/create-config.d.ts +40 -4
- package/dist/core/config/create-config.d.ts.map +1 -1
- package/dist/core/config/create-config.js +29 -22
- package/dist/core/config/create-config.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -138
- package/dist/solvers/estimated-price/get-estimated-price.d.ts +58 -0
- package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -0
- package/dist/solvers/estimated-price/get-estimated-price.js +30 -0
- package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -0
- package/dist/solvers/estimated-price/index.d.ts +5 -0
- package/dist/solvers/estimated-price/index.d.ts.map +1 -0
- package/dist/solvers/estimated-price/price-impact.d.ts +25 -0
- package/dist/solvers/estimated-price/price-impact.d.ts.map +1 -0
- package/dist/solvers/estimated-price/price-impact.js +9 -0
- package/dist/solvers/estimated-price/price-impact.js.map +1 -0
- package/dist/solvers/estimated-price/query.d.ts +26 -0
- package/dist/solvers/estimated-price/query.d.ts.map +1 -0
- package/dist/solvers/estimated-price/query.js +28 -0
- package/dist/solvers/estimated-price/query.js.map +1 -0
- package/dist/solvers/estimated-price/to-estimated-price.d.ts +9 -0
- package/dist/solvers/estimated-price/to-estimated-price.d.ts.map +1 -0
- package/dist/solvers/estimated-price/to-estimated-price.js +8 -0
- package/dist/solvers/estimated-price/to-estimated-price.js.map +1 -0
- package/dist/solvers/instant-open/shared/trade-math.d.ts +48 -0
- package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/trade-math.js +5 -1
- package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.js +11 -5
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.js.map +1 -1
- 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 {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import {
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
import {
|
|
149
|
-
import {
|
|
150
|
-
import {
|
|
151
|
-
import {
|
|
152
|
-
import {
|
|
153
|
-
import {
|
|
154
|
-
import {
|
|
155
|
-
import {
|
|
156
|
-
import {
|
|
157
|
-
import {
|
|
158
|
-
import {
|
|
159
|
-
import {
|
|
160
|
-
import {
|
|
161
|
-
import {
|
|
162
|
-
import {
|
|
163
|
-
import {
|
|
164
|
-
import {
|
|
165
|
-
import {
|
|
166
|
-
import {
|
|
167
|
-
import {
|
|
168
|
-
import {
|
|
169
|
-
import {
|
|
170
|
-
import {
|
|
171
|
-
import {
|
|
172
|
-
import {
|
|
173
|
-
import {
|
|
174
|
-
import {
|
|
175
|
-
import {
|
|
176
|
-
import {
|
|
177
|
-
import {
|
|
178
|
-
import {
|
|
179
|
-
import {
|
|
180
|
-
import {
|
|
181
|
-
import {
|
|
182
|
-
import {
|
|
183
|
-
import {
|
|
184
|
-
import {
|
|
185
|
-
import {
|
|
186
|
-
import {
|
|
187
|
-
import {
|
|
188
|
-
import {
|
|
189
|
-
import {
|
|
190
|
-
import {
|
|
191
|
-
import {
|
|
192
|
-
import {
|
|
193
|
-
import {
|
|
194
|
-
import {
|
|
195
|
-
import {
|
|
196
|
-
import {
|
|
197
|
-
import {
|
|
198
|
-
import {
|
|
199
|
-
import {
|
|
200
|
-
import {
|
|
201
|
-
import {
|
|
202
|
-
import {
|
|
203
|
-
import {
|
|
204
|
-
import {
|
|
205
|
-
import {
|
|
206
|
-
import {
|
|
207
|
-
import {
|
|
208
|
-
import {
|
|
209
|
-
import {
|
|
210
|
-
import {
|
|
211
|
-
import {
|
|
212
|
-
import {
|
|
213
|
-
import {
|
|
214
|
-
import {
|
|
215
|
-
import {
|
|
216
|
-
import {
|
|
217
|
-
import {
|
|
218
|
-
import {
|
|
219
|
-
import {
|
|
220
|
-
import {
|
|
221
|
-
import {
|
|
222
|
-
import {
|
|
223
|
-
import {
|
|
224
|
-
import {
|
|
225
|
-
import {
|
|
226
|
-
import {
|
|
227
|
-
import {
|
|
228
|
-
import {
|
|
229
|
-
import {
|
|
230
|
-
import {
|
|
231
|
-
import {
|
|
232
|
-
import {
|
|
233
|
-
import {
|
|
234
|
-
import {
|
|
235
|
-
import {
|
|
236
|
-
import {
|
|
237
|
-
import {
|
|
238
|
-
import {
|
|
239
|
-
import {
|
|
240
|
-
import {
|
|
241
|
-
import {
|
|
242
|
-
import {
|
|
243
|
-
import {
|
|
244
|
-
import {
|
|
245
|
-
import {
|
|
246
|
-
import {
|
|
247
|
-
import {
|
|
248
|
-
import {
|
|
249
|
-
import {
|
|
250
|
-
import {
|
|
251
|
-
import {
|
|
252
|
-
import {
|
|
253
|
-
import {
|
|
254
|
-
import {
|
|
255
|
-
import {
|
|
256
|
-
import {
|
|
257
|
-
import {
|
|
258
|
-
import {
|
|
259
|
-
import {
|
|
260
|
-
import {
|
|
261
|
-
import {
|
|
262
|
-
import {
|
|
263
|
-
import {
|
|
264
|
-
import {
|
|
265
|
-
import {
|
|
266
|
-
import {
|
|
267
|
-
import {
|
|
268
|
-
import {
|
|
269
|
-
import {
|
|
270
|
-
import {
|
|
271
|
-
import {
|
|
272
|
-
import {
|
|
273
|
-
import {
|
|
274
|
-
import {
|
|
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 @@
|
|
|
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
|