@symmio/trading-core 4.0.0 → 4.2.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 (447) hide show
  1. package/dist/balance-history/get-balance-history/types.d.ts +3 -1
  2. package/dist/balance-history/get-balance-history/types.d.ts.map +1 -1
  3. package/dist/balance-history/get-balance-history/types.js +1 -1
  4. package/dist/balance-history/get-balance-history/types.js.map +1 -1
  5. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.d.ts +50 -0
  6. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.d.ts.map +1 -0
  7. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.js +30 -0
  8. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.js.map +1 -0
  9. package/dist/funding/get-funding-index-checkpoints/index.d.ts +5 -0
  10. package/dist/funding/get-funding-index-checkpoints/index.d.ts.map +1 -0
  11. package/dist/funding/get-funding-index-checkpoints/query-document.d.ts +16 -0
  12. package/dist/funding/get-funding-index-checkpoints/query-document.d.ts.map +1 -0
  13. package/dist/funding/get-funding-index-checkpoints/query-document.js +7 -0
  14. package/dist/funding/get-funding-index-checkpoints/query-document.js.map +1 -0
  15. package/dist/funding/get-funding-index-checkpoints/query.d.ts +37 -0
  16. package/dist/funding/get-funding-index-checkpoints/query.d.ts.map +1 -0
  17. package/dist/funding/get-funding-index-checkpoints/query.js +23 -0
  18. package/dist/funding/get-funding-index-checkpoints/query.js.map +1 -0
  19. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.d.ts +12 -0
  20. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.d.ts.map +1 -0
  21. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.js +31 -0
  22. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.js.map +1 -0
  23. package/dist/funding/get-funding-index-checkpoints/types.d.ts +51 -0
  24. package/dist/funding/get-funding-index-checkpoints/types.d.ts.map +1 -0
  25. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.d.ts +47 -0
  26. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.d.ts.map +1 -0
  27. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.js +30 -0
  28. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.js.map +1 -0
  29. package/dist/funding/get-quote-funding-settlements/index.d.ts +5 -0
  30. package/dist/funding/get-quote-funding-settlements/index.d.ts.map +1 -0
  31. package/dist/funding/get-quote-funding-settlements/query-document.d.ts +16 -0
  32. package/dist/funding/get-quote-funding-settlements/query-document.d.ts.map +1 -0
  33. package/dist/funding/get-quote-funding-settlements/query-document.js +7 -0
  34. package/dist/funding/get-quote-funding-settlements/query-document.js.map +1 -0
  35. package/dist/funding/get-quote-funding-settlements/query.d.ts +37 -0
  36. package/dist/funding/get-quote-funding-settlements/query.d.ts.map +1 -0
  37. package/dist/funding/get-quote-funding-settlements/query.js +23 -0
  38. package/dist/funding/get-quote-funding-settlements/query.js.map +1 -0
  39. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.d.ts +12 -0
  40. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.d.ts.map +1 -0
  41. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.js +33 -0
  42. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.js.map +1 -0
  43. package/dist/funding/get-quote-funding-settlements/types.d.ts +56 -0
  44. package/dist/funding/get-quote-funding-settlements/types.d.ts.map +1 -0
  45. package/dist/funding/index.d.ts +3 -0
  46. package/dist/funding/index.d.ts.map +1 -0
  47. package/dist/index.d.ts +63 -4
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +427 -386
  50. package/dist/liquidation/get-liquidation-details/get-liquidation-details.d.ts +44 -0
  51. package/dist/liquidation/get-liquidation-details/get-liquidation-details.d.ts.map +1 -0
  52. package/dist/liquidation/get-liquidation-details/get-liquidation-details.js +30 -0
  53. package/dist/liquidation/get-liquidation-details/get-liquidation-details.js.map +1 -0
  54. package/dist/liquidation/get-liquidation-details/index.d.ts +5 -0
  55. package/dist/liquidation/get-liquidation-details/index.d.ts.map +1 -0
  56. package/dist/liquidation/get-liquidation-details/query-document.d.ts +16 -0
  57. package/dist/liquidation/get-liquidation-details/query-document.d.ts.map +1 -0
  58. package/dist/liquidation/get-liquidation-details/query-document.js +7 -0
  59. package/dist/liquidation/get-liquidation-details/query-document.js.map +1 -0
  60. package/dist/liquidation/get-liquidation-details/query.d.ts +37 -0
  61. package/dist/liquidation/get-liquidation-details/query.d.ts.map +1 -0
  62. package/dist/liquidation/get-liquidation-details/query.js +23 -0
  63. package/dist/liquidation/get-liquidation-details/query.js.map +1 -0
  64. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.d.ts +12 -0
  65. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.d.ts.map +1 -0
  66. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.js +32 -0
  67. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.js.map +1 -0
  68. package/dist/liquidation/get-liquidation-details/types.d.ts +47 -0
  69. package/dist/liquidation/get-liquidation-details/types.d.ts.map +1 -0
  70. package/dist/liquidation/index.d.ts +2 -0
  71. package/dist/liquidation/index.d.ts.map +1 -0
  72. package/dist/margin/get-margin-transfers/get-margin-transfers.d.ts +51 -0
  73. package/dist/margin/get-margin-transfers/get-margin-transfers.d.ts.map +1 -0
  74. package/dist/margin/get-margin-transfers/get-margin-transfers.js +32 -0
  75. package/dist/margin/get-margin-transfers/get-margin-transfers.js.map +1 -0
  76. package/dist/margin/get-margin-transfers/index.d.ts +5 -0
  77. package/dist/margin/get-margin-transfers/index.d.ts.map +1 -0
  78. package/dist/margin/get-margin-transfers/query-document.d.ts +17 -0
  79. package/dist/margin/get-margin-transfers/query-document.d.ts.map +1 -0
  80. package/dist/margin/get-margin-transfers/query-document.js +7 -0
  81. package/dist/margin/get-margin-transfers/query-document.js.map +1 -0
  82. package/dist/margin/get-margin-transfers/query.d.ts +37 -0
  83. package/dist/margin/get-margin-transfers/query.d.ts.map +1 -0
  84. package/dist/margin/get-margin-transfers/query.js +23 -0
  85. package/dist/margin/get-margin-transfers/query.js.map +1 -0
  86. package/dist/margin/get-margin-transfers/to-margin-transfer-row.d.ts +12 -0
  87. package/dist/margin/get-margin-transfers/to-margin-transfer-row.d.ts.map +1 -0
  88. package/dist/margin/get-margin-transfers/to-margin-transfer-row.js +19 -0
  89. package/dist/margin/get-margin-transfers/to-margin-transfer-row.js.map +1 -0
  90. package/dist/margin/get-margin-transfers/types.d.ts +27 -0
  91. package/dist/margin/get-margin-transfers/types.d.ts.map +1 -0
  92. package/dist/margin/index.d.ts +1 -0
  93. package/dist/margin/index.d.ts.map +1 -1
  94. package/dist/pools/add-market/to-created-pool.d.ts.map +1 -1
  95. package/dist/pools/add-market/to-created-pool.js +4 -0
  96. package/dist/pools/add-market/to-created-pool.js.map +1 -1
  97. package/dist/pools/add-market/types.d.ts +8 -0
  98. package/dist/pools/add-market/types.d.ts.map +1 -1
  99. package/dist/pools/auth/authenticate-listing.d.ts +3 -1
  100. package/dist/pools/auth/authenticate-listing.d.ts.map +1 -1
  101. package/dist/pools/auth/authenticate-listing.js +28 -23
  102. package/dist/pools/auth/authenticate-listing.js.map +1 -1
  103. package/dist/pools/auth/can-reuse-listing-challenge.d.ts +5 -0
  104. package/dist/pools/auth/can-reuse-listing-challenge.d.ts.map +1 -0
  105. package/dist/pools/auth/can-reuse-listing-challenge.js +9 -0
  106. package/dist/pools/auth/can-reuse-listing-challenge.js.map +1 -0
  107. package/dist/pools/auth/query.d.ts +15 -0
  108. package/dist/pools/auth/query.d.ts.map +1 -1
  109. package/dist/pools/auth/query.js +28 -4
  110. package/dist/pools/auth/query.js.map +1 -1
  111. package/dist/pools/auth/to-siwe.d.ts +5 -1
  112. package/dist/pools/auth/to-siwe.d.ts.map +1 -1
  113. package/dist/pools/auth/to-siwe.js +4 -2
  114. package/dist/pools/auth/to-siwe.js.map +1 -1
  115. package/dist/pools/auth/types.d.ts +2 -0
  116. package/dist/pools/auth/types.d.ts.map +1 -1
  117. package/dist/pools/cancel-withdraw/cancel-withdraw.js +1 -1
  118. package/dist/pools/cancel-withdraw/cancel-withdraw.js.map +1 -1
  119. package/dist/pools/claim-history/get-pool-claim.d.ts +11 -0
  120. package/dist/pools/claim-history/get-pool-claim.d.ts.map +1 -0
  121. package/dist/pools/claim-history/get-pool-claim.js +25 -0
  122. package/dist/pools/claim-history/get-pool-claim.js.map +1 -0
  123. package/dist/pools/claim-history/index.d.ts +1 -0
  124. package/dist/pools/claim-history/index.d.ts.map +1 -1
  125. package/dist/pools/claim-history/to-pool-claim.d.ts.map +1 -1
  126. package/dist/pools/claim-history/to-pool-claim.js +2 -0
  127. package/dist/pools/claim-history/to-pool-claim.js.map +1 -1
  128. package/dist/pools/composition.d.ts +16 -0
  129. package/dist/pools/composition.d.ts.map +1 -0
  130. package/dist/pools/composition.js +39 -0
  131. package/dist/pools/composition.js.map +1 -0
  132. package/dist/pools/empty-pool-profit.d.ts +4 -0
  133. package/dist/pools/empty-pool-profit.d.ts.map +1 -0
  134. package/dist/pools/empty-pool-profit.js +17 -0
  135. package/dist/pools/empty-pool-profit.js.map +1 -0
  136. package/dist/pools/index.d.ts +8 -0
  137. package/dist/pools/index.d.ts.map +1 -1
  138. package/dist/pools/listing-config/to-listing-config.d.ts +5 -1
  139. package/dist/pools/listing-config/to-listing-config.d.ts.map +1 -1
  140. package/dist/pools/listing-config/to-listing-config.js +19 -8
  141. package/dist/pools/listing-config/to-listing-config.js.map +1 -1
  142. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts +37 -0
  143. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts.map +1 -0
  144. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js +35 -0
  145. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js.map +1 -0
  146. package/dist/pools/maintenance-fees/index.d.ts +3 -0
  147. package/dist/pools/maintenance-fees/index.d.ts.map +1 -0
  148. package/dist/pools/maintenance-fees/query.d.ts +11 -0
  149. package/dist/pools/maintenance-fees/query.d.ts.map +1 -0
  150. package/dist/pools/maintenance-fees/query.js +21 -0
  151. package/dist/pools/maintenance-fees/query.js.map +1 -0
  152. package/dist/pools/market-config/to-listing-market-config.d.ts +6 -1
  153. package/dist/pools/market-config/to-listing-market-config.d.ts.map +1 -1
  154. package/dist/pools/market-config/to-listing-market-config.js +1 -0
  155. package/dist/pools/market-config/to-listing-market-config.js.map +1 -1
  156. package/dist/pools/market-config/types.d.ts +5 -0
  157. package/dist/pools/market-config/types.d.ts.map +1 -1
  158. package/dist/pools/market-config/types.js.map +1 -1
  159. package/dist/pools/market-data/get-pool-market-data.d.ts +14 -0
  160. package/dist/pools/market-data/get-pool-market-data.d.ts.map +1 -0
  161. package/dist/pools/market-data/get-pool-market-data.js +25 -0
  162. package/dist/pools/market-data/get-pool-market-data.js.map +1 -0
  163. package/dist/pools/market-data/index.d.ts +2 -0
  164. package/dist/pools/market-data/index.d.ts.map +1 -0
  165. package/dist/pools/market-detail/to-listing-market-detail.d.ts +5 -1
  166. package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
  167. package/dist/pools/market-detail/to-listing-market-detail.js +45 -33
  168. package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
  169. package/dist/pools/markets/to-listing-market.d.ts +13 -1
  170. package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
  171. package/dist/pools/markets/to-listing-market.js +24 -12
  172. package/dist/pools/markets/to-listing-market.js.map +1 -1
  173. package/dist/pools/open-positions/calculate-pool-open-positions.d.ts +39 -0
  174. package/dist/pools/open-positions/calculate-pool-open-positions.d.ts.map +1 -0
  175. package/dist/pools/open-positions/calculate-pool-open-positions.js +83 -0
  176. package/dist/pools/open-positions/calculate-pool-open-positions.js.map +1 -0
  177. package/dist/pools/open-positions/get-pool-open-positions.d.ts +17 -0
  178. package/dist/pools/open-positions/get-pool-open-positions.d.ts.map +1 -0
  179. package/dist/pools/open-positions/get-pool-open-positions.js +39 -0
  180. package/dist/pools/open-positions/get-pool-open-positions.js.map +1 -0
  181. package/dist/pools/open-positions/index.d.ts +4 -0
  182. package/dist/pools/open-positions/index.d.ts.map +1 -0
  183. package/dist/pools/open-positions/query.d.ts +17 -0
  184. package/dist/pools/open-positions/query.d.ts.map +1 -0
  185. package/dist/pools/open-positions/query.js +21 -0
  186. package/dist/pools/open-positions/query.js.map +1 -0
  187. package/dist/pools/portfolio/calculate-pool-portfolio.d.ts +66 -0
  188. package/dist/pools/portfolio/calculate-pool-portfolio.d.ts.map +1 -0
  189. package/dist/pools/portfolio/calculate-pool-portfolio.js +96 -0
  190. package/dist/pools/portfolio/calculate-pool-portfolio.js.map +1 -0
  191. package/dist/pools/portfolio/get-pool-portfolio.d.ts +19 -0
  192. package/dist/pools/portfolio/get-pool-portfolio.d.ts.map +1 -0
  193. package/dist/pools/portfolio/get-pool-portfolio.js +88 -0
  194. package/dist/pools/portfolio/get-pool-portfolio.js.map +1 -0
  195. package/dist/pools/portfolio/index.d.ts +4 -0
  196. package/dist/pools/portfolio/index.d.ts.map +1 -0
  197. package/dist/pools/portfolio/query.d.ts +17 -0
  198. package/dist/pools/portfolio/query.d.ts.map +1 -0
  199. package/dist/pools/portfolio/query.js +21 -0
  200. package/dist/pools/portfolio/query.js.map +1 -0
  201. package/dist/pools/portfolio/read-positions.d.ts +4 -0
  202. package/dist/pools/portfolio/read-positions.d.ts.map +1 -0
  203. package/dist/pools/portfolio/read-positions.js +31 -0
  204. package/dist/pools/portfolio/read-positions.js.map +1 -0
  205. package/dist/pools/position/calculate-pool-position.d.ts +85 -0
  206. package/dist/pools/position/calculate-pool-position.d.ts.map +1 -0
  207. package/dist/pools/position/calculate-pool-position.js +59 -0
  208. package/dist/pools/position/calculate-pool-position.js.map +1 -0
  209. package/dist/pools/position/get-pool-position.d.ts +22 -0
  210. package/dist/pools/position/get-pool-position.d.ts.map +1 -0
  211. package/dist/pools/position/get-pool-position.js +47 -0
  212. package/dist/pools/position/get-pool-position.js.map +1 -0
  213. package/dist/pools/position/index.d.ts +4 -0
  214. package/dist/pools/position/index.d.ts.map +1 -0
  215. package/dist/pools/position/query.d.ts +17 -0
  216. package/dist/pools/position/query.d.ts.map +1 -0
  217. package/dist/pools/position/query.js +21 -0
  218. package/dist/pools/position/query.js.map +1 -0
  219. package/dist/pools/position/sum-deposits.d.ts +10 -0
  220. package/dist/pools/position/sum-deposits.d.ts.map +1 -0
  221. package/dist/pools/position/sum-deposits.js +35 -0
  222. package/dist/pools/position/sum-deposits.js.map +1 -0
  223. package/dist/pools/profit/get-user-profit.d.ts +4 -0
  224. package/dist/pools/profit/get-user-profit.d.ts.map +1 -1
  225. package/dist/pools/profit/get-user-profit.js +18 -12
  226. package/dist/pools/profit/get-user-profit.js.map +1 -1
  227. package/dist/pools/profit/to-user-pool-profit.d.ts +22 -4
  228. package/dist/pools/profit/to-user-pool-profit.d.ts.map +1 -1
  229. package/dist/pools/profit/to-user-pool-profit.js +28 -12
  230. package/dist/pools/profit/to-user-pool-profit.js.map +1 -1
  231. package/dist/pools/quotes/get-pool-quotes.d.ts +8 -1
  232. package/dist/pools/quotes/get-pool-quotes.d.ts.map +1 -1
  233. package/dist/pools/quotes/get-pool-quotes.js +8 -1
  234. package/dist/pools/quotes/get-pool-quotes.js.map +1 -1
  235. package/dist/pools/quotes/query-document.d.ts.map +1 -1
  236. package/dist/pools/quotes/query-document.js +1 -1
  237. package/dist/pools/quotes/query-document.js.map +1 -1
  238. package/dist/pools/quotes/to-pool-quote.d.ts.map +1 -1
  239. package/dist/pools/quotes/to-pool-quote.js +13 -0
  240. package/dist/pools/quotes/to-pool-quote.js.map +1 -1
  241. package/dist/pools/rewards/query.js +25 -25
  242. package/dist/pools/statistics/calculate-pool-statistics.d.ts +69 -0
  243. package/dist/pools/statistics/calculate-pool-statistics.d.ts.map +1 -0
  244. package/dist/pools/statistics/calculate-pool-statistics.js +42 -0
  245. package/dist/pools/statistics/calculate-pool-statistics.js.map +1 -0
  246. package/dist/pools/statistics/get-pool-statistics.d.ts +29 -0
  247. package/dist/pools/statistics/get-pool-statistics.d.ts.map +1 -0
  248. package/dist/pools/statistics/get-pool-statistics.js +61 -0
  249. package/dist/pools/statistics/get-pool-statistics.js.map +1 -0
  250. package/dist/pools/statistics/index.d.ts +4 -0
  251. package/dist/pools/statistics/index.d.ts.map +1 -0
  252. package/dist/pools/statistics/query.d.ts +17 -0
  253. package/dist/pools/statistics/query.d.ts.map +1 -0
  254. package/dist/pools/statistics/query.js +21 -0
  255. package/dist/pools/statistics/query.js.map +1 -0
  256. package/dist/pools/token-metadata/get-listing-token-metadata.d.ts +32 -0
  257. package/dist/pools/token-metadata/get-listing-token-metadata.d.ts.map +1 -0
  258. package/dist/pools/token-metadata/get-listing-token-metadata.js +43 -0
  259. package/dist/pools/token-metadata/get-listing-token-metadata.js.map +1 -0
  260. package/dist/pools/token-metadata/index.d.ts +3 -0
  261. package/dist/pools/token-metadata/index.d.ts.map +1 -0
  262. package/dist/pools/token-metadata/query.d.ts +11 -0
  263. package/dist/pools/token-metadata/query.d.ts.map +1 -0
  264. package/dist/pools/token-metadata/query.js +21 -0
  265. package/dist/pools/token-metadata/query.js.map +1 -0
  266. package/dist/pools/token-support/check-listing-token-support.d.ts +23 -0
  267. package/dist/pools/token-support/check-listing-token-support.d.ts.map +1 -0
  268. package/dist/pools/token-support/check-listing-token-support.js +36 -0
  269. package/dist/pools/token-support/check-listing-token-support.js.map +1 -0
  270. package/dist/pools/token-support/index.d.ts +3 -0
  271. package/dist/pools/token-support/index.d.ts.map +1 -0
  272. package/dist/pools/token-support/query.d.ts +11 -0
  273. package/dist/pools/token-support/query.d.ts.map +1 -0
  274. package/dist/pools/token-support/query.js +21 -0
  275. package/dist/pools/token-support/query.js.map +1 -0
  276. package/dist/pools/trade-history/calculate-history-metrics.d.ts +12 -0
  277. package/dist/pools/trade-history/calculate-history-metrics.d.ts.map +1 -0
  278. package/dist/pools/trade-history/calculate-history-metrics.js +36 -0
  279. package/dist/pools/trade-history/calculate-history-metrics.js.map +1 -0
  280. package/dist/pools/trade-history/get-pool-trade-history.d.ts +21 -1
  281. package/dist/pools/trade-history/get-pool-trade-history.d.ts.map +1 -1
  282. package/dist/pools/trade-history/get-pool-trade-history.js +57 -18
  283. package/dist/pools/trade-history/get-pool-trade-history.js.map +1 -1
  284. package/dist/pools/trade-history/query-document.d.ts +3 -0
  285. package/dist/pools/trade-history/query-document.d.ts.map +1 -1
  286. package/dist/pools/trade-history/query-document.js +1 -1
  287. package/dist/pools/trade-history/query-document.js.map +1 -1
  288. package/dist/pools/transactions/get-pool-transaction-range.d.ts +6 -0
  289. package/dist/pools/transactions/get-pool-transaction-range.d.ts.map +1 -0
  290. package/dist/pools/transactions/get-pool-transaction-range.js +26 -0
  291. package/dist/pools/transactions/get-pool-transaction-range.js.map +1 -0
  292. package/dist/pools/transactions/index.d.ts +1 -0
  293. package/dist/pools/transactions/index.d.ts.map +1 -1
  294. package/dist/pools/types/generated/listing-backend.js +34 -10
  295. package/dist/pools/types/generated/listing-backend.js.map +1 -1
  296. package/dist/pools/types.d.ts +129 -6
  297. package/dist/pools/types.d.ts.map +1 -1
  298. package/dist/pools/types.js.map +1 -1
  299. package/dist/pools/user-markets/get-user-listing-markets.d.ts +2 -0
  300. package/dist/pools/user-markets/get-user-listing-markets.d.ts.map +1 -1
  301. package/dist/pools/user-markets/get-user-listing-markets.js.map +1 -1
  302. package/dist/pools/user-markets/to-user-listing-market.js +1 -1
  303. package/dist/pools/user-markets/to-user-listing-market.js.map +1 -1
  304. package/dist/pools/user-transactions/get-user-transactions.d.ts +2 -0
  305. package/dist/pools/user-transactions/get-user-transactions.d.ts.map +1 -1
  306. package/dist/pools/user-transactions/get-user-transactions.js.map +1 -1
  307. package/dist/pools/user-transactions/to-user-transaction.d.ts +5 -1
  308. package/dist/pools/user-transactions/to-user-transaction.d.ts.map +1 -1
  309. package/dist/pools/user-transactions/to-user-transaction.js +3 -0
  310. package/dist/pools/user-transactions/to-user-transaction.js.map +1 -1
  311. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts +22 -12
  312. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts.map +1 -1
  313. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js +20 -21
  314. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js.map +1 -1
  315. package/dist/quotes/get-quote-events-by-type/query-document.d.ts +5 -5
  316. package/dist/quotes/get-quote-events-by-type/query-document.d.ts.map +1 -1
  317. package/dist/quotes/get-quote-events-by-type/query-document.js +1 -1
  318. package/dist/quotes/get-quote-events-by-type/query-document.js.map +1 -1
  319. package/dist/quotes/get-quote-events-by-type/query.d.ts +7 -6
  320. package/dist/quotes/get-quote-events-by-type/query.d.ts.map +1 -1
  321. package/dist/quotes/get-quote-events-by-type/query.js +19 -17
  322. package/dist/quotes/get-quote-events-by-type/query.js.map +1 -1
  323. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts +2 -2
  324. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts.map +1 -1
  325. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js +1 -3
  326. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js.map +1 -1
  327. package/dist/quotes/get-quote-events-by-type/types.d.ts +14 -3
  328. package/dist/quotes/get-quote-events-by-type/types.d.ts.map +1 -1
  329. package/dist/quotes/get-quote-events-by-type/types.js.map +1 -1
  330. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +12 -2
  331. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
  332. package/dist/quotes/get-quote-funding/get-quote-funding.js +21 -17
  333. package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
  334. package/dist/quotes/get-quote-funding/query-document.d.ts +3 -2
  335. package/dist/quotes/get-quote-funding/query-document.d.ts.map +1 -1
  336. package/dist/quotes/get-quote-funding/query-document.js +1 -1
  337. package/dist/quotes/get-quote-funding/query-document.js.map +1 -1
  338. package/dist/quotes/get-quote-funding/query.d.ts.map +1 -1
  339. package/dist/quotes/get-quote-funding/query.js +2 -1
  340. package/dist/quotes/get-quote-funding/query.js.map +1 -1
  341. package/dist/quotes/get-quote-funding/to-funding-row.d.ts.map +1 -1
  342. package/dist/quotes/get-quote-funding/to-funding-row.js +1 -3
  343. package/dist/quotes/get-quote-funding/to-funding-row.js.map +1 -1
  344. package/dist/quotes/get-quote-history/get-quote-history.d.ts +18 -7
  345. package/dist/quotes/get-quote-history/get-quote-history.d.ts.map +1 -1
  346. package/dist/quotes/get-quote-history/get-quote-history.js +32 -22
  347. package/dist/quotes/get-quote-history/get-quote-history.js.map +1 -1
  348. package/dist/quotes/get-quote-history/query-document.d.ts +12 -7
  349. package/dist/quotes/get-quote-history/query-document.d.ts.map +1 -1
  350. package/dist/quotes/get-quote-history/query-document.js +1 -1
  351. package/dist/quotes/get-quote-history/query-document.js.map +1 -1
  352. package/dist/quotes/get-quote-history/query.d.ts +3 -2
  353. package/dist/quotes/get-quote-history/query.d.ts.map +1 -1
  354. package/dist/quotes/get-quote-history/query.js +22 -19
  355. package/dist/quotes/get-quote-history/query.js.map +1 -1
  356. package/dist/quotes/get-quote-history/to-history-row.d.ts.map +1 -1
  357. package/dist/quotes/get-quote-history/to-history-row.js +52 -37
  358. package/dist/quotes/get-quote-history/to-history-row.js.map +1 -1
  359. package/dist/quotes/get-quote-history/types.d.ts +41 -0
  360. package/dist/quotes/get-quote-history/types.d.ts.map +1 -1
  361. package/dist/quotes/get-quote-history/types.js.map +1 -1
  362. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +21 -11
  363. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
  364. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js +19 -21
  365. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
  366. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts +7 -7
  367. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts.map +1 -1
  368. package/dist/quotes/get-quotes-events-by-type/query-document.js +1 -1
  369. package/dist/quotes/get-quotes-events-by-type/query-document.js.map +1 -1
  370. package/dist/quotes/get-quotes-events-by-type/query.d.ts +8 -6
  371. package/dist/quotes/get-quotes-events-by-type/query.d.ts.map +1 -1
  372. package/dist/quotes/get-quotes-events-by-type/query.js +22 -20
  373. package/dist/quotes/get-quotes-events-by-type/query.js.map +1 -1
  374. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts +38 -0
  375. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts.map +1 -0
  376. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js +28 -0
  377. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js.map +1 -0
  378. package/dist/quotes/get-subgraph-quotes/index.d.ts +5 -0
  379. package/dist/quotes/get-subgraph-quotes/index.d.ts.map +1 -0
  380. package/dist/quotes/get-subgraph-quotes/query-document.d.ts +15 -0
  381. package/dist/quotes/get-subgraph-quotes/query-document.d.ts.map +1 -0
  382. package/dist/quotes/get-subgraph-quotes/query-document.js +7 -0
  383. package/dist/quotes/get-subgraph-quotes/query-document.js.map +1 -0
  384. package/dist/quotes/get-subgraph-quotes/query.d.ts +37 -0
  385. package/dist/quotes/get-subgraph-quotes/query.d.ts.map +1 -0
  386. package/dist/quotes/get-subgraph-quotes/query.js +23 -0
  387. package/dist/quotes/get-subgraph-quotes/query.js.map +1 -0
  388. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts +12 -0
  389. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts.map +1 -0
  390. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js +32 -0
  391. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js.map +1 -0
  392. package/dist/quotes/get-subgraph-quotes/types.d.ts +54 -0
  393. package/dist/quotes/get-subgraph-quotes/types.d.ts.map +1 -0
  394. package/dist/quotes/index.d.ts +1 -0
  395. package/dist/quotes/index.d.ts.map +1 -1
  396. package/dist/quotes/liquidation/calculate-liquidation-price.d.ts +5 -1
  397. package/dist/quotes/liquidation/calculate-liquidation-price.d.ts.map +1 -1
  398. package/dist/quotes/liquidation/calculate-liquidation-price.js +1 -1
  399. package/dist/quotes/liquidation/calculate-liquidation-price.js.map +1 -1
  400. package/dist/quotes/upnl/calculate-quote-pnl.d.ts.map +1 -1
  401. package/dist/quotes/upnl/calculate-quote-pnl.js +8 -8
  402. package/dist/quotes/upnl/calculate-quote-pnl.js.map +1 -1
  403. package/dist/quotes/upnl/calculate-quote-upnl.d.ts +2 -2
  404. package/dist/quotes/upnl/calculate-quote-upnl.d.ts.map +1 -1
  405. package/dist/quotes/upnl/calculate-quote-upnl.js +16 -15
  406. package/dist/quotes/upnl/calculate-quote-upnl.js.map +1 -1
  407. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts +122 -0
  408. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts.map +1 -0
  409. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js +80 -0
  410. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js.map +1 -0
  411. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts +3 -0
  412. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts.map +1 -0
  413. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts +37 -0
  414. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts.map +1 -0
  415. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js +27 -0
  416. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js.map +1 -0
  417. package/dist/symmio-contracts/symmio/index.d.ts +2 -0
  418. package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
  419. package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts +3 -0
  420. package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts.map +1 -0
  421. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts +37 -0
  422. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts.map +1 -0
  423. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js +15 -0
  424. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js.map +1 -0
  425. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts +38 -0
  426. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts.map +1 -0
  427. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js +29 -0
  428. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js.map +1 -0
  429. package/dist/symmio-subgraph/index.d.ts +1 -0
  430. package/dist/symmio-subgraph/index.d.ts.map +1 -1
  431. package/dist/symmio-subgraph/subgraph-decode.d.ts +51 -0
  432. package/dist/symmio-subgraph/subgraph-decode.d.ts.map +1 -0
  433. package/dist/symmio-subgraph/subgraph-decode.js +24 -0
  434. package/dist/symmio-subgraph/subgraph-decode.js.map +1 -0
  435. package/dist/symmio-subgraph/subgraph-filters.d.ts +97 -0
  436. package/dist/symmio-subgraph/subgraph-filters.d.ts.map +1 -0
  437. package/dist/symmio-subgraph/subgraph-filters.js +39 -0
  438. package/dist/symmio-subgraph/subgraph-filters.js.map +1 -0
  439. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +26 -6
  440. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts.map +1 -1
  441. package/dist/symmio-subgraph/types/generated/analytics/gql.js +16 -11
  442. package/dist/symmio-subgraph/types/generated/analytics/gql.js.map +1 -1
  443. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts +3661 -9
  444. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts.map +1 -1
  445. package/dist/symmio-subgraph/types/generated/analytics/graphql.js +2 -2
  446. package/dist/symmio-subgraph/types/generated/analytics/graphql.js.map +1 -1
  447. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition.js","names":[],"sources":["../../src/pools/composition.ts"],"sourcesContent":["import { formatUnits } from \"viem\";\n\n/** A source that could not supply a complete snapshot. Never contains credentials or response bodies. */\nexport interface PoolReadGap {\n /** Read family, such as deposits, profit, detail, or listed. */\n source: string;\n /** Exact pool address, when the gap belongs to one pool. */\n tokenContractAddress?: string;\n /** Failed requests are distinct from bounded or repeated pagination. */\n reason: \"failed\" | \"truncated\" | \"repeated-page\" | \"ambiguous-address\";\n}\n\nexport function units(value: bigint | null | undefined): number | null {\n return value == null ? null : Number(formatUnits(value, 18));\n}\n\nexport async function readOptional<T>(\n read: () => Promise<T>,\n gaps: PoolReadGap[],\n source: string,\n tokenContractAddress?: string,\n): Promise<T | null> {\n try {\n return await read();\n } catch (error) {\n // Expired sessions must remain actionable errors, not partial portfolios.\n if (error && typeof error === \"object\" && \"status\" in error && (error.status === 401 || error.status === 403))\n throw error;\n gaps.push({ source, tokenContractAddress, reason: \"failed\" });\n return null;\n }\n}\n\nexport async function readPages<T>(\n read: (offset: number) => Promise<{ items: T[]; total: number }>,\n identity: (item: T) => string,\n gaps: PoolReadGap[],\n source: string,\n maxPages = 10,\n): Promise<T[]> {\n const values = new Map<string, T>();\n let offset = 0;\n for (let page = 0; page < maxPages; page++) {\n const result = await readOptional(() => read(offset), gaps, source);\n // A later page failing must not erase holdings discovered on earlier pages.\n // The gap still prevents callers from treating partial history as complete.\n if (result == null) return [...values.values()];\n const previousSize = values.size;\n for (const item of result.items) values.set(identity(item), item);\n offset += result.items.length;\n if (values.size >= result.total) return [...values.values()];\n if (values.size === previousSize) {\n gaps.push({ source, reason: \"repeated-page\" });\n return [...values.values()];\n }\n }\n gaps.push({ source, reason: \"truncated\" });\n return [...values.values()];\n}\n"],"mappings":";;AAYA,SAAgB,EAAM,GAAiD;CACrE,OAAO,KAAS,OAAO,OAAO,OAAO,EAAY,GAAO,EAAE,CAAC;AAC7D;AAEA,eAAsB,EACpB,GACA,GACA,GACA,GACmB;CACnB,IAAI;EACF,OAAO,MAAM,EAAK;CACpB,SAAS,GAAO;EAEd,IAAI,KAAS,OAAO,KAAU,YAAY,YAAY,MAAU,EAAM,WAAW,OAAO,EAAM,WAAW,MACvG,MAAM;EAER,OADA,EAAK,KAAK;GAAE;GAAQ;GAAsB,QAAQ;EAAS,CAAC,GACrD;CACT;AACF;AAEA,eAAsB,EACpB,GACA,GACA,GACA,GACA,IAAW,IACG;CACd,IAAM,oBAAS,IAAI,IAAe,GAC9B,IAAS;CACb,KAAK,IAAI,IAAO,GAAG,IAAO,GAAU,KAAQ;EAC1C,IAAM,IAAS,MAAM,QAAmB,EAAK,CAAM,GAAG,GAAM,CAAM;EAGlE,IAAI,KAAU,MAAM,OAAO,CAAC,GAAG,EAAO,OAAO,CAAC;EAC9C,IAAM,IAAe,EAAO;EAC5B,KAAK,IAAM,KAAQ,EAAO,OAAO,EAAO,IAAI,EAAS,CAAI,GAAG,CAAI;EAEhE,IADA,KAAU,EAAO,MAAM,QACnB,EAAO,QAAQ,EAAO,OAAO,OAAO,CAAC,GAAG,EAAO,OAAO,CAAC;EAC3D,IAAI,EAAO,SAAS,GAElB,OADA,EAAK,KAAK;GAAE;GAAQ,QAAQ;EAAgB,CAAC,GACtC,CAAC,GAAG,EAAO,OAAO,CAAC;CAE9B;CAEA,OADA,EAAK,KAAK;EAAE;EAAQ,QAAQ;CAAY,CAAC,GAClC,CAAC,GAAG,EAAO,OAAO,CAAC;AAC5B"}
