@symmio/trading-core 0.1.1 → 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.
Files changed (467) hide show
  1. package/README.md +2 -2
  2. package/dist/balance-history/get-balance-history/balance-history-filter.d.ts +1 -1
  3. package/dist/balance-history/get-balance-history/get-balance-history.d.ts +3 -3
  4. package/dist/balance-history/get-balance-history/index.d.ts +5 -5
  5. package/dist/balance-history/get-balance-history/query-document.d.ts +2 -2
  6. package/dist/balance-history/get-balance-history/query.d.ts +4 -4
  7. package/dist/balance-history/get-balance-history/to-balance-history-row.d.ts +2 -2
  8. package/dist/balance-history/index.d.ts +1 -1
  9. package/dist/core/chains/actions/get-chain-config.d.ts +1 -1
  10. package/dist/core/chains/actions/list-supported-chains.d.ts +1 -1
  11. package/dist/core/chains/index.d.ts +5 -5
  12. package/dist/core/chains/registry.d.ts +1 -1
  13. package/dist/core/config/config-key.d.ts +1 -1
  14. package/dist/core/config/create-config.d.ts +44 -8
  15. package/dist/core/config/create-config.d.ts.map +1 -1
  16. package/dist/core/config/create-config.js +29 -22
  17. package/dist/core/config/create-config.js.map +1 -1
  18. package/dist/core/config/index.d.ts +1 -1
  19. package/dist/core/config/merge-chain-config.d.ts +2 -2
  20. package/dist/index.d.ts +58 -41
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +142 -127
  23. package/dist/muon/client.d.ts +1 -1
  24. package/dist/muon/deallocate-upnl-sig/get-deallocate-upnl-sig.d.ts +3 -3
  25. package/dist/muon/deallocate-upnl-sig/index.d.ts +2 -2
  26. package/dist/muon/deallocate-upnl-sig/query.d.ts +4 -4
  27. package/dist/muon/index.d.ts +11 -11
  28. package/dist/muon/party-a-overview/get-muon-party-a-overview.d.ts +4 -4
  29. package/dist/muon/party-a-overview/get-muon-party-a-overview.d.ts.map +1 -1
  30. package/dist/muon/party-a-overview/get-muon-party-a-overview.js.map +1 -1
  31. package/dist/muon/party-a-overview/index.d.ts +2 -2
  32. package/dist/muon/party-a-overview/query.d.ts +4 -4
  33. package/dist/muon/price/get-muon-price.d.ts +3 -3
  34. package/dist/muon/price/index.d.ts +2 -2
  35. package/dist/muon/price/query.d.ts +4 -4
  36. package/dist/muon/price-range/get-muon-price-range.d.ts +4 -4
  37. package/dist/muon/price-range/get-muon-price-range.d.ts.map +1 -1
  38. package/dist/muon/price-range/get-muon-price-range.js.map +1 -1
  39. package/dist/muon/price-range/index.d.ts +2 -2
  40. package/dist/muon/price-range/query.d.ts +4 -4
  41. package/dist/muon/settle-upnl/get-muon-settle-upnl.d.ts +4 -4
  42. package/dist/muon/settle-upnl/get-muon-settle-upnl.d.ts.map +1 -1
  43. package/dist/muon/settle-upnl/get-muon-settle-upnl.js.map +1 -1
  44. package/dist/muon/settle-upnl/index.d.ts +2 -2
  45. package/dist/muon/settle-upnl/query.d.ts +4 -4
  46. package/dist/muon/upnl/get-muon-upnl.d.ts +4 -4
  47. package/dist/muon/upnl/get-muon-upnl.d.ts.map +1 -1
  48. package/dist/muon/upnl/get-muon-upnl.js.map +1 -1
  49. package/dist/muon/upnl/index.d.ts +2 -2
  50. package/dist/muon/upnl/query.d.ts +4 -4
  51. package/dist/muon/upnl-a/get-muon-upnl-a.d.ts +4 -4
  52. package/dist/muon/upnl-a/get-muon-upnl-a.d.ts.map +1 -1
  53. package/dist/muon/upnl-a/get-muon-upnl-a.js.map +1 -1
  54. package/dist/muon/upnl-a/index.d.ts +2 -2
  55. package/dist/muon/upnl-a/query.d.ts +4 -4
  56. package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.d.ts +4 -4
  57. package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.d.ts.map +1 -1
  58. package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.js.map +1 -1
  59. package/dist/muon/upnl-a-with-symbol-price/index.d.ts +2 -2
  60. package/dist/muon/upnl-a-with-symbol-price/query.d.ts +4 -4
  61. package/dist/muon/upnl-b/get-muon-upnl-b.d.ts +3 -3
  62. package/dist/muon/upnl-b/index.d.ts +2 -2
  63. package/dist/muon/upnl-b/query.d.ts +4 -4
  64. package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.d.ts +4 -4
  65. package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.d.ts.map +1 -1
  66. package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.js.map +1 -1
  67. package/dist/muon/upnl-with-symbol-price/index.d.ts +2 -2
  68. package/dist/muon/upnl-with-symbol-price/query.d.ts +4 -4
  69. package/dist/notifications/index.d.ts +2 -2
  70. package/dist/notifications/search/index.d.ts +2 -2
  71. package/dist/notifications/search/query.d.ts +4 -4
  72. package/dist/notifications/search/search-notifications.d.ts +3 -3
  73. package/dist/notifications/types.d.ts +1 -1
  74. package/dist/price-service/enigma/health/get-enigma-price-service-health.d.ts +2 -2
  75. package/dist/price-service/enigma/health/index.d.ts +2 -2
  76. package/dist/price-service/enigma/health/query.d.ts +4 -4
  77. package/dist/price-service/enigma/index.d.ts +5 -5
  78. package/dist/price-service/enigma/metadata/get-enigma-price-service-metadata.d.ts +3 -3
  79. package/dist/price-service/enigma/metadata/index.d.ts +2 -2
  80. package/dist/price-service/enigma/metadata/query.d.ts +4 -4
  81. package/dist/price-service/enigma/prices-by-addresses/get-enigma-price-service-prices-by-addresses.d.ts +3 -3
  82. package/dist/price-service/enigma/prices-by-addresses/index.d.ts +2 -2
  83. package/dist/price-service/enigma/prices-by-addresses/query.d.ts +4 -4
  84. package/dist/price-service/enigma/prices-by-names/get-enigma-price-service-prices-by-names.d.ts +3 -3
  85. package/dist/price-service/enigma/prices-by-names/index.d.ts +2 -2
  86. package/dist/price-service/enigma/prices-by-names/query.d.ts +4 -4
  87. package/dist/price-service/enigma/symbols-info/get-enigma-price-service-symbols-info.d.ts +3 -3
  88. package/dist/price-service/enigma/symbols-info/index.d.ts +2 -2
  89. package/dist/price-service/enigma/symbols-info/query.d.ts +4 -4
  90. package/dist/price-service/index.d.ts +1 -1
  91. package/dist/quotes/apply-notification.d.ts +2 -2
  92. package/dist/quotes/fees/index.d.ts +2 -2
  93. package/dist/quotes/fingerprint.d.ts +1 -1
  94. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts +3 -3
  95. package/dist/quotes/get-quote-events-by-type/index.d.ts +4 -4
  96. package/dist/quotes/get-quote-events-by-type/query-document.d.ts +2 -2
  97. package/dist/quotes/get-quote-events-by-type/query.d.ts +5 -5
  98. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts +2 -2
  99. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +3 -3
  100. package/dist/quotes/get-quote-funding/index.d.ts +4 -4
  101. package/dist/quotes/get-quote-funding/query-document.d.ts +1 -1
  102. package/dist/quotes/get-quote-funding/query.d.ts +4 -4
  103. package/dist/quotes/get-quote-funding/to-funding-row.d.ts +2 -2
  104. package/dist/quotes/get-quote-history/close-type.d.ts +2 -2
  105. package/dist/quotes/get-quote-history/get-quote-history.d.ts +3 -3
  106. package/dist/quotes/get-quote-history/index.d.ts +5 -5
  107. package/dist/quotes/get-quote-history/query-document.d.ts +2 -2
  108. package/dist/quotes/get-quote-history/query.d.ts +4 -4
  109. package/dist/quotes/get-quote-history/to-history-row.d.ts +2 -2
  110. package/dist/quotes/get-quote-history/types.d.ts +1 -1
  111. package/dist/quotes/get-sub-account-quotes/get-sub-account-quotes.d.ts +3 -3
  112. package/dist/quotes/get-sub-account-quotes/index.d.ts +2 -2
  113. package/dist/quotes/get-sub-account-quotes/query.d.ts +4 -4
  114. package/dist/quotes/grouping/aggregate-metrics.d.ts +2 -2
  115. package/dist/quotes/grouping/group-quotes.d.ts +2 -2
  116. package/dist/quotes/grouping/group-strategy.d.ts +1 -1
  117. package/dist/quotes/grouping/index.d.ts +5 -5
  118. package/dist/quotes/grouping/partition-quotes.d.ts +1 -1
  119. package/dist/quotes/grouping/quote-group.d.ts +3 -3
  120. package/dist/quotes/index.d.ts +16 -16
  121. package/dist/quotes/liquidation/calculate-liquidation-price.d.ts +1 -1
  122. package/dist/quotes/liquidation/index.d.ts +1 -1
  123. package/dist/quotes/open-quantity.d.ts +1 -1
  124. package/dist/quotes/reconcile-quotes.d.ts +5 -5
  125. package/dist/quotes/resolve-quote-accounts.d.ts +3 -3
  126. package/dist/quotes/should-accelerate.d.ts +1 -1
  127. package/dist/quotes/to-unified-quote.d.ts +4 -4
  128. package/dist/quotes/unified-quote.d.ts +3 -3
  129. package/dist/quotes/upnl/calculate-quote-pnl.d.ts +1 -1
  130. package/dist/quotes/upnl/calculate-quote-upnl.d.ts +1 -1
  131. package/dist/quotes/upnl/index.d.ts +3 -3
  132. package/dist/shared/utils/simulate-before-write.d.ts +2 -2
  133. package/dist/solvers/error-codes/get-solver-error-codes.d.ts +2 -2
  134. package/dist/solvers/error-codes/index.d.ts +2 -2
  135. package/dist/solvers/error-codes/query.d.ts +4 -4
  136. package/dist/solvers/estimated-price/get-estimated-price.d.ts +58 -0
  137. package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -0
  138. package/dist/solvers/estimated-price/get-estimated-price.js +30 -0
  139. package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -0
  140. package/dist/solvers/estimated-price/index.d.ts +5 -0
  141. package/dist/solvers/estimated-price/index.d.ts.map +1 -0
  142. package/dist/solvers/estimated-price/price-impact.d.ts +25 -0
  143. package/dist/solvers/estimated-price/price-impact.d.ts.map +1 -0
  144. package/dist/solvers/estimated-price/price-impact.js +9 -0
  145. package/dist/solvers/estimated-price/price-impact.js.map +1 -0
  146. package/dist/solvers/estimated-price/query.d.ts +26 -0
  147. package/dist/solvers/estimated-price/query.d.ts.map +1 -0
  148. package/dist/solvers/estimated-price/query.js +28 -0
  149. package/dist/solvers/estimated-price/query.js.map +1 -0
  150. package/dist/solvers/estimated-price/to-estimated-price.d.ts +9 -0
  151. package/dist/solvers/estimated-price/to-estimated-price.d.ts.map +1 -0
  152. package/dist/solvers/estimated-price/to-estimated-price.js +8 -0
  153. package/dist/solvers/estimated-price/to-estimated-price.js.map +1 -0
  154. package/dist/solvers/funding-info/get-funding-info.d.ts +37 -0
  155. package/dist/solvers/funding-info/get-funding-info.d.ts.map +1 -0
  156. package/dist/solvers/funding-info/get-funding-info.js +24 -0
  157. package/dist/solvers/funding-info/get-funding-info.js.map +1 -0
  158. package/dist/solvers/funding-info/index.d.ts +6 -0
  159. package/dist/solvers/funding-info/index.d.ts.map +1 -0
  160. package/dist/solvers/funding-info/project-funding-rate.d.ts +30 -0
  161. package/dist/solvers/funding-info/project-funding-rate.d.ts.map +1 -0
  162. package/dist/solvers/funding-info/project-funding-rate.js +9 -0
  163. package/dist/solvers/funding-info/project-funding-rate.js.map +1 -0
  164. package/dist/solvers/funding-info/query.d.ts +28 -0
  165. package/dist/solvers/funding-info/query.d.ts.map +1 -0
  166. package/dist/solvers/funding-info/query.js +24 -0
  167. package/dist/solvers/funding-info/query.js.map +1 -0
  168. package/dist/solvers/funding-info/to-funding-info.d.ts +14 -0
  169. package/dist/solvers/funding-info/to-funding-info.d.ts.map +1 -0
  170. package/dist/solvers/funding-info/to-funding-info.js +15 -0
  171. package/dist/solvers/funding-info/to-funding-info.js.map +1 -0
  172. package/dist/solvers/funding-info/types.d.ts +35 -0
  173. package/dist/solvers/funding-info/types.d.ts.map +1 -0
  174. package/dist/solvers/instant-close/get-instant-closes/get-instant-closes.d.ts +3 -3
  175. package/dist/solvers/instant-close/get-instant-closes/index.d.ts +3 -3
  176. package/dist/solvers/instant-close/get-instant-closes/query.d.ts +4 -4
  177. package/dist/solvers/instant-close/get-instant-closes/to-pending-instant-close.d.ts +1 -1
  178. package/dist/solvers/instant-close/index.d.ts +7 -7
  179. package/dist/solvers/instant-close/instant-close/index.d.ts +2 -2
  180. package/dist/solvers/instant-close/instant-close/instant-close.d.ts +3 -3
  181. package/dist/solvers/instant-close/instant-close/query.d.ts +3 -3
  182. package/dist/solvers/instant-close/instant-close-auto/index.d.ts +2 -2
  183. package/dist/solvers/instant-close/instant-close-auto/instant-close-auto.d.ts +3 -3
  184. package/dist/solvers/instant-close/instant-close-auto/query.d.ts +3 -3
  185. package/dist/solvers/instant-close/instant-close-bulk/index.d.ts +2 -2
  186. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.d.ts +3 -3
  187. package/dist/solvers/instant-close/instant-close-bulk/query.d.ts +3 -3
  188. package/dist/solvers/instant-close/instant-close-bulk-auto/index.d.ts +2 -2
  189. package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.d.ts +4 -4
  190. package/dist/solvers/instant-close/instant-close-bulk-auto/query.d.ts +3 -3
  191. package/dist/solvers/instant-close/prepare-instant-close-params/index.d.ts +1 -1
  192. package/dist/solvers/instant-close/prepare-instant-close-params/prepare-instant-close-params.d.ts +4 -4
  193. package/dist/solvers/instant-close/shared/close-math.d.ts +1 -1
  194. package/dist/solvers/instant-close/shared/hedger-api.d.ts +3 -3
  195. package/dist/solvers/instant-close/shared/index.d.ts +5 -5
  196. package/dist/solvers/instant-close/shared/quote-constraints.d.ts +1 -1
  197. package/dist/solvers/instant-close/shared/types.d.ts +2 -2
  198. package/dist/solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.d.ts +2 -2
  199. package/dist/solvers/instant-open/get-instant-open-quote-id/index.d.ts +2 -2
  200. package/dist/solvers/instant-open/get-instant-open-quote-id/query.d.ts +4 -4
  201. package/dist/solvers/instant-open/get-instant-opens/get-instant-opens.d.ts +3 -3
  202. package/dist/solvers/instant-open/get-instant-opens/index.d.ts +3 -3
  203. package/dist/solvers/instant-open/get-instant-opens/query.d.ts +4 -4
  204. package/dist/solvers/instant-open/get-instant-opens/to-pending-instant-open.d.ts +2 -2
  205. package/dist/solvers/instant-open/index.d.ts +6 -6
  206. package/dist/solvers/instant-open/instant-open/index.d.ts +2 -2
  207. package/dist/solvers/instant-open/instant-open/instant-open.d.ts +3 -3
  208. package/dist/solvers/instant-open/instant-open/query.d.ts +3 -3
  209. package/dist/solvers/instant-open/instant-open-auto/index.d.ts +2 -2
  210. package/dist/solvers/instant-open/instant-open-auto/instant-open-auto.d.ts +3 -3
  211. package/dist/solvers/instant-open/instant-open-auto/query.d.ts +3 -3
  212. package/dist/solvers/instant-open/prepare-instant-open-params/index.d.ts +2 -2
  213. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts +6 -6
  214. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/index.d.ts +4 -4
  215. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.d.ts +3 -3
  216. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.d.ts +3 -3
  217. package/dist/solvers/instant-open/shared/calldata.d.ts +1 -1
  218. package/dist/solvers/instant-open/shared/eip712.d.ts +2 -2
  219. package/dist/solvers/instant-open/shared/hedger-api.d.ts +3 -3
  220. package/dist/solvers/instant-open/shared/index.d.ts +8 -8
  221. package/dist/solvers/instant-open/shared/operations.d.ts +2 -2
  222. package/dist/solvers/instant-open/shared/quote-constraints.d.ts +3 -3
  223. package/dist/solvers/instant-open/shared/trade-math.d.ts +49 -1
  224. package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
  225. package/dist/solvers/instant-open/shared/trade-math.js +5 -1
  226. package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
  227. package/dist/solvers/instant-open/shared/types.d.ts +4 -4
  228. package/dist/solvers/locked-params/get-locked-params.d.ts +3 -3
  229. package/dist/solvers/locked-params/index.d.ts +3 -3
  230. package/dist/solvers/locked-params/query.d.ts +4 -4
  231. package/dist/solvers/market-info/get-market-info.d.ts +32 -0
  232. package/dist/solvers/market-info/get-market-info.d.ts.map +1 -0
  233. package/dist/solvers/market-info/get-market-info.js +23 -0
  234. package/dist/solvers/market-info/get-market-info.js.map +1 -0
  235. package/dist/solvers/market-info/index.d.ts +5 -0
  236. package/dist/solvers/market-info/index.d.ts.map +1 -0
  237. package/dist/solvers/market-info/query.d.ts +29 -0
  238. package/dist/solvers/market-info/query.d.ts.map +1 -0
  239. package/dist/solvers/market-info/query.js +21 -0
  240. package/dist/solvers/market-info/query.js.map +1 -0
  241. package/dist/solvers/market-info/to-market-info.d.ts +13 -0
  242. package/dist/solvers/market-info/to-market-info.d.ts.map +1 -0
  243. package/dist/solvers/market-info/to-market-info.js +28 -0
  244. package/dist/solvers/market-info/to-market-info.js.map +1 -0
  245. package/dist/solvers/market-info/types.d.ts +32 -0
  246. package/dist/solvers/market-info/types.d.ts.map +1 -0
  247. package/dist/solvers/markets/get-markets.d.ts +3 -3
  248. package/dist/solvers/markets/index.d.ts +3 -3
  249. package/dist/solvers/markets/query.d.ts +4 -4
  250. package/dist/solvers/notional-cap/check-notional-cap.d.ts +2 -2
  251. package/dist/solvers/notional-cap/get-notional-cap-all.d.ts +3 -3
  252. package/dist/solvers/notional-cap/get-notional-cap-all.d.ts.map +1 -1
  253. package/dist/solvers/notional-cap/get-notional-cap-all.js +1 -5
  254. package/dist/solvers/notional-cap/get-notional-cap-all.js.map +1 -1
  255. package/dist/solvers/notional-cap/get-notional-cap-by-symbol-id.d.ts +3 -3
  256. package/dist/solvers/notional-cap/get-open-interest-by-symbol-id.d.ts +2 -2
  257. package/dist/solvers/notional-cap/index.d.ts +9 -9
  258. package/dist/solvers/notional-cap/query-all.d.ts +4 -4
  259. package/dist/solvers/notional-cap/query-open-interest.d.ts +4 -4
  260. package/dist/solvers/notional-cap/query.d.ts +4 -4
  261. package/dist/solvers/notional-cap/to-market-notional-cap.d.ts +2 -2
  262. package/dist/solvers/notional-cap/to-market-notional-cap.d.ts.map +1 -1
  263. package/dist/solvers/notional-cap/to-market-notional-cap.js +1 -5
  264. package/dist/solvers/notional-cap/to-market-notional-cap.js.map +1 -1
  265. package/dist/solvers/shared/index.d.ts +1 -1
  266. package/dist/solvers/shared/resolvers/index.d.ts +3 -3
  267. package/dist/solvers/shared/resolvers/resolve-mark-price.d.ts +1 -1
  268. package/dist/solvers/shared/resolvers/resolve-market.d.ts +2 -2
  269. package/dist/solvers/types/generated/enigma-solver.js +16 -4
  270. package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
  271. package/dist/symmio-contracts/abi/index.d.ts +3 -3
  272. package/dist/symmio-contracts/abi/v0.8.5/index.d.ts +3 -3
  273. package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +2 -2
  274. package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +3 -3
  275. package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +2 -2
  276. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +2 -2
  277. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +2 -2
  278. package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +2 -2
  279. package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.d.ts +3 -3
  280. package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts +2 -2
  281. package/dist/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.d.ts +2 -2
  282. package/dist/symmio-contracts/account-layer/actions/get-sub-account.d.ts +3 -3
  283. package/dist/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.d.ts +2 -2
  284. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.d.ts +3 -3
  285. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.js.map +1 -1
  286. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.d.ts +4 -4
  287. package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.js.map +1 -1
  288. package/dist/symmio-contracts/account-layer/actions/get-virtual-account.d.ts +3 -3
  289. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.d.ts +2 -2
  290. package/dist/symmio-contracts/account-layer/actions/predict-next-virtual-account.d.ts +3 -3
  291. package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +3 -3
  292. package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.d.ts +4 -4
  293. package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.d.ts +4 -4
  294. package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.d.ts +4 -4
  295. package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.d.ts +4 -4
  296. package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.d.ts +4 -4
  297. package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.d.ts +4 -4
  298. package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.d.ts +4 -4
  299. package/dist/symmio-contracts/account-layer/index.d.ts +49 -49
  300. package/dist/symmio-contracts/account-layer/query/add-margin.d.ts +2 -2
  301. package/dist/symmio-contracts/account-layer/query/create-sub-accounts.d.ts +2 -2
  302. package/dist/symmio-contracts/account-layer/query/delete-sub-account.d.ts +2 -2
  303. package/dist/symmio-contracts/account-layer/query/deposit-and-allocate-for-account.d.ts +2 -2
  304. package/dist/symmio-contracts/account-layer/query/deposit-for-account.d.ts +2 -2
  305. package/dist/symmio-contracts/account-layer/query/edit-account-name.d.ts +2 -2
  306. package/dist/symmio-contracts/account-layer/query/get-account-balance-info.d.ts +4 -4
  307. package/dist/symmio-contracts/account-layer/query/get-account-balance-of.d.ts +4 -4
  308. package/dist/symmio-contracts/account-layer/query/get-sub-account-virtual-nonce.d.ts +4 -4
  309. package/dist/symmio-contracts/account-layer/query/get-sub-account.d.ts +4 -4
  310. package/dist/symmio-contracts/account-layer/query/get-sub-accounts-count-of-user.d.ts +4 -4
  311. package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts-addresses.d.ts +4 -4
  312. package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts.d.ts +4 -4
  313. package/dist/symmio-contracts/account-layer/query/get-virtual-account.d.ts +4 -4
  314. package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-addresses-of-sub-account.d.ts +4 -4
  315. package/dist/symmio-contracts/account-layer/query/predict-next-virtual-account.d.ts +4 -4
  316. package/dist/symmio-contracts/account-layer/query/remove-margin.d.ts +2 -2
  317. package/dist/symmio-contracts/account-layer/query/simulate-add-margin.d.ts +3 -3
  318. package/dist/symmio-contracts/account-layer/query/simulate-create-sub-accounts.d.ts +3 -3
  319. package/dist/symmio-contracts/account-layer/query/simulate-delete-sub-account.d.ts +3 -3
  320. package/dist/symmio-contracts/account-layer/query/simulate-deposit-and-allocate-for-account.d.ts +3 -3
  321. package/dist/symmio-contracts/account-layer/query/simulate-deposit-for-account.d.ts +3 -3
  322. package/dist/symmio-contracts/account-layer/query/simulate-edit-account-name.d.ts +3 -3
  323. package/dist/symmio-contracts/account-layer/query/simulate-remove-margin.d.ts +3 -3
  324. package/dist/symmio-contracts/collateral/actions/approve-collateral.d.ts +2 -2
  325. package/dist/symmio-contracts/collateral/actions/get-collateral-allowance.d.ts +2 -2
  326. package/dist/symmio-contracts/collateral/actions/get-collateral-balance.d.ts +2 -2
  327. package/dist/symmio-contracts/collateral/actions/simulate-approve-collateral.d.ts +3 -3
  328. package/dist/symmio-contracts/collateral/index.d.ts +8 -8
  329. package/dist/symmio-contracts/collateral/query/approve-collateral.d.ts +2 -2
  330. package/dist/symmio-contracts/collateral/query/get-collateral-allowance.d.ts +4 -4
  331. package/dist/symmio-contracts/collateral/query/get-collateral-balance.d.ts +4 -4
  332. package/dist/symmio-contracts/collateral/query/simulate-approve-collateral.d.ts +3 -3
  333. package/dist/symmio-contracts/instant-layer/actions/get-delegation-expiry.d.ts +2 -2
  334. package/dist/symmio-contracts/instant-layer/actions/get-is-delegation-active.d.ts +2 -2
  335. package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +3 -3
  336. package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.d.ts +4 -4
  337. package/dist/symmio-contracts/instant-layer/index.d.ts +9 -9
  338. package/dist/symmio-contracts/instant-layer/query/get-delegation-expiry.d.ts +4 -4
  339. package/dist/symmio-contracts/instant-layer/query/get-is-delegation-active.d.ts +4 -4
  340. package/dist/symmio-contracts/instant-layer/query/grant-delegation.d.ts +2 -2
  341. package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegation.d.ts +3 -3
  342. package/dist/symmio-contracts/symmio/actions/allocate.d.ts +2 -2
  343. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +3 -3
  344. package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts +2 -2
  345. package/dist/symmio-contracts/symmio/actions/get-fee-for-user.d.ts +2 -2
  346. package/dist/symmio-contracts/symmio/actions/get-last-withdraw-request-id.d.ts +2 -2
  347. package/dist/symmio-contracts/symmio/actions/get-onchain-contract-markets.d.ts +2 -2
  348. package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.d.ts +4 -4
  349. package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.d.ts.map +1 -1
  350. package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.js.map +1 -1
  351. package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.d.ts +3 -3
  352. package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.d.ts.map +1 -1
  353. package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.js.map +1 -1
  354. package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.d.ts +3 -3
  355. package/dist/symmio-contracts/symmio/actions/get-quote.d.ts +3 -3
  356. package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.d.ts +3 -3
  357. package/dist/symmio-contracts/symmio/actions/get-withdrawable-time.d.ts +2 -2
  358. package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +3 -3
  359. package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts +2 -2
  360. package/dist/symmio-contracts/symmio/actions/simulate-allocate.d.ts +4 -4
  361. package/dist/symmio-contracts/symmio/actions/simulate-deallocate.d.ts +4 -4
  362. package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.d.ts +4 -4
  363. package/dist/symmio-contracts/symmio/actions/simulate-initiate-withdraw.d.ts +4 -4
  364. package/dist/symmio-contracts/symmio/actions/simulate-request-cancel-withdraw.d.ts +4 -4
  365. package/dist/symmio-contracts/symmio/index.d.ts +40 -40
  366. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts +1 -1
  367. package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.d.ts +2 -2
  368. package/dist/symmio-contracts/symmio/parts.d.ts +1 -1
  369. package/dist/symmio-contracts/symmio/query/allocate.d.ts +2 -2
  370. package/dist/symmio-contracts/symmio/query/deallocate.d.ts +2 -2
  371. package/dist/symmio-contracts/symmio/query/finalize-withdraw-request.d.ts +2 -2
  372. package/dist/symmio-contracts/symmio/query/get-fee-for-user.d.ts +4 -4
  373. package/dist/symmio-contracts/symmio/query/get-last-withdraw-request-id.d.ts +4 -4
  374. package/dist/symmio-contracts/symmio/query/get-onchain-contract-markets.d.ts +4 -4
  375. package/dist/symmio-contracts/symmio/query/get-party-a-open-positions.d.ts +4 -4
  376. package/dist/symmio-contracts/symmio/query/get-party-a-pending-quotes.d.ts +4 -4
  377. package/dist/symmio-contracts/symmio/query/get-pending-withdraw-requests.d.ts +4 -4
  378. package/dist/symmio-contracts/symmio/query/get-quote.d.ts +4 -4
  379. package/dist/symmio-contracts/symmio/query/get-withdraw-requests.d.ts +4 -4
  380. package/dist/symmio-contracts/symmio/query/get-withdrawable-time.d.ts +4 -4
  381. package/dist/symmio-contracts/symmio/query/initiate-withdraw.d.ts +2 -2
  382. package/dist/symmio-contracts/symmio/query/request-cancel-withdraw.d.ts +2 -2
  383. package/dist/symmio-contracts/symmio/query/simulate-allocate.d.ts +3 -3
  384. package/dist/symmio-contracts/symmio/query/simulate-deallocate.d.ts +3 -3
  385. package/dist/symmio-contracts/symmio/query/simulate-finalize-withdraw-request.d.ts +3 -3
  386. package/dist/symmio-contracts/symmio/query/simulate-initiate-withdraw.d.ts +3 -3
  387. package/dist/symmio-contracts/symmio/query/simulate-request-cancel-withdraw.d.ts +3 -3
  388. package/dist/symmio-contracts/symmio/types.d.ts +1 -1
  389. package/dist/symmio-contracts/symmio/types.d.ts.map +1 -1
  390. package/dist/symmio-contracts/symmio/types.js.map +1 -1
  391. package/dist/symmio-subgraph/index.d.ts +1 -1
  392. package/dist/symmio-subgraph/query-subgraph/index.d.ts +2 -2
  393. package/dist/symmio-subgraph/query-subgraph/query-subgraph.d.ts +3 -3
  394. package/dist/symmio-subgraph/query-subgraph/query.d.ts +4 -4
  395. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +4 -4
  396. package/dist/symmio-subgraph/types/generated/analytics/index.d.ts +1 -1
  397. package/dist/symmio-subgraph/types/generated/events/gql.d.ts +1 -1
  398. package/dist/symmio-subgraph/types/generated/events/index.d.ts +1 -1
  399. package/dist/tpsl/config/get-tpsl-config.d.ts +3 -3
  400. package/dist/tpsl/config/index.d.ts +2 -2
  401. package/dist/tpsl/config/query.d.ts +4 -4
  402. package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.d.ts +37 -0
  403. package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.d.ts.map +1 -0
  404. package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.js +43 -0
  405. package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.js.map +1 -0
  406. package/dist/tpsl/delete-quote-tpsl/index.d.ts +3 -0
  407. package/dist/tpsl/delete-quote-tpsl/index.d.ts.map +1 -0
  408. package/dist/tpsl/delete-quote-tpsl/query.d.ts +15 -0
  409. package/dist/tpsl/delete-quote-tpsl/query.d.ts.map +1 -0
  410. package/dist/tpsl/delete-quote-tpsl/query.js +12 -0
  411. package/dist/tpsl/delete-quote-tpsl/query.js.map +1 -0
  412. package/dist/tpsl/get-quote-tpsl/get-quote-tpsl.d.ts +4 -4
  413. package/dist/tpsl/get-quote-tpsl/index.d.ts +2 -2
  414. package/dist/tpsl/get-quote-tpsl/query.d.ts +7 -5
  415. package/dist/tpsl/get-quote-tpsl/query.d.ts.map +1 -1
  416. package/dist/tpsl/get-quote-tpsl/query.js +4 -1
  417. package/dist/tpsl/get-quote-tpsl/query.js.map +1 -1
  418. package/dist/tpsl/index.d.ts +8 -7
  419. package/dist/tpsl/index.d.ts.map +1 -1
  420. package/dist/tpsl/internal/resolve-tpsl-config.d.ts +2 -2
  421. package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.d.ts +1 -1
  422. package/dist/tpsl/set-quote-tpsl/build-conditional-order-message.d.ts +1 -1
  423. package/dist/tpsl/set-quote-tpsl/index.d.ts +5 -5
  424. package/dist/tpsl/set-quote-tpsl/query.d.ts +3 -3
  425. package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.d.ts +4 -4
  426. package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.js +11 -11
  427. package/dist/tpsl/set-quote-tpsl/sign-tpsl-request.d.ts +2 -2
  428. package/dist/tpsl/signing-spec/delete-query.d.ts +12 -0
  429. package/dist/tpsl/signing-spec/delete-query.d.ts.map +1 -0
  430. package/dist/tpsl/signing-spec/delete-query.js +21 -0
  431. package/dist/tpsl/signing-spec/delete-query.js.map +1 -0
  432. package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.d.ts +18 -0
  433. package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.d.ts.map +1 -0
  434. package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.js +25 -0
  435. package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.js.map +1 -0
  436. package/dist/tpsl/signing-spec/get-tpsl-signing-spec.d.ts +3 -3
  437. package/dist/tpsl/signing-spec/index.d.ts +4 -2
  438. package/dist/tpsl/signing-spec/index.d.ts.map +1 -1
  439. package/dist/tpsl/signing-spec/query.d.ts +4 -4
  440. package/dist/tpsl/slippage.d.ts +1 -1
  441. package/dist/tpsl/types/generated/tpsl-handler.js +6 -3
  442. package/dist/tpsl/types/generated/tpsl-handler.js.map +1 -1
  443. package/dist/tpsl/validate-tpsl.d.ts +2 -2
  444. package/dist/transfers/get-transfer-history/get-transfer-history.d.ts +3 -3
  445. package/dist/transfers/get-transfer-history/index.d.ts +4 -4
  446. package/dist/transfers/get-transfer-history/query-document.d.ts +2 -2
  447. package/dist/transfers/get-transfer-history/query.d.ts +4 -4
  448. package/dist/transfers/get-transfer-history/to-transfer-row.d.ts +2 -2
  449. package/dist/transfers/index.d.ts +1 -1
  450. package/dist/websocket/index.d.ts +3 -3
  451. package/dist/websocket/notifications/build-subscribe-message.d.ts +1 -1
  452. package/dist/websocket/notifications/index.d.ts +5 -5
  453. package/dist/websocket/notifications/normalize-notification.d.ts +1 -1
  454. package/dist/websocket/notifications/parse-notification-frame.d.ts +2 -2
  455. package/dist/websocket/notifications/watch-notifications.d.ts +4 -4
  456. package/dist/websocket/prices/index.d.ts +3 -3
  457. package/dist/websocket/prices/parse-price-frame.d.ts +1 -1
  458. package/dist/websocket/prices/watch-enigma-prices.d.ts +5 -5
  459. package/dist/websocket/socket/create-reconnecting-socket.d.ts +2 -2
  460. package/dist/websocket/socket/get-socket-pool.d.ts +2 -2
  461. package/dist/websocket/socket/index.d.ts +4 -4
  462. package/dist/websocket/socket/socket-pool.d.ts +2 -2
  463. package/dist/websocket/tpsl/index.d.ts +3 -3
  464. package/dist/websocket/tpsl/parse-tpsl-frame.d.ts +1 -1
  465. package/dist/websocket/tpsl/types.d.ts +1 -1
  466. package/dist/websocket/tpsl/watch-tpsl-notifications.d.ts +4 -4
  467. package/package.json +11 -9