@@ -0,0 +1,4 @@
1
+ import { UserPoolProfit } from './types.js';
2
+ /** A confirmed absence of an LP position, never a fallback for a failed read. */
3
+ export declare function emptyPoolProfit(): UserPoolProfit;
4
+ //# sourceMappingURL=empty-pool-profit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-pool-profit.d.ts","sourceRoot":"","sources":["../../src/pools/empty-pool-profit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,iFAAiF;AACjF,wBAAgB,eAAe,IAAI,cAAc,CAWhD"}
@@ -0,0 +1,17 @@
1
+ //#region src/pools/empty-pool-profit.ts
2
+ function e() {
3
+ return {
4
+ userBalanceInTokens: 0n,
5
+ userBalanceInUsdc: 0n,
6
+ userLpAmount: 0n,
7
+ pendingWithdrawLpAmount: 0n,
8
+ availableLpAmount: 0n,
9
+ userDepositedTokenAmount: 0n,
10
+ claimableReward: 0n,
11
+ claimedReward: 0n
12
+ };
13
+ }
14
+ //#endregion
15
+ export { e as emptyPoolProfit };
16
+
17
+ //# sourceMappingURL=empty-pool-profit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-pool-profit.js","names":[],"sources":["../../src/pools/empty-pool-profit.ts"],"sourcesContent":["import type { UserPoolProfit } from \"./types\";\n\n/** A confirmed absence of an LP position, never a fallback for a failed read. */\nexport function emptyPoolProfit(): UserPoolProfit {\n return {\n userBalanceInTokens: 0n,\n userBalanceInUsdc: 0n,\n userLpAmount: 0n,\n pendingWithdrawLpAmount: 0n,\n availableLpAmount: 0n,\n userDepositedTokenAmount: 0n,\n claimableReward: 0n,\n claimedReward: 0n,\n };\n}\n"],"mappings":";AAGA,SAAgB,IAAkC;CAChD,OAAO;EACL,qBAAqB;EACrB,mBAAmB;EACnB,cAAc;EACd,yBAAyB;EACzB,mBAAmB;EACnB,0BAA0B;EAC1B,iBAAiB;EACjB,eAAe;CACjB;AACF"}
@@ -6,9 +6,14 @@ export * from './claim-history/index.js';
6
6
  export * from './deposit-address/index.js';
7
7
  export * from './listing-config/index.js';
8
8
  export * from './listing-status/index.js';
9
+ export * from './maintenance-fees/index.js';
9
10
  export * from './market-config/index.js';
11
+ export * from './market-data/index.js';
10
12
  export * from './market-detail/index.js';
11
13
  export * from './markets/index.js';
14
+ export * from './open-positions/index.js';
15
+ export * from './portfolio/index.js';
16
+ export * from './position/index.js';
12
17
  export * from './profit/index.js';
13
18
  export * from './quotes/index.js';
14
19
  export * from './refund/index.js';
@@ -16,7 +21,10 @@ export * from './resolve-listing.js';
16
21
  export * from './resolve-pool-source.js';
17
22
  export * from './retry-listing/index.js';
18
23
  export * from './rewards/index.js';
24
+ export * from './statistics/index.js';
25
+ export * from './token-metadata/index.js';
19
26
  export * from './token-price/index.js';
27
+ export * from './token-support/index.js';
20
28
  export * from './trade-history/index.js';
21
29
  export * from './transactions/index.js';
22
30
  export * from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pools/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pools/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
@@ -12,5 +12,9 @@ import { ClientConfigResponse } from '../types/generated/listing-backend.js';
12
12
  * @param raw - The service's `/v2/configs` response body.