@@ -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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,uBAAuB,CAAC;AAE/B,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEhE,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,2BAA2B,GAAG,kBAAkB,CAAC,2DAE3G;AAED,oEAAoE;AACpE,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAErF,iEAAiE;AACjE,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,2BAA2B,GACzB,cAAc,CAAC,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACjG,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,6BAA6B,GAAG,kBAAkB,CAC5D,qBAAqB,EACrB,KAAK,EACL,qBAAqB,EACrB,yBAAyB,CAC1B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,GAChC,6BAA6B,CAkB/B"}
@@ -0,0 +1,28 @@
1
+ import { filterQueryOptions as e } from "../../shared/utils/query.js";
2
+ import { getEstimatedPrice as t } from "./get-estimated-price.js";
3
+ //#region src/solvers/estimated-price/query.ts
4
+ function n(t) {
5
+ return ["getEstimatedPrice", e(t)];
6
+ }
7
+ function r(e, r) {
8
+ return {
9
+ ...r.query,
10
+ queryKey: n({
11
+ ...r,
12
+ configKey: e.getChainConfigKey(r.chainId)
13
+ }),
14
+ enabled: (r.query?.enabled ?? !0) && r.quantity.length > 0 && r.price.length > 0,
15
+ queryFn: () => t(e, {
16
+ chainId: r.chainId,
17
+ symbolId: r.symbolId,
18
+ quantity: r.quantity,
19
+ positionType: r.positionType,
20
+ entry: r.entry,
21
+ price: r.price
22
+ })
23
+ };
24
+ }
25
+ //#endregion
26
+ export { n as getEstimatedPriceQueryKey, r as getEstimatedPriceQueryOptions };
27
+
28
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","names":[],"sources":["../../../src/solvers/estimated-price/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n getEstimatedPrice,\n type GetEstimatedPriceParameters,\n type GetEstimatedPriceReturnType,\n} from \"./get-estimated-price\";\n\n/** Data resolved by the {@link getEstimatedPriceQueryOptions} query. */\nexport type GetEstimatedPriceData = GetEstimatedPriceReturnType;\n\n/** Build the TanStack Query key for {@link getEstimatedPriceQueryOptions}. */\nexport function getEstimatedPriceQueryKey(options: Compute<GetEstimatedPriceParameters & ConfigKeyParameter>) {\n return [\"getEstimatedPrice\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getEstimatedPriceQueryKey}. */\nexport type GetEstimatedPriceQueryKey = ReturnType<typeof getEstimatedPriceQueryKey>;\n\n/** Options accepted by {@link getEstimatedPriceQueryOptions}. */\nexport type GetEstimatedPriceOptions = Compute<\n GetEstimatedPriceParameters &\n QueryParameter<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getEstimatedPriceQueryOptions}. */\nexport type GetEstimatedPriceQueryOptions = SymmioQueryOptions<\n GetEstimatedPriceData,\n Error,\n GetEstimatedPriceData,\n GetEstimatedPriceQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getEstimatedPrice}. Disabled until\n * `quantity` and `price` are non-empty, so the estimate does not fire on partial\n * input.\n *\n * @example\n * ```ts\n * useQuery(getEstimatedPriceQueryOptions(config, { symbolId, quantity, positionType, entry: \"open\", price }));\n * ```\n */\nexport function getEstimatedPriceQueryOptions(\n config: Config,\n options: GetEstimatedPriceOptions,\n): GetEstimatedPriceQueryOptions {\n return {\n ...options.query,\n queryKey: getEstimatedPriceQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: (options.query?.enabled ?? true) && options.quantity.length > 0 && options.price.length > 0,\n queryFn: () =>\n getEstimatedPrice(config, {\n chainId: options.chainId,\n symbolId: options.symbolId,\n quantity: options.quantity,\n positionType: options.positionType,\n entry: options.entry,\n price: options.price,\n }),\n };\n}\n"],"mappings":";;;AAcA,SAAgB,EAA0B,GAAoE;CAC5G,OAAO,CAAC,qBAAqB,EAAmB,CAAO,CAAC;AAC1D;AA6BA,SAAgB,EACd,GACA,GAC+B;CAC/B,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA0B;GAClC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,UAAU,EAAQ,OAAO,WAAW,OAAS,EAAQ,SAAS,SAAS,KAAK,EAAQ,MAAM,SAAS;EACnG,eACE,EAAkB,GAAQ;GACxB,SAAS,EAAQ;GACjB,UAAU,EAAQ;GAClB,UAAU,EAAQ;GAClB,cAAc,EAAQ;GACtB,OAAO,EAAQ;GACf,OAAO,EAAQ;EACjB,CAAC;CACL;AACF"}
@@ -0,0 +1,9 @@
1
+ import { ApiGetEstimatedPriceResponse } from '../types/generated/enigma-solver.js';
2
+ import { GetEstimatedPriceReturnType } from './get-estimated-price.js';
3
+ /**
4
+ * Map the generated `ApiGetEstimatedPriceResponse` into the SDK's
5
+ * {@link GetEstimatedPriceReturnType}. A missing / empty `price` defaults to
6
+ * `"0"`.
7
+ */
8
+ export declare function toEstimatedPrice(raw: ApiGetEstimatedPriceResponse): GetEstimatedPriceReturnType;
9
+ //# sourceMappingURL=to-estimated-price.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/to-estimated-price.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEzE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,4BAA4B,GAAG,2BAA2B,CAE/F"}
@@ -0,0 +1,8 @@
1
+ //#region src/solvers/estimated-price/to-estimated-price.ts
2
+ function e(e) {
3
+ return { estimatedPrice: typeof e.price == "string" && e.price.length > 0 ? e.price : "0" };
4
+ }
5
+ //#endregion
6
+ export { e as toEstimatedPrice };
7
+
8
+ //# sourceMappingURL=to-estimated-price.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/to-estimated-price.ts"],"sourcesContent":["import type { ApiGetEstimatedPriceResponse } from \"../types/generated/enigma-solver\";\nimport type { GetEstimatedPriceReturnType } from \"./get-estimated-price\";\n\n/**\n * Map the generated `ApiGetEstimatedPriceResponse` into the SDK's\n * {@link GetEstimatedPriceReturnType}. A missing / empty `price` defaults to\n * `\"0\"`.\n */\nexport function toEstimatedPrice(raw: ApiGetEstimatedPriceResponse): GetEstimatedPriceReturnType {\n return { estimatedPrice: typeof raw.price === \"string\" && raw.price.length > 0 ? raw.price : \"0\" };\n}\n"],"mappings":";AAQA,SAAgB,EAAiB,GAAgE;CAC/F,OAAO,EAAE,gBAAgB,OAAO,EAAI,SAAU,YAAY,EAAI,MAAM,SAAS,IAAI,EAAI,QAAQ,IAAI;AACnG"}
@@ -0,0 +1,37 @@
1
+ import { Config } from '../../core/config/index.js';
2
+ import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
3
+ import { MarketFundingInfo } from './types.js';
4
+ /**
5
+ * Parameters for {@link getFundingInfo}.
6
+ */
7
+ export type GetFundingInfoParameters = Compute<ChainIdParameter & {
8
+ /** Restrict the result to these market names. Omit to fetch every market (the endpoint default). */
9
+ symbols?: readonly string[];
10
+ }>;
11
+ /** Return type of {@link getFundingInfo}: one entry per market. */
12
+ export type GetFundingInfoReturnType = MarketFundingInfo[];
13
+ /**
14
+ * Fetch per-market funding rates from the chain's solver `/get_funding_info`
15
+ * endpoint. Returns the next-epoch long/short funding rate, next funding time,
16
+ * and epoch length for every market (or only the requested `symbols`). The
17
+ * solver base URL is resolved from `config` per call, so multiple chains never
18
+ * clobber each other.
19
+ *
20
+ * Rates are surfaced as plain per-epoch decimal fractions exactly as the solver
21
+ * reports them (multiply by `100` for a percentage); no scaling is applied.
22
+ *
23
+ * @param config - The SDK config.
24
+ * @param parameters - Optional chain id and `symbols` filter.
25
+ * @returns Normalized funding info, one {@link MarketFundingInfo} per market.
26
+ * @throws {SymmApiError} when the API request fails.
27
+ * @throws {SymmError} when the chain is unsupported.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const funding = await getFundingInfo(config);
32
+ * const btc = funding.find((f) => f.symbol === "BTCUSDT");
33
+ * console.log(btc?.nextFundingRateLong); // 0.0001 → 0.01%
34
+ * ```
35
+ */
36
+ export declare function getFundingInfo(config: Config, parameters?: GetFundingInfoParameters): Promise<GetFundingInfoReturnType>;
37
+ //# sourceMappingURL=get-funding-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-funding-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/get-funding-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,gBAAgB,GAAG;IACjB,oGAAoG;IACpG,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CACF,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,EAAE,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,wBAA6B,GACxC,OAAO,CAAC,wBAAwB,CAAC,CAGnC"}
@@ -0,0 +1,24 @@
1
+ import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
2
+ import { getGetFundingInfo as n } from "../types/generated/enigma-solver.js";
3
+ import { toMarketFundingInfo as r } from "./to-funding-info.js";
4
+ import { isAxiosError as i } from "axios";
5
+ //#region src/solvers/funding-info/get-funding-info.ts
6
+ async function a(e, t = {}) {
7
+ let { solver: n } = e.getChainConfig(t.chainId);
8
+ return o(n.url, t.symbols);
9
+ }
10
+ async function o(a, o) {
11
+ try {
12
+ let e = await n(o ? { symbols: [...o] } : void 0, { baseURL: a });
13
+ return Object.entries(e.data).map(([e, t]) => r(e, t));
14
+ } catch (n) {
15
+ throw n instanceof t ? n : i(n) ? e.fromAxios(n, {
16
+ code: "FETCH_FUNDING_INFO_FAILED",
17
+ baseURL: a
18
+ }) : new t("api", "FETCH_FUNDING_INFO_FAILED", `Failed to fetch funding info: ${n instanceof Error ? n.message : String(n)}`, { cause: n instanceof Error ? n : void 0 });
19
+ }
20
+ }
21
+ //#endregion
22
+ export { a as getFundingInfo };
23
+
24
+ //# sourceMappingURL=get-funding-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-funding-info.js","names":[],"sources":["../../../src/solvers/funding-info/get-funding-info.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 { getGetFundingInfo } from \"../types/generated/enigma-solver\";\nimport { toMarketFundingInfo } from \"./to-funding-info\";\nimport type { MarketFundingInfo } from \"./types\";\n\n/**\n * Parameters for {@link getFundingInfo}.\n */\nexport type GetFundingInfoParameters = Compute<\n ChainIdParameter & {\n /** Restrict the result to these market names. Omit to fetch every market (the endpoint default). */\n symbols?: readonly string[];\n }\n>;\n\n/** Return type of {@link getFundingInfo}: one entry per market. */\nexport type GetFundingInfoReturnType = MarketFundingInfo[];\n\n/**\n * Fetch per-market funding rates from the chain's solver `/get_funding_info`\n * endpoint. Returns the next-epoch long/short funding rate, next funding time,\n * and epoch length for every market (or only the requested `symbols`). The\n * solver base URL is resolved from `config` per call, so multiple chains never\n * clobber each other.\n *\n * Rates are surfaced as plain per-epoch decimal fractions exactly as the solver\n * reports them (multiply by `100` for a percentage); no scaling is applied.\n *\n * @param config - The SDK config.\n * @param parameters - Optional chain id and `symbols` filter.\n * @returns Normalized funding info, one {@link MarketFundingInfo} per market.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} when the chain is unsupported.\n *\n * @example\n * ```ts\n * const funding = await getFundingInfo(config);\n * const btc = funding.find((f) => f.symbol === \"BTCUSDT\");\n * console.log(btc?.nextFundingRateLong); // 0.0001 → 0.01%\n * ```\n */\nexport async function getFundingInfo(\n config: Config,\n parameters: GetFundingInfoParameters = {},\n): Promise<GetFundingInfoReturnType> {\n const { solver } = config.getChainConfig(parameters.chainId);\n return fetchFundingInfo(solver.url, parameters.symbols);\n}\n\n/**\n * Call the solver's `/get_funding_info` endpoint with a per-call base URL and\n * map the market-keyed response into the SDK's normalized array.\n *\n * @internal\n */\nasync function fetchFundingInfo(baseURL: string, symbols?: readonly string[]): Promise<MarketFundingInfo[]> {\n try {\n const response = await getGetFundingInfo(symbols ? { symbols: [...symbols] } : undefined, { baseURL });\n return Object.entries(response.data).map(([symbol, raw]) => toMarketFundingInfo(symbol, raw));\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_FUNDING_INFO_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_FUNDING_INFO_FAILED\",\n `Failed to fetch funding info: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;AA4CA,eAAsB,EACpB,GACA,IAAuC,CAAC,GACL;CACnC,IAAM,EAAE,cAAW,EAAO,eAAe,EAAW,OAAO;CAC3D,OAAO,EAAiB,EAAO,KAAK,EAAW,OAAO;AACxD;AAQA,eAAe,EAAiB,GAAiB,GAA2D;CAC1G,IAAI;EACF,IAAM,IAAW,MAAM,EAAkB,IAAU,EAAE,SAAS,CAAC,GAAG,CAAO,EAAE,IAAI,KAAA,GAAW,EAAE,WAAQ,CAAC;EACrG,OAAO,OAAO,QAAQ,EAAS,IAAI,EAAE,KAAK,CAAC,GAAQ,OAAS,EAAoB,GAAQ,CAAG,CAAC;CAC9F,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAA6B;EAAQ,CAAC,IAG5E,IAAI,EACR,OACA,6BACA,iCAAiC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAChF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
@@ -0,0 +1,6 @@
1
+ export * from './get-funding-info.js';
2
+ export * from './project-funding-rate.js';
3
+ export * from './query.js';
4
+ export * from './to-funding-info.js';
5
+ export * from './types.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,30 @@
1
+ /** Parameters for {@link projectFundingRate}. */
2
+ export interface ProjectFundingRateParameters {
3
+ /** Per-epoch funding rate as a decimal fraction (e.g. `MarketFundingInfo.nextFundingRateLong`). */
4
+ ratePerEpoch: number;
5
+ /** Funding epoch length in seconds (e.g. `MarketFundingInfo.epochDurationSeconds`). */
6
+ epochDurationSeconds: number;
7
+ /** Projection window in days (fractional allowed). */
8
+ days: number;
9
+ }
10
+ /**
11
+ * Project a per-epoch funding rate over a number of days by **linear
12
+ * (non-compounded)** extrapolation — the same method the reference frontend
13
+ * uses for its 1D / yearly figures: multiply the per-epoch rate by how many
14
+ * funding epochs elapse in the window (`days × 86_400 / epochDurationSeconds`).
15
+ *
16
+ * The result keeps the input's unit — a decimal fraction, as returned on
17
+ * {@link MarketFundingInfo} (multiply by 100 for a percentage). It is **not**
18
+ * APR-compounded.
19
+ *
20
+ * @param params - The per-epoch rate, the epoch length, and the day window.
21
+ * @returns The projected funding rate over `days`; `0` when `epochDurationSeconds`
22
+ * is non-positive (no epochs accrue).
23
+ *
24
+ * @example
25
+ * // 12h epoch (2 epochs/day). Per-epoch -0.0003014 over 30 days:
26
+ * projectFundingRate({ ratePerEpoch: -0.0003014, epochDurationSeconds: 43_200, days: 30 });
27
+ * // → -0.0180858 (≈ -1.81%)
28
+ */
29
+ export declare function projectFundingRate({ ratePerEpoch, epochDurationSeconds, days }: ProjectFundingRateParameters): number;
30
+ //# sourceMappingURL=project-funding-rate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-funding-rate.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/project-funding-rate.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C,mGAAmG;IACnG,YAAY,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,EAAE,4BAA4B,GAAG,MAAM,CAIrH"}
@@ -0,0 +1,9 @@
1
+ //#region src/solvers/funding-info/project-funding-rate.ts
2
+ var e = 86400;
3
+ function t({ ratePerEpoch: t, epochDurationSeconds: n, days: r }) {
4
+ return n <= 0 ? 0 : t * (r * e / n);
5
+ }
6
+ //#endregion
7
+ export { t as projectFundingRate };
8
+
9
+ //# sourceMappingURL=project-funding-rate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-funding-rate.js","names":[],"sources":["../../../src/solvers/funding-info/project-funding-rate.ts"],"sourcesContent":["/** Seconds in one day — converts a day-count into a span of funding epochs. */\nconst SECONDS_PER_DAY = 86_400;\n\n/** Parameters for {@link projectFundingRate}. */\nexport interface ProjectFundingRateParameters {\n /** Per-epoch funding rate as a decimal fraction (e.g. `MarketFundingInfo.nextFundingRateLong`). */\n ratePerEpoch: number;\n /** Funding epoch length in seconds (e.g. `MarketFundingInfo.epochDurationSeconds`). */\n epochDurationSeconds: number;\n /** Projection window in days (fractional allowed). */\n days: number;\n}\n\n/**\n * Project a per-epoch funding rate over a number of days by **linear\n * (non-compounded)** extrapolation — the same method the reference frontend\n * uses for its 1D / yearly figures: multiply the per-epoch rate by how many\n * funding epochs elapse in the window (`days × 86_400 / epochDurationSeconds`).\n *\n * The result keeps the input's unit — a decimal fraction, as returned on\n * {@link MarketFundingInfo} (multiply by 100 for a percentage). It is **not**\n * APR-compounded.\n *\n * @param params - The per-epoch rate, the epoch length, and the day window.\n * @returns The projected funding rate over `days`; `0` when `epochDurationSeconds`\n * is non-positive (no epochs accrue).\n *\n * @example\n * // 12h epoch (2 epochs/day). Per-epoch -0.0003014 over 30 days:\n * projectFundingRate({ ratePerEpoch: -0.0003014, epochDurationSeconds: 43_200, days: 30 });\n * // → -0.0180858 (≈ -1.81%)\n */\nexport function projectFundingRate({ ratePerEpoch, epochDurationSeconds, days }: ProjectFundingRateParameters): number {\n if (epochDurationSeconds <= 0) return 0;\n const epochsInWindow = (days * SECONDS_PER_DAY) / epochDurationSeconds;\n return ratePerEpoch * epochsInWindow;\n}\n"],"mappings":";AACA,IAAM,IAAkB;AA+BxB,SAAgB,EAAmB,EAAE,iBAAc,yBAAsB,WAA8C;CAGrH,OAFI,KAAwB,IAAU,IAE/B,KADiB,IAAO,IAAmB;AAEpD"}
@@ -0,0 +1,28 @@
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 { GetFundingInfoParameters, GetFundingInfoReturnType } from './get-funding-info.js';
5
+ /** Data resolved by the {@link getFundingInfoQueryOptions} query. */
6
+ export type GetFundingInfoData = GetFundingInfoReturnType;
7
+ /** Build the TanStack Query key for {@link getFundingInfoQueryOptions}. */
8
+ export declare function getFundingInfoQueryKey(options?: Compute<GetFundingInfoParameters & ConfigKeyParameter>): readonly ["getFundingInfo", Record<string, unknown>];
9
+ /** Query-key type produced by {@link getFundingInfoQueryKey}. */
10
+ export type GetFundingInfoQueryKey = ReturnType<typeof getFundingInfoQueryKey>;
11
+ /** Options accepted by {@link getFundingInfoQueryOptions}. */
12
+ export type GetFundingInfoOptions = Compute<GetFundingInfoParameters & QueryParameter<GetFundingInfoData, Error, GetFundingInfoData, GetFundingInfoQueryKey>>;
13
+ /** TanStack Query options returned by {@link getFundingInfoQueryOptions}. */
14
+ export type GetFundingInfoQueryOptions = SymmioQueryOptions<GetFundingInfoData, Error, GetFundingInfoData, GetFundingInfoQueryKey>;
15
+ /**
16
+ * Build TanStack Query options for {@link getFundingInfo}.
17
+ *
18
+ * @param config - The SDK config.
19
+ * @param options - Query parameters (optional `chainId` / `symbols`) and TanStack overrides.
20
+ * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * useQuery(getFundingInfoQueryOptions(config, {}));
25
+ * ```
26
+ */
27
+ export declare function getFundingInfoQueryOptions(config: Config, options?: GetFundingInfoOptions): GetFundingInfoQueryOptions;
28
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAkB,KAAK,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAElH,qEAAqE;AACrE,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAE1D,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,OAAO,CAAC,wBAAwB,GAAG,kBAAkB,CAAM,wDAE1G;AAED,iEAAiE;AACjE,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE/E,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,wBAAwB,GAAG,cAAc,CAAC,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CACjH,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,CACzD,kBAAkB,EAClB,KAAK,EACL,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GAClC,0BAA0B,CAU5B"}
@@ -0,0 +1,24 @@
1
+ import { filterQueryOptions as e } from "../../shared/utils/query.js";
2
+ import { getFundingInfo as t } from "./get-funding-info.js";
3
+ //#region src/solvers/funding-info/query.ts
4
+ function n(t = {}) {
5
+ return ["getFundingInfo", e(t)];
6
+ }
7
+ function r(e, r = {}) {
8
+ return {
9
+ ...r.query,
10
+ queryKey: n({
11
+ ...r,
12
+ configKey: e.getChainConfigKey(r.chainId)
13
+ }),
14
+ enabled: r.query?.enabled ?? !0,
15
+ queryFn: () => t(e, {
16
+ chainId: r.chainId,
17
+ symbols: r.symbols
18
+ })
19
+ };
20
+ }
21
+ //#endregion
22
+ export { n as getFundingInfoQueryKey, r as getFundingInfoQueryOptions };
23
+
24
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","names":[],"sources":["../../../src/solvers/funding-info/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport { getFundingInfo, type GetFundingInfoParameters, type GetFundingInfoReturnType } from \"./get-funding-info\";\n\n/** Data resolved by the {@link getFundingInfoQueryOptions} query. */\nexport type GetFundingInfoData = GetFundingInfoReturnType;\n\n/** Build the TanStack Query key for {@link getFundingInfoQueryOptions}. */\nexport function getFundingInfoQueryKey(options: Compute<GetFundingInfoParameters & ConfigKeyParameter> = {}) {\n return [\"getFundingInfo\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getFundingInfoQueryKey}. */\nexport type GetFundingInfoQueryKey = ReturnType<typeof getFundingInfoQueryKey>;\n\n/** Options accepted by {@link getFundingInfoQueryOptions}. */\nexport type GetFundingInfoOptions = Compute<\n GetFundingInfoParameters & QueryParameter<GetFundingInfoData, Error, GetFundingInfoData, GetFundingInfoQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getFundingInfoQueryOptions}. */\nexport type GetFundingInfoQueryOptions = SymmioQueryOptions<\n GetFundingInfoData,\n Error,\n GetFundingInfoData,\n GetFundingInfoQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getFundingInfo}.\n *\n * @param config - The SDK config.\n * @param options - Query parameters (optional `chainId` / `symbols`) and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(getFundingInfoQueryOptions(config, {}));\n * ```\n */\nexport function getFundingInfoQueryOptions(\n config: Config,\n options: GetFundingInfoOptions = {},\n): GetFundingInfoQueryOptions {\n return {\n ...options.query,\n queryKey: getFundingInfoQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: options.query?.enabled ?? true,\n queryFn: () => getFundingInfo(config, { chainId: options.chainId, symbols: options.symbols }),\n };\n}\n"],"mappings":";;;AAUA,SAAgB,EAAuB,IAAkE,CAAC,GAAG;CAC3G,OAAO,CAAC,kBAAkB,EAAmB,CAAO,CAAC;AACvD;AA8BA,SAAgB,EACd,GACA,IAAiC,CAAC,GACN;CAC5B,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAuB;GAC/B,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,SAAS,EAAQ,OAAO,WAAW;EACnC,eAAe,EAAe,GAAQ;GAAE,SAAS,EAAQ;GAAS,SAAS,EAAQ;EAAQ,CAAC;CAC9F;AACF"}
@@ -0,0 +1,14 @@
1
+ import { ApiFundingInfoResponse } from '../types/generated/enigma-solver.js';
2
+ import { MarketFundingInfo } from './types.js';
3
+ /** One market's raw entry from `ApiFundingInfoResponse` (the map value). */
4
+ type RawFundingInfo = ApiFundingInfoResponse[string];
5
+ /**
6
+ * Map one `ApiFundingInfoResponse` entry (keyed by market name) into the SDK's
7
+ * {@link MarketFundingInfo}. Missing numeric fields default to `0`.
8
+ *
9
+ * @param symbol - The market name (the response map key).
10
+ * @param raw - The raw funding entry for that market.
11
+ */
12
+ export declare function toMarketFundingInfo(symbol: string, raw: RawFundingInfo): MarketFundingInfo;
13
+ export {};
14
+ //# sourceMappingURL=to-funding-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-funding-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/to-funding-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,4EAA4E;AAC5E,KAAK,cAAc,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,iBAAiB,CAQ1F"}
@@ -0,0 +1,15 @@
1
+ import { toFiniteNumber as e } from "@symmio/utils/number";
2
+ //#region src/solvers/funding-info/to-funding-info.ts
3
+ function t(t, n) {
4
+ return {
5
+ symbol: t,
6
+ nextFundingRateLong: e(n.next_funding_rate_long),
7
+ nextFundingRateShort: e(n.next_funding_rate_short),
8
+ nextFundingTime: e(n.next_funding_time),
9
+ epochDurationSeconds: e(n.funding_rate_epoch_duration)
10
+ };
11
+ }
12
+ //#endregion
13
+ export { t as toMarketFundingInfo };
14
+
15
+ //# sourceMappingURL=to-funding-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-funding-info.js","names":[],"sources":["../../../src/solvers/funding-info/to-funding-info.ts"],"sourcesContent":["import { toFiniteNumber } from \"@symmio/utils/number\";\nimport type { ApiFundingInfoResponse } from \"../types/generated/enigma-solver\";\nimport type { MarketFundingInfo } from \"./types\";\n\n/** One market's raw entry from `ApiFundingInfoResponse` (the map value). */\ntype RawFundingInfo = ApiFundingInfoResponse[string];\n\n/**\n * Map one `ApiFundingInfoResponse` entry (keyed by market name) into the SDK's\n * {@link MarketFundingInfo}. Missing numeric fields default to `0`.\n *\n * @param symbol - The market name (the response map key).\n * @param raw - The raw funding entry for that market.\n */\nexport function toMarketFundingInfo(symbol: string, raw: RawFundingInfo): MarketFundingInfo {\n return {\n symbol,\n nextFundingRateLong: toFiniteNumber(raw.next_funding_rate_long),\n nextFundingRateShort: toFiniteNumber(raw.next_funding_rate_short),\n nextFundingTime: toFiniteNumber(raw.next_funding_time),\n epochDurationSeconds: toFiniteNumber(raw.funding_rate_epoch_duration),\n };\n}\n"],"mappings":";;AAcA,SAAgB,EAAoB,GAAgB,GAAwC;CAC1F,OAAO;EACL;EACA,qBAAqB,EAAe,EAAI,sBAAsB;EAC9D,sBAAsB,EAAe,EAAI,uBAAuB;EAChE,iBAAiB,EAAe,EAAI,iBAAiB;EACrD,sBAAsB,EAAe,EAAI,2BAA2B;CACtE;AACF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Next-epoch funding figures for one solver market, normalized from the
3
+ * generated `/get_funding_info` response.
4
+ *
5
+ * Funding is charged per epoch: the long side pays (or receives) at
6
+ * {@link MarketFundingInfo.nextFundingRateLong} and the short side at
7
+ * {@link MarketFundingInfo.nextFundingRateShort}. Both rates are the plain
8
+ * per-epoch decimal fractions the solver reports — multiply by `100` for a
9
+ * percentage. A **positive** rate means that side *receives* funding; a
10
+ * **negative** rate means it *pays*.
11
+ */
12
+ export interface MarketFundingInfo {
13
+ /** Market ticker and solver map key (e.g. `"BTCUSDT"`). */
14
+ symbol: string;
15
+ /**
16
+ * Next funding rate for the long side, as a per-epoch decimal fraction
17
+ * (`0.0001` = `0.01%`). Positive receives, negative pays.
18
+ */
19
+ nextFundingRateLong: number;
20
+ /**
21
+ * Next funding rate for the short side, as a per-epoch decimal fraction
22
+ * (`0.0001` = `0.01%`). Positive receives, negative pays.
23
+ */
24
+ nextFundingRateShort: number;
25
+ /**
26
+ * Timestamp of the next funding settlement, as reported by the solver — a Unix
27
+ * timestamp in **milliseconds** (e.g. `1783209600000`). `0` when the solver
28
+ * omits it. Consumers rendering a countdown should stay defensive about the
29
+ * unit (treat a value below `1e12` as seconds) in case the solver changes it.
30
+ */
31
+ nextFundingTime: number;
32
+ /** Length of one funding epoch, in seconds (e.g. `43200` = 12h). `0` when absent. */
33
+ epochDurationSeconds: number;
34
+ }
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,oBAAoB,EAAE,MAAM,CAAC;CAC9B"}
@@ -1,7 +1,7 @@
1
1
  import { Address } from 'viem';