13
13
  * @returns The normalized listing config.
14
14
  */
15
- export declare function toListingConfig(raw: ClientConfigResponse): ListingConfig;
15
+ export declare function toListingConfig(raw: Omit<Partial<ClientConfigResponse>, "rate_limits"> & {
16
+ rate_limits?: Partial<ClientConfigResponse["rate_limits"]>;
17
+ minimum_initial_deposit_usdc?: string | null;
18
+ recommended_initial_deposit_usdc?: string | null;
19
+ }): ListingConfig;
16
20
  //# sourceMappingURL=to-listing-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-listing-config.d.ts","sourceRoot":"","sources":["../../../src/pools/listing-config/to-listing-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAA0C,MAAM,UAAU,CAAC;AAEtF,OAAO,KAAK,EAAE,oBAAoB,EAA+B,MAAM,oCAAoC,CAAC;AAe5G;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,oBAAoB,GAAG,aAAa,CAcxE"}
1
+ {"version":3,"file":"to-listing-config.d.ts","sourceRoot":"","sources":["../../../src/pools/listing-config/to-listing-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAA0C,MAAM,UAAU,CAAC;AAEtF,OAAO,KAAK,EAAE,oBAAoB,EAA+B,MAAM,oCAAoC,CAAC;AAe5G;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,aAAa,CAAC,GAAG;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3D,4BAA4B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,gCAAgC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD,GACA,aAAa,CAsCf"}
@@ -7,17 +7,28 @@ function t(e) {
7
7
  };
8
8
  }
9
9
  function n(n) {
10
- let r = {
11
- marketConfigUpdatesPerDay: n.rate_limits.market_config_updates_per_day,
12
- profitClaimsPerDay: n.rate_limits.profit_claims_per_day
10
+ let r = "minimum_initial_deposit_usdc" in n && typeof n.minimum_initial_deposit_usdc == "string" ? n.minimum_initial_deposit_usdc : void 0, i = "recommended_initial_deposit_usdc" in n && typeof n.recommended_initial_deposit_usdc == "string" ? n.recommended_initial_deposit_usdc : void 0, a = r != null || i != null, o = e(a ? r : n.minimum_deposit_usdc), s = e(n.recommended_deposit_usdc ?? i), c = n.max_leverage_bounds, l = c && Number.isFinite(c.minimum) && Number.isFinite(c.maximum) && c.minimum <= c.maximum ? {
11
+ minimum: c.minimum,
12
+ maximum: c.maximum
13
+ } : null, u = {
14
+ marketConfigUpdatesPerDay: n.rate_limits?.market_config_updates_per_day ?? null,
15
+ profitClaimsPerDay: n.rate_limits?.profit_claims_per_day ?? null
13
16
  };
14
17
  return {
15
- recommendedInitialDepositUsdc: e(n.recommended_deposit_usdc) ?? 0n,
16
- minimumInitialDepositUsdc: e(n.minimum_deposit_usdc) ?? 0n,
18
+ recommendedDepositUsdc: s,
19
+ minimumDepositUsdc: o,
20
+ legacyUniversalDepositFloorUsdc: a ? e(n.minimum_deposit_usdc) : null,
21
+ reportedListingFeeUsdc: e(n.listing_fee_usdc),
22
+ maxLeverageBounds: l,
23
+ reportedMarketConfigUpdatesPerDay: n.rate_limits?.market_config_updates_per_day ?? null,
24
+ reportedProfitClaimsPerDay: n.rate_limits?.profit_claims_per_day ?? null,
25
+ reportedProtocolRewardSharePercent: n.protocol_reward_share_percent ?? null,
26
+ recommendedInitialDepositUsdc: s ?? 0n,
27
+ minimumInitialDepositUsdc: o ?? 0n,
17
28
  listingFeeUsdc: e(n.listing_fee_usdc) ?? 0n,
18
- supportedDepositChains: n.supported_deposit_chains.map(t),
19
- rateLimits: r,
20
- protocolRewardSharePercent: n.protocol_reward_share_percent
29
+ supportedDepositChains: (n.supported_deposit_chains ?? []).map(t),
30
+ rateLimits: u,
31
+ protocolRewardSharePercent: n.protocol_reward_share_percent ?? 0
21
32
  };
22
33
  }
23
34
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"to-listing-config.js","names":[],"sources":["../../../src/pools/listing-config/to-listing-config.ts"],"sourcesContent":["import { toListingValue } from \"../markets/to-listing-market\";\nimport type { ListingConfig, ListingDepositChain, ListingRateLimits } from \"../types\";\nimport { ListingDepositChainId } from \"../types\";\nimport type { ClientConfigResponse, SupportedDepositChainConfig } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw `SupportedDepositChainConfig` into a {@link ListingDepositChain}.\n *\n * @param raw - One entry of the config's `supported_deposit_chains` array.\n * @returns The normalized deposit chain.\n */\nfunction toListingDepositChain(raw: SupportedDepositChainConfig): ListingDepositChain {\n return {\n chainId: raw.chain_id as ListingDepositChainId,\n chainName: raw.chain_name,\n };\n}\n\n/**\n * Map the listing service's raw `ClientConfigResponse` into the SDK's\n * {@link ListingConfig}.\n *\n * The three `*_usdc` figures are required 18-decimal strings; each is parsed\n * with {@link toListingValue} and defaulted to `0n` if the service ever returns\n * a malformed value (`toListingValue` returns `null` there). The wire's\n * snake_case becomes the SDK's camelCase.\n *\n * @param raw - The service's `/v2/configs` response body.\n * @returns The normalized listing config.\n */\nexport function toListingConfig(raw: ClientConfigResponse): ListingConfig {\n const rateLimits: ListingRateLimits = {\n marketConfigUpdatesPerDay: raw.rate_limits.market_config_updates_per_day,\n profitClaimsPerDay: raw.rate_limits.profit_claims_per_day,\n };\n\n return {\n recommendedInitialDepositUsdc: toListingValue(raw.recommended_deposit_usdc) ?? 0n,\n minimumInitialDepositUsdc: toListingValue(raw.minimum_deposit_usdc) ?? 0n,\n listingFeeUsdc: toListingValue(raw.listing_fee_usdc) ?? 0n,\n supportedDepositChains: raw.supported_deposit_chains.map(toListingDepositChain),\n rateLimits,\n protocolRewardSharePercent: raw.protocol_reward_share_percent,\n };\n}\n"],"mappings":";;AAWA,SAAS,EAAsB,GAAuD;CACpF,OAAO;EACL,SAAS,EAAI;EACb,WAAW,EAAI;CACjB;AACF;AAcA,SAAgB,EAAgB,GAA0C;CACxE,IAAM,IAAgC;EACpC,2BAA2B,EAAI,YAAY;EAC3C,oBAAoB,EAAI,YAAY;CACtC;CAEA,OAAO;EACL,+BAA+B,EAAe,EAAI,wBAAwB,KAAK;EAC/E,2BAA2B,EAAe,EAAI,oBAAoB,KAAK;EACvE,gBAAgB,EAAe,EAAI,gBAAgB,KAAK;EACxD,wBAAwB,EAAI,yBAAyB,IAAI,CAAqB;EAC9E;EACA,4BAA4B,EAAI;CAClC;AACF"}
1
+ {"version":3,"file":"to-listing-config.js","names":[],"sources":["../../../src/pools/listing-config/to-listing-config.ts"],"sourcesContent":["import { toListingValue } from \"../markets/to-listing-market\";\nimport type { ListingConfig, ListingDepositChain, ListingRateLimits } from \"../types\";\nimport { ListingDepositChainId } from \"../types\";\nimport type { ClientConfigResponse, SupportedDepositChainConfig } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw `SupportedDepositChainConfig` into a {@link ListingDepositChain}.\n *\n * @param raw - One entry of the config's `supported_deposit_chains` array.\n * @returns The normalized deposit chain.\n */\nfunction toListingDepositChain(raw: SupportedDepositChainConfig): ListingDepositChain {\n return {\n chainId: raw.chain_id as ListingDepositChainId,\n chainName: raw.chain_name,\n };\n}\n\n/**\n * Map the listing service's raw `ClientConfigResponse` into the SDK's\n * {@link ListingConfig}.\n *\n * The three `*_usdc` figures are required 18-decimal strings; each is parsed\n * with {@link toListingValue} and defaulted to `0n` if the service ever returns\n * a malformed value (`toListingValue` returns `null` there). The wire's\n * snake_case becomes the SDK's camelCase.\n *\n * @param raw - The service's `/v2/configs` response body.\n * @returns The normalized listing config.\n */\nexport function toListingConfig(\n raw: Omit<Partial<ClientConfigResponse>, \"rate_limits\"> & {\n rate_limits?: Partial<ClientConfigResponse[\"rate_limits\"]>;\n minimum_initial_deposit_usdc?: string | null;\n recommended_initial_deposit_usdc?: string | null;\n },\n): ListingConfig {\n const legacyMinimum =\n \"minimum_initial_deposit_usdc\" in raw && typeof raw.minimum_initial_deposit_usdc === \"string\"\n ? raw.minimum_initial_deposit_usdc\n : undefined;\n const legacyRecommended =\n \"recommended_initial_deposit_usdc\" in raw && typeof raw.recommended_initial_deposit_usdc === \"string\"\n ? raw.recommended_initial_deposit_usdc\n : undefined;\n const isLegacy = legacyMinimum != null || legacyRecommended != null;\n const minimumDepositUsdc = toListingValue(isLegacy ? legacyMinimum : raw.minimum_deposit_usdc);\n const recommendedDepositUsdc = toListingValue(raw.recommended_deposit_usdc ?? legacyRecommended);\n const bounds = raw.max_leverage_bounds;\n const maxLeverageBounds =\n bounds && Number.isFinite(bounds.minimum) && Number.isFinite(bounds.maximum) && bounds.minimum <= bounds.maximum\n ? { minimum: bounds.minimum, maximum: bounds.maximum }\n : null;\n const rateLimits: ListingRateLimits = {\n marketConfigUpdatesPerDay: raw.rate_limits?.market_config_updates_per_day ?? null,\n profitClaimsPerDay: raw.rate_limits?.profit_claims_per_day ?? null,\n };\n\n return {\n recommendedDepositUsdc,\n minimumDepositUsdc,\n legacyUniversalDepositFloorUsdc: isLegacy ? toListingValue(raw.minimum_deposit_usdc) : null,\n reportedListingFeeUsdc: toListingValue(raw.listing_fee_usdc),\n maxLeverageBounds,\n reportedMarketConfigUpdatesPerDay: raw.rate_limits?.market_config_updates_per_day ?? null,\n reportedProfitClaimsPerDay: raw.rate_limits?.profit_claims_per_day ?? null,\n reportedProtocolRewardSharePercent: raw.protocol_reward_share_percent ?? null,\n recommendedInitialDepositUsdc: recommendedDepositUsdc ?? 0n,\n minimumInitialDepositUsdc: minimumDepositUsdc ?? 0n,\n listingFeeUsdc: toListingValue(raw.listing_fee_usdc) ?? 0n,\n supportedDepositChains: (raw.supported_deposit_chains ?? []).map(toListingDepositChain),\n rateLimits,\n protocolRewardSharePercent: raw.protocol_reward_share_percent ?? 0,\n };\n}\n"],"mappings":";;AAWA,SAAS,EAAsB,GAAuD;CACpF,OAAO;EACL,SAAS,EAAI;EACb,WAAW,EAAI;CACjB;AACF;AAcA,SAAgB,EACd,GAKe;CACf,IAAM,IACJ,kCAAkC,KAAO,OAAO,EAAI,gCAAiC,WACjF,EAAI,+BACJ,KAAA,GACA,IACJ,sCAAsC,KAAO,OAAO,EAAI,oCAAqC,WACzF,EAAI,mCACJ,KAAA,GACA,IAAW,KAAiB,QAAQ,KAAqB,MACzD,IAAqB,EAAe,IAAW,IAAgB,EAAI,oBAAoB,GACvF,IAAyB,EAAe,EAAI,4BAA4B,CAAiB,GACzF,IAAS,EAAI,qBACb,IACJ,KAAU,OAAO,SAAS,EAAO,OAAO,KAAK,OAAO,SAAS,EAAO,OAAO,KAAK,EAAO,WAAW,EAAO,UACrG;EAAE,SAAS,EAAO;EAAS,SAAS,EAAO;CAAQ,IACnD,MACA,IAAgC;EACpC,2BAA2B,EAAI,aAAa,iCAAiC;EAC7E,oBAAoB,EAAI,aAAa,yBAAyB;CAChE;CAEA,OAAO;EACL;EACA;EACA,iCAAiC,IAAW,EAAe,EAAI,oBAAoB,IAAI;EACvF,wBAAwB,EAAe,EAAI,gBAAgB;EAC3D;EACA,mCAAmC,EAAI,aAAa,iCAAiC;EACrF,4BAA4B,EAAI,aAAa,yBAAyB;EACtE,oCAAoC,EAAI,iCAAiC;EACzE,+BAA+B,KAA0B;EACzD,2BAA2B,KAAsB;EACjD,gBAAgB,EAAe,EAAI,gBAAgB,KAAK;EACxD,yBAAyB,EAAI,4BAA4B,CAAC,GAAG,IAAI,CAAqB;EACtF;EACA,4BAA4B,EAAI,iCAAiC;CACnE;AACF"}
@@ -0,0 +1,37 @@
1
+ import { Config } from '../../core/config/index.js';
2
+ import { ChainIdParameter } from '../../shared/types/properties.js';
3
+ /** One maintenance sale, with monetary values at 18 decimals. */
4
+ export interface PoolMaintenanceFee {
5
+ /** Tokens sold. */ tokenAmount: bigint;
6
+ /** USDC received. */ usdcAmount: bigint;
7
+ /** Execution time in Unix seconds. */ timestamp: number;
8
+ /** On-chain hash, when supplied. */ transactionHash: string | null;
9
+ }
10
+ /** Paginated maintenance sales. */
11
+ export interface PoolMaintenanceFees {
12
+ /** Total records. */ total: number;
13
+ /** This page's sales. */ items: PoolMaintenanceFee[];
14
+ }
15
+ /** Inputs for {@link getPoolMaintenanceFees}. Deployment chainId is separate from depositChain. */
16
+ export type GetPoolMaintenanceFeesParameters = ChainIdParameter & {
17
+ /** Pool token address. */
18
+ tokenContractAddress: string;
19
+ /** Chain the pool token lives on. */
20
+ depositChain: number;
21
+ /** Page size. */
22
+ limit?: number;
23
+ /** Page offset. */
24
+ offset?: number;
25
+ };
26
+ /** Result of {@link getPoolMaintenanceFees}. */
27
+ export type GetPoolMaintenanceFeesReturnType = PoolMaintenanceFees;
28
+ /**
29
+ * Read a pool's maintenance-sale history from the configured listing service.
30
+ * @param config - SDK configuration.
31
+ * @param parameters - Token identity and request parameters.
32
+ * @returns The normalized service result.
33
+ * @example
34
+ * await getPoolMaintenanceFees(config, { chainId: 42161, depositChain: 0, tokenContractAddress: mint });
35
+ */
36
+ export declare function getPoolMaintenanceFees(config: Config, parameters: GetPoolMaintenanceFeesParameters): Promise<GetPoolMaintenanceFeesReturnType>;
37
+ //# sourceMappingURL=get-pool-maintenance-fees.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pool-maintenance-fees.d.ts","sourceRoot":"","sources":["../../../src/pools/maintenance-fees/get-pool-maintenance-fees.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC;IACxC,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC;IACzC,sCAAsC,CAAC,SAAS,EAAE,MAAM,CAAC;IACzD,oCAAoC,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CACrE;AACD,mCAAmC;AACnC,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC;IACpC,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,EAAE,CAAC;CACvD;AACD,mGAAmG;AACnG,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,GAAG;IAChE,0BAA0B;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,gDAAgD;AAChD,MAAM,MAAM,gCAAgC,GAAG,mBAAmB,CAAC;AAEnE;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,gCAAgC,GAC3C,OAAO,CAAC,gCAAgC,CAAC,CA0B3C"}
@@ -0,0 +1,35 @@
1
+ import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
2
+ import { resolveListingService as n } from "../resolve-listing.js";
3
+ import { getMaintenanceFeeRecordsV2MarketMaintenanceFeesGet as r } from "../types/generated/listing-backend.js";
4
+ import { toListingValue as i } from "../markets/to-listing-market.js";
5
+ import { isAxiosError as a } from "axios";
6
+ //#region src/pools/maintenance-fees/get-pool-maintenance-fees.ts
7
+ async function o(o, s) {
8
+ let { url: c } = n(o, { chainId: s.chainId });
9
+ try {
10
+ let { data: e } = await r({
11
+ market_address: s.tokenContractAddress,
12
+ chain_id: s.depositChain,
13
+ limit: s.limit,
14
+ offset: s.offset
15
+ }, { baseURL: c });
16
+ return {
17
+ total: e.total,
18
+ items: e.items.map((e) => ({
19
+ tokenAmount: i(e.token_amount) ?? 0n,
20
+ usdcAmount: i(e.usdc_amount) ?? 0n,
21
+ timestamp: e.timestamp / 1e3,
22
+ transactionHash: e.tx_hash ?? null
23
+ }))
24
+ };
25
+ } catch (n) {
26
+ throw n instanceof t ? n : a(n) ? e.fromAxios(n, {
27
+ code: "GET_POOL_MAINTENANCE_FEES_FAILED",
28
+ baseURL: c
29
+ }) : new t("api", "GET_POOL_MAINTENANCE_FEES_FAILED", "Listing request failed", { cause: n });
30
+ }
31
+ }
32
+ //#endregion
33
+ export { o as getPoolMaintenanceFees };
34
+
35
+ //# sourceMappingURL=get-pool-maintenance-fees.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pool-maintenance-fees.js","names":[],"sources":["../../../src/pools/maintenance-fees/get-pool-maintenance-fees.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter } from \"../../shared/types/properties\";\nimport { toListingValue } from \"../markets/to-listing-market\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport { getMaintenanceFeeRecordsV2MarketMaintenanceFeesGet } from \"../types/generated/listing-backend\";\n\n/** One maintenance sale, with monetary values at 18 decimals. */\nexport interface PoolMaintenanceFee {\n /** Tokens sold. */ tokenAmount: bigint;\n /** USDC received. */ usdcAmount: bigint;\n /** Execution time in Unix seconds. */ timestamp: number;\n /** On-chain hash, when supplied. */ transactionHash: string | null;\n}\n/** Paginated maintenance sales. */\nexport interface PoolMaintenanceFees {\n /** Total records. */ total: number;\n /** This page's sales. */ items: PoolMaintenanceFee[];\n}\n/** Inputs for {@link getPoolMaintenanceFees}. Deployment chainId is separate from depositChain. */\nexport type GetPoolMaintenanceFeesParameters = ChainIdParameter & {\n /** Pool token address. */\n tokenContractAddress: string;\n /** Chain the pool token lives on. */\n depositChain: number;\n /** Page size. */\n limit?: number;\n /** Page offset. */\n offset?: number;\n};\n/** Result of {@link getPoolMaintenanceFees}. */\nexport type GetPoolMaintenanceFeesReturnType = PoolMaintenanceFees;\n\n/**\n * Read a pool's maintenance-sale history from the configured listing service.\n * @param config - SDK configuration.\n * @param parameters - Token identity and request parameters.\n * @returns The normalized service result.\n * @example\n * await getPoolMaintenanceFees(config, { chainId: 42161, depositChain: 0, tokenContractAddress: mint });\n */\nexport async function getPoolMaintenanceFees(\n config: Config,\n parameters: GetPoolMaintenanceFeesParameters,\n): Promise<GetPoolMaintenanceFeesReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n try {\n const { data } = await getMaintenanceFeeRecordsV2MarketMaintenanceFeesGet(\n {\n market_address: parameters.tokenContractAddress,\n chain_id: parameters.depositChain,\n limit: parameters.limit,\n offset: parameters.offset,\n },\n { baseURL },\n );\n return {\n total: data.total,\n items: data.items.map((row) => ({\n tokenAmount: toListingValue(row.token_amount) ?? 0n,\n usdcAmount: toListingValue(row.usdc_amount) ?? 0n,\n timestamp: row.timestamp / 1000,\n transactionHash: row.tx_hash ?? null,\n })),\n };\n } catch (error) {\n if (error instanceof SymmError) throw error;\n if (isAxiosError(error)) throw SymmApiError.fromAxios(error, { code: \"GET_POOL_MAINTENANCE_FEES_FAILED\", baseURL });\n throw new SymmError(\"api\", \"GET_POOL_MAINTENANCE_FEES_FAILED\", \"Listing request failed\", { cause: error });\n }\n}\n"],"mappings":";;;;;;AA0CA,eAAsB,EACpB,GACA,GAC2C;CAC3C,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC;CACtF,IAAI;EACF,IAAM,EAAE,YAAS,MAAM,EACrB;GACE,gBAAgB,EAAW;GAC3B,UAAU,EAAW;GACrB,OAAO,EAAW;GAClB,QAAQ,EAAW;EACrB,GACA,EAAE,WAAQ,CACZ;EACA,OAAO;GACL,OAAO,EAAK;GACZ,OAAO,EAAK,MAAM,KAAK,OAAS;IAC9B,aAAa,EAAe,EAAI,YAAY,KAAK;IACjD,YAAY,EAAe,EAAI,WAAW,KAAK;IAC/C,WAAW,EAAI,YAAY;IAC3B,iBAAiB,EAAI,WAAW;GAClC,EAAE;EACJ;CACF,SAAS,GAAO;EAGd,MAFI,aAAiB,IAAiB,IAClC,EAAa,CAAK,IAAS,EAAa,UAAU,GAAO;GAAE,MAAM;GAAoC;EAAQ,CAAC,IAC5G,IAAI,EAAU,OAAO,oCAAoC,0BAA0B,EAAE,OAAO,EAAM,CAAC;CAC3G;AACF"}
@@ -0,0 +1,3 @@
1
+ export * from './get-pool-maintenance-fees.js';
2
+ export * from './query.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pools/maintenance-fees/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Config } from '../../core/config/index.js';
2
+ import { ConfigKeyParameter } from '../../shared/types/properties.js';
3
+ import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
4
+ import { GetPoolMaintenanceFeesParameters, GetPoolMaintenanceFeesReturnType } from './get-pool-maintenance-fees.js';
5
+ /** Query options for {@link getPoolMaintenanceFees}. */
6
+ export type GetPoolMaintenanceFeesOptions = GetPoolMaintenanceFeesParameters & QueryParameter<GetPoolMaintenanceFeesReturnType>;
7
+ /** Stable cache identity, including deployment configuration. */
8
+ export declare function getPoolMaintenanceFeesQueryKey(options: GetPoolMaintenanceFeesParameters & ConfigKeyParameter): readonly ["getPoolMaintenanceFees", Record<string, unknown>];
9
+ /** Build options for the listing read. Required identity/auth inputs gate execution. */
10
+ export declare function getPoolMaintenanceFeesQueryOptions(config: Config, options: GetPoolMaintenanceFeesOptions): SymmioQueryOptions<GetPoolMaintenanceFeesReturnType>;
11
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/pools/maintenance-fees/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAEL,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;AAErC,wDAAwD;AACxD,MAAM,MAAM,6BAA6B,GAAG,gCAAgC,GAC1E,cAAc,CAAC,gCAAgC,CAAC,CAAC;AACnD,iEAAiE;AACjE,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,gCAAgC,GAAG,kBAAkB,gEAE5G;AACD,wFAAwF;AACxF,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,6BAA6B,GACrC,kBAAkB,CAAC,gCAAgC,CAAC,CAOtD"}
@@ -0,0 +1,21 @@
1
+ import { filterQueryOptions as e } from "../../shared/utils/query.js";
2
+ import { getPoolMaintenanceFees as t } from "./get-pool-maintenance-fees.js";
3
+ //#region src/pools/maintenance-fees/query.ts
4
+ function n(t) {
5
+ return ["getPoolMaintenanceFees", 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.tokenContractAddress,
15
+ queryFn: () => t(e, r)
16
+ };
17
+ }
18
+ //#endregion
19
+ export { n as getPoolMaintenanceFeesQueryKey, r as getPoolMaintenanceFeesQueryOptions };
20
+
21
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","names":[],"sources":["../../../src/pools/maintenance-fees/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n getPoolMaintenanceFees,\n type GetPoolMaintenanceFeesParameters,\n type GetPoolMaintenanceFeesReturnType,\n} from \"./get-pool-maintenance-fees\";\n\n/** Query options for {@link getPoolMaintenanceFees}. */\nexport type GetPoolMaintenanceFeesOptions = GetPoolMaintenanceFeesParameters &\n QueryParameter<GetPoolMaintenanceFeesReturnType>;\n/** Stable cache identity, including deployment configuration. */\nexport function getPoolMaintenanceFeesQueryKey(options: GetPoolMaintenanceFeesParameters & ConfigKeyParameter) {\n return [\"getPoolMaintenanceFees\", filterQueryOptions({ ...options })] as const;\n}\n/** Build options for the listing read. Required identity/auth inputs gate execution. */\nexport function getPoolMaintenanceFeesQueryOptions(\n config: Config,\n options: GetPoolMaintenanceFeesOptions,\n): SymmioQueryOptions<GetPoolMaintenanceFeesReturnType> {\n return {\n ...options.query,\n queryKey: getPoolMaintenanceFeesQueryKey({ ...options, configKey: config.getChainConfigKey(options.chainId) }),\n enabled: (options.query?.enabled ?? true) && !!options.tokenContractAddress,\n queryFn: () => getPoolMaintenanceFees(config, options),\n };\n}\n"],"mappings":";;;AAcA,SAAgB,EAA+B,GAAgE;CAC7G,OAAO,CAAC,0BAA0B,EAAmB,EAAE,GAAG,EAAQ,CAAC,CAAC;AACtE;AAEA,SAAgB,EACd,GACA,GACsD;CACtD,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA+B;GAAE,GAAG;GAAS,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EAAE,CAAC;EAC7G,UAAU,EAAQ,OAAO,WAAW,OAAS,CAAC,CAAC,EAAQ;EACvD,eAAe,EAAuB,GAAQ,CAAO;CACvD;AACF"}
@@ -14,5 +14,10 @@ import { ListingMarketConfig } from './types.js';
14
14
  * @param raw - The service's `/v2/market/config` response body.