2
- import { Config } from '../../../core/config';
3
- import { ChainIdParameter, Compute } from '../../../shared/types/properties';
4
- import { PendingInstantClose } from './to-pending-instant-close';
2
+ import { Config } from '../../../core/config/index.js';
3
+ import { ChainIdParameter, Compute } from '../../../shared/types/properties.js';
4
+ import { PendingInstantClose } from './to-pending-instant-close.js';
5
5
  /**
6
6
  * Parameters for {@link getInstantCloses}.
7
7
  */
@@ -1,4 +1,4 @@
1
- export * from './get-instant-closes';
2
- export * from './query';
3
- export * from './to-pending-instant-close';
1
+ export * from './get-instant-closes.js';
2
+ export * from './query.js';
3
+ export * from './to-pending-instant-close.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
- import { Config } from '../../../core/config';
2
- import { Compute, ConfigKeyParameter, ExactPartial } from '../../../shared/types/properties';
3
- import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query';
4
- import { GetInstantClosesParameters, GetInstantClosesReturnType } from './get-instant-closes';
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { Compute, ConfigKeyParameter, ExactPartial } from '../../../shared/types/properties.js';
3
+ import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
4
+ import { GetInstantClosesParameters, GetInstantClosesReturnType } from './get-instant-closes.js';
5
5
  /** Data resolved by the {@link getInstantClosesQueryOptions} query. */
6
6
  export type GetInstantClosesData = GetInstantClosesReturnType;
7
7
  /**
@@ -1,4 +1,4 @@
1
- import { ApiGetInstantCloseResponse } from '../../types/generated/enigma-solver';
1
+ import { ApiGetInstantCloseResponse } from '../../types/generated/enigma-solver.js';
2
2
  /**
3
3
  * A pending instant-close record returned by a single hedger's
4
4
  * `/instant_close/{account}` endpoint.