15
15
  * @returns The normalized market config.
16
16
  */
17
- export declare function toListingMarketConfig(raw: UpdateMarketConfigResponseSchema): ListingMarketConfig;
17
+ export declare function toListingMarketConfig(raw: UpdateMarketConfigResponseSchema & {
18
+ max_leverage_bounds?: {
19
+ minimum: number;
20
+ maximum: number;
21
+ } | null;
22
+ }): ListingMarketConfig;
18
23
  //# sourceMappingURL=to-listing-market-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-listing-market-config.d.ts","sourceRoot":"","sources":["../../../src/pools/market-config/to-listing-market-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gCAAgC,GAAG,mBAAmB,CAShG"}
1
+ {"version":3,"file":"to-listing-market-config.d.ts","sourceRoot":"","sources":["../../../src/pools/market-config/to-listing-market-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,gCAAgC,GAAG;IAAE,mBAAmB,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,GAC5G,mBAAmB,CAUrB"}
@@ -1,6 +1,7 @@
1
1
  //#region src/pools/market-config/to-listing-market-config.ts
2
2
  function e(e) {
3
3
  return {
4
+ maxLeverageBounds: e.max_leverage_bounds ?? null,
4
5
  tokenContractAddress: e.token_contract_address,
5
6
  depositChain: e.deposit_chain,
6
7
  userMaxLeverage: e.user_max_leverage ?? null,
@@ -1 +1 @@
1
- {"version":3,"file":"to-listing-market-config.js","names":[],"sources":["../../../src/pools/market-config/to-listing-market-config.ts"],"sourcesContent":["import type { ListingDepositChainId } from \"../types\";\nimport type { UpdateMarketConfigResponseSchema } from \"../types/generated/listing-backend\";\nimport type { ListingMarketConfig } from \"./types\";\n\n/**\n * Map the listing service's raw `/v2/market/config` body into the SDK's\n * {@link ListingMarketConfig}.\n *\n * Both endpoints on that path — the `GET` read and the `POST` write — return the\n * same schema, so both actions share this mapper. Nothing is rescaled: the four\n * numbers are plain whole values on the wire (`50` = 50%, `20` = 20x), unlike\n * every money field on the listing service. The nullable `user_*` fields are\n * normalized from `undefined` to `null`, so \"never configured\" is one value\n * rather than two.\n *\n * @param raw - The service's `/v2/market/config` response body.\n * @returns The normalized market config.\n */\nexport function toListingMarketConfig(raw: UpdateMarketConfigResponseSchema): ListingMarketConfig {\n return {\n tokenContractAddress: raw.token_contract_address,\n depositChain: raw.deposit_chain as ListingDepositChainId,\n userMaxLeverage: raw.user_max_leverage ?? null,\n userBuybackRatio: raw.user_buyback_ratio ?? null,\n maxLeverage: raw.max_leverage,\n buybackRatio: raw.buyback_ratio,\n };\n}\n"],"mappings":";AAkBA,SAAgB,EAAsB,GAA4D;CAChG,OAAO;EACL,sBAAsB,EAAI;EAC1B,cAAc,EAAI;EAClB,iBAAiB,EAAI,qBAAqB;EAC1C,kBAAkB,EAAI,sBAAsB;EAC5C,aAAa,EAAI;EACjB,cAAc,EAAI;CACpB;AACF"}
1
+ {"version":3,"file":"to-listing-market-config.js","names":[],"sources":["../../../src/pools/market-config/to-listing-market-config.ts"],"sourcesContent":["import type { ListingDepositChainId } from \"../types\";\nimport type { UpdateMarketConfigResponseSchema } from \"../types/generated/listing-backend\";\nimport type { ListingMarketConfig } from \"./types\";\n\n/**\n * Map the listing service's raw `/v2/market/config` body into the SDK's\n * {@link ListingMarketConfig}.\n *\n * Both endpoints on that path — the `GET` read and the `POST` write — return the\n * same schema, so both actions share this mapper. Nothing is rescaled: the four\n * numbers are plain whole values on the wire (`50` = 50%, `20` = 20x), unlike\n * every money field on the listing service. The nullable `user_*` fields are\n * normalized from `undefined` to `null`, so \"never configured\" is one value\n * rather than two.\n *\n * @param raw - The service's `/v2/market/config` response body.\n * @returns The normalized market config.\n */\nexport function toListingMarketConfig(\n raw: UpdateMarketConfigResponseSchema & { max_leverage_bounds?: { minimum: number; maximum: number } | null },\n): ListingMarketConfig {\n return {\n maxLeverageBounds: raw.max_leverage_bounds ?? null,\n tokenContractAddress: raw.token_contract_address,\n depositChain: raw.deposit_chain as ListingDepositChainId,\n userMaxLeverage: raw.user_max_leverage ?? null,\n userBuybackRatio: raw.user_buyback_ratio ?? null,\n maxLeverage: raw.max_leverage,\n buybackRatio: raw.buyback_ratio,\n };\n}\n"],"mappings":";AAkBA,SAAgB,EACd,GACqB;CACrB,OAAO;EACL,mBAAmB,EAAI,uBAAuB;EAC9C,sBAAsB,EAAI;EAC1B,cAAc,EAAI;EAClB,iBAAiB,EAAI,qBAAqB;EAC1C,kBAAkB,EAAI,sBAAsB;EAC5C,aAAa,EAAI;EACjB,cAAc,EAAI;CACpB;AACF"}
@@ -39,6 +39,11 @@ export declare const LISTING_MARKET_CONFIG_BOUNDS: {
39
39
  * `ListingMarketDetail.buybackRatio` and `ListingMarketDetail.maxLeverage` use.
40
40
  */
41
41
  export interface ListingMarketConfig {
42
+ /** Server-published inclusive leverage limits, when available. */
43
+ maxLeverageBounds?: {
44
+ minimum: number;
45
+ maximum: number;
46
+ } | null;
42
47
  /**
43
48
  * The market's token contract address, echoed back by the service — an EVM
44
49
  * `0x…` address, or a Solana base58 address for a Solana-deposited listing.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pools/market-config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B;IACvC,mCAAmC;;;;;IAEnC,gCAAgC;;;;;CAExB,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,YAAY,EAAE,qBAAqB,CAAC;IACpC;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oCAAoC;IACnD;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,2FAA2F;IAC3F,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,2EAA2E;IAC3E,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,oDAAoD;AACpD,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pools/market-config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B;IACvC,mCAAmC;;;;;IAEnC,gCAAgC;;;;;CAExB,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChE;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,YAAY,EAAE,qBAAqB,CAAC;IACpC;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oCAAoC;IACnD;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,2FAA2F;IAC3F,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,2EAA2E;IAC3E,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,oDAAoD;AACpD,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/pools/market-config/types.ts"],"sourcesContent":["import type { ListingDepositChainId } from \"../types\";\n\n/**\n * Client-side bounds for the two {@link ListingMarketConfig} knobs.\n *\n * The listing service does **not** publish these: `getListingConfig`'s\n * `/v2/configs` payload carries deposit guidance, the listing fee, supported\n * deposit chains, rate limits, and the protocol reward share — but no leverage\n * or buyback range. Until it grows one, these are the values the listing team's\n * own UI enforces, and the service is the final authority: a value outside them\n * is rejected server-side with a `422`.\n *\n * Use them to bound a slider or a numeric input; do not treat them as a\n * substitute for handling the service's rejection.\n */\nexport const LISTING_MARKET_CONFIG_BOUNDS = {\n /** Whole multiplier, inclusive. */\n maxLeverage: { min: 1, max: 20 },\n /** Whole percent, inclusive. */\n buybackRatio: { min: 0, max: 100 },\n} as const;\n\n/**\n * One market's configuration as the listing service sees it for the signed-in\n * user — the caller's own opinion alongside the pool-level values in force.\n *\n * The pool does not take a single LP's word for its configuration. Every LP\n * submits an opinion through `updateListingMarketConfig`, and the service folds\n * them into a deposit-weighted average: `maxLeverage` and `buybackRatio` are\n * that blend, `userMaxLeverage` and `userBuybackRatio` are this caller's\n * contribution to it.\n *\n * Both ratios are plain numbers, **not** 18-decimal values: `buybackRatio: 50`\n * means 50%, `maxLeverage: 20` means 20x. This is the same convention\n * `ListingMarketDetail.buybackRatio` and `ListingMarketDetail.maxLeverage` use.\n */\nexport interface ListingMarketConfig {\n /**\n * The market's token contract address, echoed back by the service — an EVM\n * `0x…` address, or a Solana base58 address for a Solana-deposited listing.\n */\n tokenContractAddress: string;\n /** The market's deposit chain, echoed back by the service. */\n depositChain: ListingDepositChainId;\n /**\n * The caller's own max-leverage opinion, a whole multiplier. `null` until the\n * caller has ever submitted one for this market.\n */\n userMaxLeverage: number | null;\n /**\n * The caller's own buyback opinion, a whole percent. `null` until the caller\n * has ever submitted one for this market.\n */\n userBuybackRatio: number | null;\n /**\n * The pool-level max leverage in force — the deposit-weighted blend of every\n * LP's opinion. Matches `ListingMarketDetail.maxLeverage`.\n */\n maxLeverage: number;\n /**\n * The pool-level buyback percentage in force — the deposit-weighted blend of\n * every LP's opinion. Matches `ListingMarketDetail.buybackRatio`.\n */\n buybackRatio: number;\n}\n\n/**\n * Inputs for {@link projectListingMarketConfig}.\n *\n * The pool-side figures come from `getListingMarketDetail`, the caller's prior\n * opinion from `getListingMarketConfig`, and the caller's stake from whichever\n * token-denominated balance the consumer trusts — `getUserProfit`'s\n * `userBalanceInTokens` is the recommended source, since it is the live stake\n * and is denominated in the same tokens as `totalTokenInPool`.\n */\nexport interface ProjectListingMarketConfigParameters {\n /**\n * The pool-level buyback percentage in force, from\n * `ListingMarketDetail.buybackRatio`. `null` when unknown — the projection\n * for that knob is then `null` too.\n */\n poolBuybackRatio: number | null;\n /**\n * The pool-level max leverage in force, from `ListingMarketDetail.maxLeverage`.\n * `null` when unknown.\n */\n poolMaxLeverage: number | null;\n /**\n * The caller's prior buyback opinion, from\n * `ListingMarketConfig.userBuybackRatio`. `null` when the caller has never\n * configured this market — the pool value is then used as the baseline, which\n * makes the projection an approximation rather than a first-order exact shift.\n */\n priorBuybackRatio: number | null;\n /** The caller's prior max-leverage opinion, from `ListingMarketConfig.userMaxLeverage`. */\n priorMaxLeverage: number | null;\n /** The buyback percentage the caller is about to submit. Omit to skip that knob. */\n buybackRatio?: number;\n /** The max leverage the caller is about to submit. Omit to skip that knob. */\n maxLeverage?: number;\n /**\n * The caller's stake in the pool, token-denominated at\n * `LISTING_VALUE_DECIMALS` (18). `getUserProfit`'s `userBalanceInTokens` is\n * the recommended source.\n */\n userTokenAmount: bigint;\n /** The pool's total token balance, from `ListingMarketDetail.totalTokenInPool`. */\n totalTokenInPool: bigint;\n /** The pool's total value in USD, from `ListingMarketDetail.tvl`. */\n tvl: bigint | null;\n /** The pool's USDC balance, from `ListingMarketDetail.totalUsdcInPool`. */\n totalUsdcInPool: bigint;\n}\n\n/** Result of {@link projectListingMarketConfig}. */\nexport interface ListingMarketConfigProjection {\n /**\n * The caller's deposit-**value** share of the pool, clamped to `0..1` — the\n * weight the service gives their opinion.\n */\n share: number;\n /**\n * Where the pool's buyback percentage lands once the opinion is saved, or\n * `null` when `poolBuybackRatio` or the entered value is unknown.\n */\n projectedBuybackRatio: number | null;\n /**\n * Where the pool's max leverage lands once the opinion is saved, or `null`\n * when `poolMaxLeverage` or the entered value is unknown.\n */\n projectedMaxLeverage: number | null;\n}\n"],"mappings":";AAeA,IAAa,IAA+B;CAE1C,aAAa;EAAE,KAAK;EAAG,KAAK;CAAG;CAE/B,cAAc;EAAE,KAAK;EAAG,KAAK;CAAI;AACnC"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/pools/market-config/types.ts"],"sourcesContent":["import type { ListingDepositChainId } from \"../types\";\n\n/**\n * Client-side bounds for the two {@link ListingMarketConfig} knobs.\n *\n * The listing service does **not** publish these: `getListingConfig`'s\n * `/v2/configs` payload carries deposit guidance, the listing fee, supported\n * deposit chains, rate limits, and the protocol reward share — but no leverage\n * or buyback range. Until it grows one, these are the values the listing team's\n * own UI enforces, and the service is the final authority: a value outside them\n * is rejected server-side with a `422`.\n *\n * Use them to bound a slider or a numeric input; do not treat them as a\n * substitute for handling the service's rejection.\n */\nexport const LISTING_MARKET_CONFIG_BOUNDS = {\n /** Whole multiplier, inclusive. */\n maxLeverage: { min: 1, max: 20 },\n /** Whole percent, inclusive. */\n buybackRatio: { min: 0, max: 100 },\n} as const;\n\n/**\n * One market's configuration as the listing service sees it for the signed-in\n * user — the caller's own opinion alongside the pool-level values in force.\n *\n * The pool does not take a single LP's word for its configuration. Every LP\n * submits an opinion through `updateListingMarketConfig`, and the service folds\n * them into a deposit-weighted average: `maxLeverage` and `buybackRatio` are\n * that blend, `userMaxLeverage` and `userBuybackRatio` are this caller's\n * contribution to it.\n *\n * Both ratios are plain numbers, **not** 18-decimal values: `buybackRatio: 50`\n * means 50%, `maxLeverage: 20` means 20x. This is the same convention\n * `ListingMarketDetail.buybackRatio` and `ListingMarketDetail.maxLeverage` use.\n */\nexport interface ListingMarketConfig {\n /** Server-published inclusive leverage limits, when available. */\n maxLeverageBounds?: { minimum: number; maximum: number } | null;\n /**\n * The market's token contract address, echoed back by the service — an EVM\n * `0x…` address, or a Solana base58 address for a Solana-deposited listing.\n */\n tokenContractAddress: string;\n /** The market's deposit chain, echoed back by the service. */\n depositChain: ListingDepositChainId;\n /**\n * The caller's own max-leverage opinion, a whole multiplier. `null` until the\n * caller has ever submitted one for this market.\n */\n userMaxLeverage: number | null;\n /**\n * The caller's own buyback opinion, a whole percent. `null` until the caller\n * has ever submitted one for this market.\n */\n userBuybackRatio: number | null;\n /**\n * The pool-level max leverage in force — the deposit-weighted blend of every\n * LP's opinion. Matches `ListingMarketDetail.maxLeverage`.\n */\n maxLeverage: number;\n /**\n * The pool-level buyback percentage in force — the deposit-weighted blend of\n * every LP's opinion. Matches `ListingMarketDetail.buybackRatio`.\n */\n buybackRatio: number;\n}\n\n/**\n * Inputs for {@link projectListingMarketConfig}.\n *\n * The pool-side figures come from `getListingMarketDetail`, the caller's prior\n * opinion from `getListingMarketConfig`, and the caller's stake from whichever\n * token-denominated balance the consumer trusts — `getUserProfit`'s\n * `userBalanceInTokens` is the recommended source, since it is the live stake\n * and is denominated in the same tokens as `totalTokenInPool`.\n */\nexport interface ProjectListingMarketConfigParameters {\n /**\n * The pool-level buyback percentage in force, from\n * `ListingMarketDetail.buybackRatio`. `null` when unknown — the projection\n * for that knob is then `null` too.\n */\n poolBuybackRatio: number | null;\n /**\n * The pool-level max leverage in force, from `ListingMarketDetail.maxLeverage`.\n * `null` when unknown.\n */\n poolMaxLeverage: number | null;\n /**\n * The caller's prior buyback opinion, from\n * `ListingMarketConfig.userBuybackRatio`. `null` when the caller has never\n * configured this market — the pool value is then used as the baseline, which\n * makes the projection an approximation rather than a first-order exact shift.\n */\n priorBuybackRatio: number | null;\n /** The caller's prior max-leverage opinion, from `ListingMarketConfig.userMaxLeverage`. */\n priorMaxLeverage: number | null;\n /** The buyback percentage the caller is about to submit. Omit to skip that knob. */\n buybackRatio?: number;\n /** The max leverage the caller is about to submit. Omit to skip that knob. */\n maxLeverage?: number;\n /**\n * The caller's stake in the pool, token-denominated at\n * `LISTING_VALUE_DECIMALS` (18). `getUserProfit`'s `userBalanceInTokens` is\n * the recommended source.\n */\n userTokenAmount: bigint;\n /** The pool's total token balance, from `ListingMarketDetail.totalTokenInPool`. */\n totalTokenInPool: bigint;\n /** The pool's total value in USD, from `ListingMarketDetail.tvl`. */\n tvl: bigint | null;\n /** The pool's USDC balance, from `ListingMarketDetail.totalUsdcInPool`. */\n totalUsdcInPool: bigint;\n}\n\n/** Result of {@link projectListingMarketConfig}. */\nexport interface ListingMarketConfigProjection {\n /**\n * The caller's deposit-**value** share of the pool, clamped to `0..1` — the\n * weight the service gives their opinion.\n */\n share: number;\n /**\n * Where the pool's buyback percentage lands once the opinion is saved, or\n * `null` when `poolBuybackRatio` or the entered value is unknown.\n */\n projectedBuybackRatio: number | null;\n /**\n * Where the pool's max leverage lands once the opinion is saved, or `null`\n * when `poolMaxLeverage` or the entered value is unknown.\n */\n projectedMaxLeverage: number | null;\n}\n"],"mappings":";AAeA,IAAa,IAA+B;CAE1C,aAAa;EAAE,KAAK;EAAG,KAAK;CAAG;CAE/B,cAAc;EAAE,KAAK;EAAG,KAAK;CAAI;AACnC"}
@@ -0,0 +1,14 @@
1
+ import { Config } from '../../core/config/index.js';
2
+ import { ChainIdParameter } from '../../shared/types/properties.js';
3
+ /** Inventory-backed legacy pool metric pair, at 18 decimals. */
4
+ export interface PoolMarketData {
5
+ marketCap: bigint | null;
6
+ apr: bigint | null;
7
+ }
8
+ /** Deployment and exact token addresses for the legacy batch metrics read. */
9
+ export type GetPoolMarketDataParameters = ChainIdParameter & {
10
+ addresses: readonly string[];
11
+ };
12
+ /** Read the legacy pool metrics in one request, preserving address keys and unknown values. */
13
+ export declare function getPoolMarketData(config: Config, parameters: GetPoolMarketDataParameters): Promise<Record<string, PoolMarketData>>;
14
+ //# sourceMappingURL=get-pool-market-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pool-market-data.d.ts","sourceRoot":"","sources":["../../../src/pools/market-data/get-pool-market-data.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE,gEAAgE;AAChE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AACD,8EAA8E;AAC9E,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GAAG;IAAE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE9F,+FAA+F;AAC/F,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,2BAA2B,GACtC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAczC"}
@@ -0,0 +1,25 @@
1
+ import { SymmApiError as e } from "../../shared/errors/symm-error.js";
2
+ import { resolveListingService as t } from "../resolve-listing.js";
3
+ import { getPoolsV2PoolsGet as n } from "../types/generated/listing-backend.js";
4
+ import { toListingPercent as r, toListingValue as i } from "../markets/to-listing-market.js";
5
+ import { isAxiosError as a } from "axios";
6
+ //#region src/pools/market-data/get-pool-market-data.ts
7
+ async function o(o, s) {
8
+ let { url: c } = t(o, s);
9
+ try {
10
+ let { data: e } = await n({ addresses: s.addresses.join(",") }, { baseURL: c });
11
+ return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, {
12
+ marketCap: i(t.market_cap),
13
+ apr: r(t.apr)
14
+ }]));
15
+ } catch (t) {
16
+ throw a(t) ? e.fromAxios(t, {
17
+ code: "GET_POOL_MARKET_DATA_FAILED",
18
+ baseURL: c
19
+ }) : t;
20
+ }
21
+ }
22
+ //#endregion
23
+ export { o as getPoolMarketData };
24
+
25
+ //# sourceMappingURL=get-pool-market-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pool-market-data.js","names":[],"sources":["../../../src/pools/market-data/get-pool-market-data.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter } from \"../../shared/types/properties\";\nimport { toListingPercent, toListingValue } from \"../markets/to-listing-market\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport { getPoolsV2PoolsGet } from \"../types/generated/listing-backend\";\n\n/** Inventory-backed legacy pool metric pair, at 18 decimals. */\nexport interface PoolMarketData {\n marketCap: bigint | null;\n apr: bigint | null;\n}\n/** Deployment and exact token addresses for the legacy batch metrics read. */\nexport type GetPoolMarketDataParameters = ChainIdParameter & { addresses: readonly string[] };\n\n/** Read the legacy pool metrics in one request, preserving address keys and unknown values. */\nexport async function getPoolMarketData(\n config: Config,\n parameters: GetPoolMarketDataParameters,\n): Promise<Record<string, PoolMarketData>> {\n const { url: baseURL } = resolveListingService(config, parameters);\n try {\n const { data } = await getPoolsV2PoolsGet({ addresses: parameters.addresses.join(\",\") }, { baseURL });\n return Object.fromEntries(\n Object.entries(data).map(([address, value]) => [\n address,\n { marketCap: toListingValue(value.market_cap), apr: toListingPercent(value.apr) },\n ]),\n );\n } catch (error) {\n if (isAxiosError(error)) throw SymmApiError.fromAxios(error, { code: \"GET_POOL_MARKET_DATA_FAILED\", baseURL });\n throw error;\n }\n}\n"],"mappings":";;;;;;AAiBA,eAAsB,EACpB,GACA,GACyC;CACzC,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,CAAU;CACjE,IAAI;EACF,IAAM,EAAE,YAAS,MAAM,EAAmB,EAAE,WAAW,EAAW,UAAU,KAAK,GAAG,EAAE,GAAG,EAAE,WAAQ,CAAC;EACpG,OAAO,OAAO,YACZ,OAAO,QAAQ,CAAI,EAAE,KAAK,CAAC,GAAS,OAAW,CAC7C,GACA;GAAE,WAAW,EAAe,EAAM,UAAU;GAAG,KAAK,EAAiB,EAAM,GAAG;EAAE,CAClF,CAAC,CACH;CACF,SAAS,GAAO;EAEd,MADI,EAAa,CAAK,IAAS,EAAa,UAAU,GAAO;GAAE,MAAM;GAA+B;EAAQ,CAAC,IACvG;CACR;AACF"}
@@ -0,0 +1,2 @@
1
+ export * from './get-pool-market-data.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pools/market-data/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -7,5 +7,9 @@ import { GetMarketResponseSchema } from '../types/generated/listing-backend.js';
7
7
  * @param raw - The raw market-detail response body.
8
8
  * @returns The normalized pool detail.
9
9
  */
10
- export declare function toListingMarketDetail(raw: GetMarketResponseSchema): ListingMarketDetail;
10
+ export declare function toListingMarketDetail(raw: GetMarketResponseSchema & {
11
+ apy_all_time?: string | null;
12
+ lifetime_reward?: string | null;
13
+ buy_back_ratio?: number;
14
+ }): ListingMarketDetail;
11
15
  //# sourceMappingURL=to-listing-market-detail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-listing-market-detail.d.ts","sourceRoot":"","sources":["../../../src/pools/market-detail/to-listing-market-detail.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,mBAAmB,EAGzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AA+DlF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,uBAAuB,GAAG,mBAAmB,CAwCvF"}
1
+ {"version":3,"file":"to-listing-market-detail.d.ts","sourceRoot":"","sources":["../../../src/pools/market-detail/to-listing-market-detail.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,mBAAmB,EAGzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAgElF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,uBAAuB,GAAG;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACA,mBAAmB,CAiDrB"}
@@ -1,36 +1,45 @@
1
1
  import { MarketLockReason as e, PoolPositionSide as t } from "../types.js";
2
- import { toListingValue as n } from "../markets/to-listing-market.js";
2
+ import { toListingPercent as n, toListingValue as r } from "../markets/to-listing-market.js";
3
3
  //#region src/pools/market-detail/to-listing-market-detail.ts
4
- function r(e) {
5
- return n(e) ?? 0n;
4
+ function i(e) {
5
+ return r(e) ?? 0n;
6
6
  }
7
- var i = new Set(Object.values(e));
8
- function a(t) {
9
- return i.has(t) ? t : e.UNKNOWN;
7
+ var a = new Set(Object.values(e));
8
+ function o(t) {
9
+ return a.has(t) ? t : e.UNKNOWN;
10
10
  }
11
- function o(e, t) {
12
- let r = e;
11
+ function s(e, t) {
12
+ let i = e, a = t.includes("apy") ? n : r;
13
13
  return {
14
- h1: n(r[`${t}_1h`]),
15
- h6: n(r[`${t}_6h`]),
16
- h24: n(r[`${t}_24h`]),
17
- d30: n(r[`${t}_30d`]),
18
- lifetime: n(r[`${t}_lifetime`])
14
+ h1: a(i[`${t}_1h`]),
15
+ h6: a(i[`${t}_6h`]),
16
+ h24: a(i[`${t}_24h`]),
17
+ d30: a(i[`${t}_30d`]),
18
+ lifetime: a(i[`${t}_lifetime`])
19
19
  };
20
20
  }
21
- function s(e, t, i, a, o) {
22
- let s = n(t);
21
+ function c(e, t, n, a, o) {
22
+ let s = r(t);
23
23
  return s === null ? null : {
24
24
  side: e,
25
25
  size: s,
26
- value: r(i),
27
- avgOpenPrice: r(a),
28
- upnl: r(o)
26
+ value: i(n),
27
+ avgOpenPrice: i(a),
28
+ upnl: i(o)
29
29
  };
30
30
  }
31
- function c(e) {
31
+ function l(e) {
32
32
  return {
33
33
  tokenContractAddress: e.token_contract_address,
34
+ reportedTotalTokenInPool: r(e.total_token_in_pool),
35
+ reportedTotalUsdcInPool: r(e.total_usdc_in_pool),
36
+ reportedMaintenanceFees: r(e.maintenance_fees),
37
+ legacyLifetimeReward: e.lifetime_reward ?? null,
38
+ isTax: e.is_tax ?? null,
39
+ userWhitelistTax: e.user_whitelist_tax ?? null,
40
+ additionalChains: e.additional_chains ?? null,
41
+ mainPool: e.main_pool ?? null,
42
+ cexList: e.cex_list ?? null,
34
43
  depositChain: e.deposit_chain,
35
44
  tokenName: e.token_name,
36
45
  tokenTicker: e.token_ticker ?? null,
@@ -38,26 +47,29 @@ function c(e) {
38
47
  symbolId: e.symbol_id ?? null,
39
48
  marketStatus: e.market_status,
40
49
  isLocked: e.is_locked ?? !1,
41
- lockReasons: (e.lock_reasons ?? []).map(a),
50
+ lockReasons: (e.lock_reasons ?? []).map(o),
42
51
  maxLeverage: e.max_leverage,
43
- buybackRatio: e.buyback_ratio,
52
+ buybackRatio: e.buyback_ratio ?? e.buy_back_ratio,
44
53
  listingTime: e.listing_time ?? null,
45
54
  age: e.age ?? null,
46
55
  activeLps: e.active_lps,
47
- tvl: n(e.tvl),
48
- totalUsdcInPool: r(e.total_usdc_in_pool),
49
- totalTokenInPool: r(e.total_token_in_pool),
50
- maintenanceFees: r(e.maintenance_fees),
51
- rewards: o(e, "reward"),
52
- solverRevenue: o(e, "solver_revenue"),
53
- apy: o(e, "apy"),
54
- tvlDrivenApy: o(e, "tvl_driven_apy"),
55
- priceDrivenApy: o(e, "price_driven_apy"),
56
- longPosition: s(t.LONG, e.long_position_amount, e.long_position_value, e.long_position_avg_open_price, e.long_position_upnl),
57
- shortPosition: s(t.SHORT, e.short_position_amount, e.short_position_value, e.short_position_avg_open_price, e.short_position_upnl)
56
+ tvl: r(e.tvl),
57
+ totalUsdcInPool: i(e.total_usdc_in_pool),
58
+ totalTokenInPool: i(e.total_token_in_pool),
59
+ maintenanceFees: i(e.maintenance_fees),
60
+ rewards: s(e, "reward"),
61
+ solverRevenue: s(e, "solver_revenue"),
62
+ apy: {
63
+ ...s(e, "apy"),
64
+ lifetime: n(e.apy_lifetime ?? e.apy_all_time)
65
+ },
66
+ tvlDrivenApy: s(e, "tvl_driven_apy"),
67
+ priceDrivenApy: s(e, "price_driven_apy"),
68
+ longPosition: c(t.LONG, e.long_position_amount, e.long_position_value, e.long_position_avg_open_price, e.long_position_upnl),
69
+ shortPosition: c(t.SHORT, e.short_position_amount, e.short_position_value, e.short_position_avg_open_price, e.short_position_upnl)
58
70
  };
59
71
  }
60
72
  //#endregion
61
- export { c as toListingMarketDetail };
73
+ export { l as toListingMarketDetail };
62
74
 
63
75
  //# sourceMappingURL=to-listing-market-detail.js.map