@symmio/trading-core 4.1.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 (239) hide show
  1. package/dist/index.d.ts +17 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +108 -87
  4. package/dist/pools/add-market/to-created-pool.d.ts.map +1 -1
  5. package/dist/pools/add-market/to-created-pool.js +4 -0
  6. package/dist/pools/add-market/to-created-pool.js.map +1 -1
  7. package/dist/pools/add-market/types.d.ts +8 -0
  8. package/dist/pools/add-market/types.d.ts.map +1 -1
  9. package/dist/pools/auth/authenticate-listing.d.ts +3 -1
  10. package/dist/pools/auth/authenticate-listing.d.ts.map +1 -1
  11. package/dist/pools/auth/authenticate-listing.js +28 -23
  12. package/dist/pools/auth/authenticate-listing.js.map +1 -1
  13. package/dist/pools/auth/can-reuse-listing-challenge.d.ts +5 -0
  14. package/dist/pools/auth/can-reuse-listing-challenge.d.ts.map +1 -0
  15. package/dist/pools/auth/can-reuse-listing-challenge.js +9 -0
  16. package/dist/pools/auth/can-reuse-listing-challenge.js.map +1 -0
  17. package/dist/pools/auth/query.d.ts +15 -0
  18. package/dist/pools/auth/query.d.ts.map +1 -1
  19. package/dist/pools/auth/query.js +28 -4
  20. package/dist/pools/auth/query.js.map +1 -1
  21. package/dist/pools/auth/to-siwe.d.ts +5 -1
  22. package/dist/pools/auth/to-siwe.d.ts.map +1 -1
  23. package/dist/pools/auth/to-siwe.js +4 -2
  24. package/dist/pools/auth/to-siwe.js.map +1 -1
  25. package/dist/pools/auth/types.d.ts +2 -0
  26. package/dist/pools/auth/types.d.ts.map +1 -1
  27. package/dist/pools/cancel-withdraw/cancel-withdraw.js +1 -1
  28. package/dist/pools/cancel-withdraw/cancel-withdraw.js.map +1 -1
  29. package/dist/pools/claim-history/get-pool-claim.d.ts +11 -0
  30. package/dist/pools/claim-history/get-pool-claim.d.ts.map +1 -0
  31. package/dist/pools/claim-history/get-pool-claim.js +25 -0
  32. package/dist/pools/claim-history/get-pool-claim.js.map +1 -0
  33. package/dist/pools/claim-history/index.d.ts +1 -0
  34. package/dist/pools/claim-history/index.d.ts.map +1 -1
  35. package/dist/pools/claim-history/to-pool-claim.d.ts.map +1 -1
  36. package/dist/pools/claim-history/to-pool-claim.js +2 -0
  37. package/dist/pools/claim-history/to-pool-claim.js.map +1 -1
  38. package/dist/pools/composition.d.ts +16 -0
  39. package/dist/pools/composition.d.ts.map +1 -0
  40. package/dist/pools/composition.js +39 -0
  41. package/dist/pools/composition.js.map +1 -0
  42. package/dist/pools/empty-pool-profit.d.ts +4 -0
  43. package/dist/pools/empty-pool-profit.d.ts.map +1 -0
  44. package/dist/pools/empty-pool-profit.js +17 -0
  45. package/dist/pools/empty-pool-profit.js.map +1 -0
  46. package/dist/pools/index.d.ts +8 -0
  47. package/dist/pools/index.d.ts.map +1 -1
  48. package/dist/pools/listing-config/to-listing-config.d.ts +5 -1
  49. package/dist/pools/listing-config/to-listing-config.d.ts.map +1 -1
  50. package/dist/pools/listing-config/to-listing-config.js +19 -8
  51. package/dist/pools/listing-config/to-listing-config.js.map +1 -1
  52. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts +37 -0
  53. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts.map +1 -0
  54. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js +35 -0
  55. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js.map +1 -0
  56. package/dist/pools/maintenance-fees/index.d.ts +3 -0
  57. package/dist/pools/maintenance-fees/index.d.ts.map +1 -0
  58. package/dist/pools/maintenance-fees/query.d.ts +11 -0
  59. package/dist/pools/maintenance-fees/query.d.ts.map +1 -0
  60. package/dist/pools/maintenance-fees/query.js +21 -0
  61. package/dist/pools/maintenance-fees/query.js.map +1 -0
  62. package/dist/pools/market-config/to-listing-market-config.d.ts +6 -1
  63. package/dist/pools/market-config/to-listing-market-config.d.ts.map +1 -1
  64. package/dist/pools/market-config/to-listing-market-config.js +1 -0
  65. package/dist/pools/market-config/to-listing-market-config.js.map +1 -1
  66. package/dist/pools/market-config/types.d.ts +5 -0
  67. package/dist/pools/market-config/types.d.ts.map +1 -1
  68. package/dist/pools/market-config/types.js.map +1 -1
  69. package/dist/pools/market-data/get-pool-market-data.d.ts +14 -0
  70. package/dist/pools/market-data/get-pool-market-data.d.ts.map +1 -0
  71. package/dist/pools/market-data/get-pool-market-data.js +25 -0
  72. package/dist/pools/market-data/get-pool-market-data.js.map +1 -0
  73. package/dist/pools/market-data/index.d.ts +2 -0
  74. package/dist/pools/market-data/index.d.ts.map +1 -0
  75. package/dist/pools/market-detail/to-listing-market-detail.d.ts +5 -1
  76. package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
  77. package/dist/pools/market-detail/to-listing-market-detail.js +45 -33
  78. package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
  79. package/dist/pools/markets/to-listing-market.d.ts +13 -1
  80. package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
  81. package/dist/pools/markets/to-listing-market.js +24 -12
  82. package/dist/pools/markets/to-listing-market.js.map +1 -1
  83. package/dist/pools/open-positions/calculate-pool-open-positions.d.ts +39 -0
  84. package/dist/pools/open-positions/calculate-pool-open-positions.d.ts.map +1 -0
  85. package/dist/pools/open-positions/calculate-pool-open-positions.js +83 -0
  86. package/dist/pools/open-positions/calculate-pool-open-positions.js.map +1 -0
  87. package/dist/pools/open-positions/get-pool-open-positions.d.ts +17 -0
  88. package/dist/pools/open-positions/get-pool-open-positions.d.ts.map +1 -0
  89. package/dist/pools/open-positions/get-pool-open-positions.js +39 -0
  90. package/dist/pools/open-positions/get-pool-open-positions.js.map +1 -0
  91. package/dist/pools/open-positions/index.d.ts +4 -0
  92. package/dist/pools/open-positions/index.d.ts.map +1 -0
  93. package/dist/pools/open-positions/query.d.ts +17 -0
  94. package/dist/pools/open-positions/query.d.ts.map +1 -0
  95. package/dist/pools/open-positions/query.js +21 -0
  96. package/dist/pools/open-positions/query.js.map +1 -0
  97. package/dist/pools/portfolio/calculate-pool-portfolio.d.ts +66 -0
  98. package/dist/pools/portfolio/calculate-pool-portfolio.d.ts.map +1 -0
  99. package/dist/pools/portfolio/calculate-pool-portfolio.js +96 -0
  100. package/dist/pools/portfolio/calculate-pool-portfolio.js.map +1 -0
  101. package/dist/pools/portfolio/get-pool-portfolio.d.ts +19 -0
  102. package/dist/pools/portfolio/get-pool-portfolio.d.ts.map +1 -0
  103. package/dist/pools/portfolio/get-pool-portfolio.js +88 -0
  104. package/dist/pools/portfolio/get-pool-portfolio.js.map +1 -0
  105. package/dist/pools/portfolio/index.d.ts +4 -0
  106. package/dist/pools/portfolio/index.d.ts.map +1 -0
  107. package/dist/pools/portfolio/query.d.ts +17 -0
  108. package/dist/pools/portfolio/query.d.ts.map +1 -0
  109. package/dist/pools/portfolio/query.js +21 -0
  110. package/dist/pools/portfolio/query.js.map +1 -0
  111. package/dist/pools/portfolio/read-positions.d.ts +4 -0
  112. package/dist/pools/portfolio/read-positions.d.ts.map +1 -0
  113. package/dist/pools/portfolio/read-positions.js +31 -0
  114. package/dist/pools/portfolio/read-positions.js.map +1 -0
  115. package/dist/pools/position/calculate-pool-position.d.ts +85 -0
  116. package/dist/pools/position/calculate-pool-position.d.ts.map +1 -0
  117. package/dist/pools/position/calculate-pool-position.js +59 -0
  118. package/dist/pools/position/calculate-pool-position.js.map +1 -0
  119. package/dist/pools/position/get-pool-position.d.ts +22 -0
  120. package/dist/pools/position/get-pool-position.d.ts.map +1 -0
  121. package/dist/pools/position/get-pool-position.js +47 -0
  122. package/dist/pools/position/get-pool-position.js.map +1 -0
  123. package/dist/pools/position/index.d.ts +4 -0
  124. package/dist/pools/position/index.d.ts.map +1 -0
  125. package/dist/pools/position/query.d.ts +17 -0
  126. package/dist/pools/position/query.d.ts.map +1 -0
  127. package/dist/pools/position/query.js +21 -0
  128. package/dist/pools/position/query.js.map +1 -0
  129. package/dist/pools/position/sum-deposits.d.ts +10 -0
  130. package/dist/pools/position/sum-deposits.d.ts.map +1 -0
  131. package/dist/pools/position/sum-deposits.js +35 -0
  132. package/dist/pools/position/sum-deposits.js.map +1 -0
  133. package/dist/pools/profit/get-user-profit.d.ts +4 -0
  134. package/dist/pools/profit/get-user-profit.d.ts.map +1 -1
  135. package/dist/pools/profit/get-user-profit.js +18 -12
  136. package/dist/pools/profit/get-user-profit.js.map +1 -1
  137. package/dist/pools/profit/to-user-pool-profit.d.ts +22 -4
  138. package/dist/pools/profit/to-user-pool-profit.d.ts.map +1 -1
  139. package/dist/pools/profit/to-user-pool-profit.js +28 -12
  140. package/dist/pools/profit/to-user-pool-profit.js.map +1 -1
  141. package/dist/pools/quotes/get-pool-quotes.d.ts +8 -1
  142. package/dist/pools/quotes/get-pool-quotes.d.ts.map +1 -1
  143. package/dist/pools/quotes/get-pool-quotes.js +8 -1
  144. package/dist/pools/quotes/get-pool-quotes.js.map +1 -1
  145. package/dist/pools/quotes/query-document.d.ts.map +1 -1
  146. package/dist/pools/quotes/query-document.js +1 -1
  147. package/dist/pools/quotes/query-document.js.map +1 -1
  148. package/dist/pools/quotes/to-pool-quote.d.ts.map +1 -1
  149. package/dist/pools/quotes/to-pool-quote.js +13 -0
  150. package/dist/pools/quotes/to-pool-quote.js.map +1 -1
  151. package/dist/pools/rewards/query.js +25 -25
  152. package/dist/pools/statistics/calculate-pool-statistics.d.ts +69 -0
  153. package/dist/pools/statistics/calculate-pool-statistics.d.ts.map +1 -0
  154. package/dist/pools/statistics/calculate-pool-statistics.js +42 -0
  155. package/dist/pools/statistics/calculate-pool-statistics.js.map +1 -0
  156. package/dist/pools/statistics/get-pool-statistics.d.ts +29 -0
  157. package/dist/pools/statistics/get-pool-statistics.d.ts.map +1 -0
  158. package/dist/pools/statistics/get-pool-statistics.js +61 -0
  159. package/dist/pools/statistics/get-pool-statistics.js.map +1 -0
  160. package/dist/pools/statistics/index.d.ts +4 -0
  161. package/dist/pools/statistics/index.d.ts.map +1 -0
  162. package/dist/pools/statistics/query.d.ts +17 -0
  163. package/dist/pools/statistics/query.d.ts.map +1 -0
  164. package/dist/pools/statistics/query.js +21 -0
  165. package/dist/pools/statistics/query.js.map +1 -0
  166. package/dist/pools/token-metadata/get-listing-token-metadata.d.ts +32 -0
  167. package/dist/pools/token-metadata/get-listing-token-metadata.d.ts.map +1 -0
  168. package/dist/pools/token-metadata/get-listing-token-metadata.js +43 -0
  169. package/dist/pools/token-metadata/get-listing-token-metadata.js.map +1 -0
  170. package/dist/pools/token-metadata/index.d.ts +3 -0
  171. package/dist/pools/token-metadata/index.d.ts.map +1 -0
  172. package/dist/pools/token-metadata/query.d.ts +11 -0
  173. package/dist/pools/token-metadata/query.d.ts.map +1 -0
  174. package/dist/pools/token-metadata/query.js +21 -0
  175. package/dist/pools/token-metadata/query.js.map +1 -0
  176. package/dist/pools/token-support/check-listing-token-support.d.ts +23 -0
  177. package/dist/pools/token-support/check-listing-token-support.d.ts.map +1 -0
  178. package/dist/pools/token-support/check-listing-token-support.js +36 -0
  179. package/dist/pools/token-support/check-listing-token-support.js.map +1 -0
  180. package/dist/pools/token-support/index.d.ts +3 -0
  181. package/dist/pools/token-support/index.d.ts.map +1 -0
  182. package/dist/pools/token-support/query.d.ts +11 -0
  183. package/dist/pools/token-support/query.d.ts.map +1 -0
  184. package/dist/pools/token-support/query.js +21 -0
  185. package/dist/pools/token-support/query.js.map +1 -0
  186. package/dist/pools/trade-history/calculate-history-metrics.d.ts +12 -0
  187. package/dist/pools/trade-history/calculate-history-metrics.d.ts.map +1 -0
  188. package/dist/pools/trade-history/calculate-history-metrics.js +36 -0
  189. package/dist/pools/trade-history/calculate-history-metrics.js.map +1 -0
  190. package/dist/pools/trade-history/get-pool-trade-history.d.ts +21 -1
  191. package/dist/pools/trade-history/get-pool-trade-history.d.ts.map +1 -1
  192. package/dist/pools/trade-history/get-pool-trade-history.js +57 -18
  193. package/dist/pools/trade-history/get-pool-trade-history.js.map +1 -1
  194. package/dist/pools/trade-history/query-document.d.ts.map +1 -1
  195. package/dist/pools/trade-history/query-document.js +1 -1
  196. package/dist/pools/trade-history/query-document.js.map +1 -1
  197. package/dist/pools/transactions/get-pool-transaction-range.d.ts +6 -0
  198. package/dist/pools/transactions/get-pool-transaction-range.d.ts.map +1 -0
  199. package/dist/pools/transactions/get-pool-transaction-range.js +26 -0
  200. package/dist/pools/transactions/get-pool-transaction-range.js.map +1 -0
  201. package/dist/pools/transactions/index.d.ts +1 -0
  202. package/dist/pools/transactions/index.d.ts.map +1 -1
  203. package/dist/pools/types/generated/listing-backend.js +34 -10
  204. package/dist/pools/types/generated/listing-backend.js.map +1 -1
  205. package/dist/pools/types.d.ts +129 -6
  206. package/dist/pools/types.d.ts.map +1 -1
  207. package/dist/pools/types.js.map +1 -1
  208. package/dist/pools/user-markets/get-user-listing-markets.d.ts +2 -0
  209. package/dist/pools/user-markets/get-user-listing-markets.d.ts.map +1 -1
  210. package/dist/pools/user-markets/get-user-listing-markets.js.map +1 -1
  211. package/dist/pools/user-markets/to-user-listing-market.js +1 -1
  212. package/dist/pools/user-markets/to-user-listing-market.js.map +1 -1
  213. package/dist/pools/user-transactions/get-user-transactions.d.ts +2 -0
  214. package/dist/pools/user-transactions/get-user-transactions.d.ts.map +1 -1
  215. package/dist/pools/user-transactions/get-user-transactions.js.map +1 -1
  216. package/dist/pools/user-transactions/to-user-transaction.d.ts +5 -1
  217. package/dist/pools/user-transactions/to-user-transaction.d.ts.map +1 -1
  218. package/dist/pools/user-transactions/to-user-transaction.js +3 -0
  219. package/dist/pools/user-transactions/to-user-transaction.js.map +1 -1
  220. package/dist/quotes/liquidation/calculate-liquidation-price.d.ts +5 -1
  221. package/dist/quotes/liquidation/calculate-liquidation-price.d.ts.map +1 -1
  222. package/dist/quotes/liquidation/calculate-liquidation-price.js +1 -1
  223. package/dist/quotes/liquidation/calculate-liquidation-price.js.map +1 -1
  224. package/dist/quotes/upnl/calculate-quote-pnl.d.ts.map +1 -1
  225. package/dist/quotes/upnl/calculate-quote-pnl.js +8 -8
  226. package/dist/quotes/upnl/calculate-quote-pnl.js.map +1 -1
  227. package/dist/quotes/upnl/calculate-quote-upnl.d.ts +2 -2
  228. package/dist/quotes/upnl/calculate-quote-upnl.d.ts.map +1 -1
  229. package/dist/quotes/upnl/calculate-quote-upnl.js +16 -15
  230. package/dist/quotes/upnl/calculate-quote-upnl.js.map +1 -1
  231. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +2 -2
  232. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts.map +1 -1
  233. package/dist/symmio-subgraph/types/generated/analytics/gql.js +2 -2
  234. package/dist/symmio-subgraph/types/generated/analytics/gql.js.map +1 -1
  235. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts +21 -0
  236. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts.map +1 -1
  237. package/dist/symmio-subgraph/types/generated/analytics/graphql.js +1 -1
  238. package/dist/symmio-subgraph/types/generated/analytics/graphql.js.map +1 -1
  239. package/package.json +1 -1
@@ -14,7 +14,11 @@ import { SearchUserTransactionsResult, UserTransactionItem } from '../types/gene
14
14
  * @param raw - One row of the user-transactions response.
15
15
  * @returns The normalized transaction.
16
16
  */
17
- export declare function toUserTransaction(raw: UserTransactionItem): UserTransaction;
17
+ export declare function toUserTransaction(raw: UserTransactionItem & {
18
+ token_amount?: string | null;
19
+ usdc_amount?: string | null;
20
+ refund_transaction_hash?: string | null;
21
+ }): UserTransaction;
18
22
  /**
19
23
  * Map the user-transactions envelope into a {@link UserTransactionPage}.
20
24
  *
@@ -1 +1 @@
1
- {"version":3,"file":"to-user-transaction.d.ts","sourceRoot":"","sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE5G;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,GAAG,eAAe,CAgB3E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,4BAA4B,GAAG,mBAAmB,CAK5F"}
1
+ {"version":3,"file":"to-user-transaction.d.ts","sourceRoot":"","sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE5G;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,mBAAmB,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC,GACA,eAAe,CAmBjB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,4BAA4B,GAAG,mBAAmB,CAK5F"}
@@ -2,6 +2,9 @@ import { toListingValue as e } from "../markets/to-listing-market.js";
2
2
  //#region src/pools/user-transactions/to-user-transaction.ts
3
3
  function t(t) {
4
4
  return {
5
+ tokenAmount: e(t.token_amount),
6
+ usdcAmount: e(t.usdc_amount),
7
+ refundTransactionHash: t.refund_transaction_hash ?? null,
5
8
  transactionId: t.transaction_id,
6
9
  type: t.transaction_type,
7
10
  status: t.transaction_status,
@@ -1 +1 @@
1
- {"version":3,"file":"to-user-transaction.js","names":[],"sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"sourcesContent":["import { toListingValue } from \"../markets/to-listing-market\";\nimport {\n type ListingDepositChainId,\n type PoolTransactionStatus,\n type PoolTransactionType,\n type UserTransaction,\n type UserTransactionPage,\n} from \"../types\";\nimport type { SearchUserTransactionsResult, UserTransactionItem } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw user-transaction row into the SDK's {@link UserTransaction}.\n *\n * `amount` is a 1e18-scaled integer string like the rest of the listing money\n * fields, parsed to a `bigint` at `LISTING_VALUE_DECIMALS` with\n * {@link toListingValue} (absent → `0n`); `tokenDecimals` is carried as metadata,\n * not as the amount's scale. The generated `transaction_type` /\n * `transaction_status` / `chain_id` enums share their string/number values with\n * the SDK's {@link PoolTransactionType} / {@link PoolTransactionStatus} /\n * {@link ListingDepositChainId}, so the casts are value-preserving.\n *\n * @param raw - One row of the user-transactions response.\n * @returns The normalized transaction.\n */\nexport function toUserTransaction(raw: UserTransactionItem): UserTransaction {\n return {\n transactionId: raw.transaction_id,\n type: raw.transaction_type as unknown as PoolTransactionType,\n status: raw.transaction_status as unknown as PoolTransactionStatus,\n amount: toListingValue(raw.amount) ?? 0n,\n tokenDecimals: raw.token_decimal,\n tokenAddress: raw.token_address,\n tokenName: raw.token_name,\n tokenTicker: raw.token_ticker,\n chainId: raw.chain_id as unknown as ListingDepositChainId,\n wallet: raw.wallet ?? null,\n refundAddress: raw.refund_address ?? null,\n transactionHash: raw.transaction_hash ?? null,\n time: raw.create_time ?? null,\n };\n}\n\n/**\n * Map the user-transactions envelope into a {@link UserTransactionPage}.\n *\n * @param raw - The response body.\n * @returns The normalized page. `count` is the total across all pages.\n */\nexport function toUserTransactionPage(raw: SearchUserTransactionsResult): UserTransactionPage {\n return {\n count: raw.count,\n items: (raw.items ?? []).map(toUserTransaction),\n };\n}\n"],"mappings":";;AAwBA,SAAgB,EAAkB,GAA2C;CAC3E,OAAO;EACL,eAAe,EAAI;EACnB,MAAM,EAAI;EACV,QAAQ,EAAI;EACZ,QAAQ,EAAe,EAAI,MAAM,KAAK;EACtC,eAAe,EAAI;EACnB,cAAc,EAAI;EAClB,WAAW,EAAI;EACf,aAAa,EAAI;EACjB,SAAS,EAAI;EACb,QAAQ,EAAI,UAAU;EACtB,eAAe,EAAI,kBAAkB;EACrC,iBAAiB,EAAI,oBAAoB;EACzC,MAAM,EAAI,eAAe;CAC3B;AACF;AAQA,SAAgB,EAAsB,GAAwD;CAC5F,OAAO;EACL,OAAO,EAAI;EACX,QAAQ,EAAI,SAAS,CAAC,GAAG,IAAI,CAAiB;CAChD;AACF"}
1
+ {"version":3,"file":"to-user-transaction.js","names":[],"sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"sourcesContent":["import { toListingValue } from \"../markets/to-listing-market\";\nimport {\n type ListingDepositChainId,\n type PoolTransactionStatus,\n type PoolTransactionType,\n type UserTransaction,\n type UserTransactionPage,\n} from \"../types\";\nimport type { SearchUserTransactionsResult, UserTransactionItem } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw user-transaction row into the SDK's {@link UserTransaction}.\n *\n * `amount` is a 1e18-scaled integer string like the rest of the listing money\n * fields, parsed to a `bigint` at `LISTING_VALUE_DECIMALS` with\n * {@link toListingValue} (absent → `0n`); `tokenDecimals` is carried as metadata,\n * not as the amount's scale. The generated `transaction_type` /\n * `transaction_status` / `chain_id` enums share their string/number values with\n * the SDK's {@link PoolTransactionType} / {@link PoolTransactionStatus} /\n * {@link ListingDepositChainId}, so the casts are value-preserving.\n *\n * @param raw - One row of the user-transactions response.\n * @returns The normalized transaction.\n */\nexport function toUserTransaction(\n raw: UserTransactionItem & {\n token_amount?: string | null;\n usdc_amount?: string | null;\n refund_transaction_hash?: string | null;\n },\n): UserTransaction {\n return {\n tokenAmount: toListingValue(raw.token_amount),\n usdcAmount: toListingValue(raw.usdc_amount),\n refundTransactionHash: raw.refund_transaction_hash ?? null,\n transactionId: raw.transaction_id,\n type: raw.transaction_type as unknown as PoolTransactionType,\n status: raw.transaction_status as unknown as PoolTransactionStatus,\n amount: toListingValue(raw.amount) ?? 0n,\n tokenDecimals: raw.token_decimal,\n tokenAddress: raw.token_address,\n tokenName: raw.token_name,\n tokenTicker: raw.token_ticker,\n chainId: raw.chain_id as unknown as ListingDepositChainId,\n wallet: raw.wallet ?? null,\n refundAddress: raw.refund_address ?? null,\n transactionHash: raw.transaction_hash ?? null,\n time: raw.create_time ?? null,\n };\n}\n\n/**\n * Map the user-transactions envelope into a {@link UserTransactionPage}.\n *\n * @param raw - The response body.\n * @returns The normalized page. `count` is the total across all pages.\n */\nexport function toUserTransactionPage(raw: SearchUserTransactionsResult): UserTransactionPage {\n return {\n count: raw.count,\n items: (raw.items ?? []).map(toUserTransaction),\n };\n}\n"],"mappings":";;AAwBA,SAAgB,EACd,GAKiB;CACjB,OAAO;EACL,aAAa,EAAe,EAAI,YAAY;EAC5C,YAAY,EAAe,EAAI,WAAW;EAC1C,uBAAuB,EAAI,2BAA2B;EACtD,eAAe,EAAI;EACnB,MAAM,EAAI;EACV,QAAQ,EAAI;EACZ,QAAQ,EAAe,EAAI,MAAM,KAAK;EACtC,eAAe,EAAI;EACnB,cAAc,EAAI;EAClB,WAAW,EAAI;EACf,aAAa,EAAI;EACjB,SAAS,EAAI;EACb,QAAQ,EAAI,UAAU;EACtB,eAAe,EAAI,kBAAkB;EACrC,iBAAiB,EAAI,oBAAoB;EACzC,MAAM,EAAI,eAAe;CAC3B;AACF;AAQA,SAAgB,EAAsB,GAAwD;CAC5F,OAAO;EACL,OAAO,EAAI;EACX,QAAQ,EAAI,SAAS,CAAC,GAAG,IAAI,CAAiB;CAChD;AACF"}
@@ -29,13 +29,17 @@ export interface CalculateLiquidationPriceInputs {
29
29
  lockedCVA: bigint;
30
30
  /** Account's locked LF, from `balanceInfoOfPartyA(account)`. */
31
31
  lockedLF: bigint;
32
+ /** CVA reserved by pending positions; defaults to zero for existing callers. */
33
+ pendingLockedCVA?: bigint;
34
+ /** Liquidation fees reserved by pending positions; defaults to zero. */
35
+ pendingLockedLF?: bigint;
32
36
  }
33
37
  /**
34
38
  * Liquidation price for an account (sub-account or virtual account), in
35
39
  * 18-decimal-wei collateral units. Aggregates the account's active positions:
36
40
  *
37
41
  * ```
38
- * freeBalance = allocatedBalance − lockedCVA − lockedLF
42
+ * freeBalance = allocatedBalance − lockedCVA − lockedLF − pendingLockedCVA − pendingLockedLF
39
43
  * openQty_i = quantity_i − closedAmount_i
40
44
  * totalQty = Σ openQty_i
41
45
  * totalNotional = Σ (openQty_i × openedPrice_i)
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-liquidation-price.d.ts","sourceRoot":"","sources":["../../../src/quotes/liquidation/calculate-liquidation-price.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,wEAAwE;IACxE,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC,+DAA+D;IAC/D,YAAY,EAAE,YAAY,CAAC;IAC3B,2EAA2E;IAC3E,gBAAgB,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,+BAA+B,GAAG,MAAM,CAiBzF"}
1
+ {"version":3,"file":"calculate-liquidation-price.d.ts","sourceRoot":"","sources":["../../../src/quotes/liquidation/calculate-liquidation-price.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,wEAAwE;IACxE,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC,+DAA+D;IAC/D,YAAY,EAAE,YAAY,CAAC;IAC3B,2EAA2E;IAC3E,gBAAgB,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,+BAA+B,GAAG,MAAM,CAsBzF"}
@@ -8,7 +8,7 @@ function r(r) {
8
8
  t <= 0n || (i += t, a += n(t, e.openedPrice));
9
9
  }
10
10
  if (i === 0n) return 0n;
11
- let o = r.allocatedBalance - r.lockedCVA - r.lockedLF, s = (r.positionType === e.LONG ? a - o : a + o) * t / i;
11
+ let o = r.allocatedBalance - r.lockedCVA - r.lockedLF - (r.pendingLockedCVA ?? 0n) - (r.pendingLockedLF ?? 0n), s = (r.positionType === e.LONG ? a - o : a + o) * t / i;
12
12
  return s > 0n ? s : 0n;
13
13
  }
14
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-liquidation-price.js","names":[],"sources":["../../../src/quotes/liquidation/calculate-liquidation-price.ts"],"sourcesContent":["import { mulWei, WEI } from \"../../shared/utils/wei\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\n\n/**\n * One open position attributed to an account (sub-account or virtual account).\n * Used by every aggregate calc that runs over an account's positions (currently\n * {@link calculateLiquidationPrice}; more to follow).\n *\n * Every field is 18-decimal wei `bigint`. `closedAmount` defaults to `0n` when\n * omitted; `openedPrice` is the settled fill price.\n */\nexport interface AccountPosition {\n /** Total quote quantity (wei). */\n quantity: bigint;\n /** Already-closed quantity (wei). Defaults to `0n`. */\n closedAmount?: bigint;\n /** Settled `openedPrice` (wei). */\n openedPrice: bigint;\n}\n\n/**\n * Inputs for {@link calculateLiquidationPrice}. All bigint fields are 18-decimal wei.\n */\nexport interface CalculateLiquidationPriceInputs {\n /** Active positions in the account (sub-account or virtual account). */\n positions: readonly AccountPosition[];\n /** Direction of the account's net position (LONG or SHORT). */\n positionType: PositionType;\n /** Account's allocated collateral, from `balanceInfoOfPartyA(account)`. */\n allocatedBalance: bigint;\n /** Account's locked CVA, from `balanceInfoOfPartyA(account)`. */\n lockedCVA: bigint;\n /** Account's locked LF, from `balanceInfoOfPartyA(account)`. */\n lockedLF: bigint;\n}\n\n/**\n * Liquidation price for an account (sub-account or virtual account), in\n * 18-decimal-wei collateral units. Aggregates the account's active positions:\n *\n * ```\n * freeBalance = allocatedBalance − lockedCVA − lockedLF\n * openQty_i = quantity_i − closedAmount_i\n * totalQty = Σ openQty_i\n * totalNotional = Σ (openQty_i × openedPrice_i)\n *\n * LONG : liqPrice = (totalNotional − freeBalance) / totalQty\n * SHORT: liqPrice = (totalNotional + freeBalance) / totalQty\n * ```\n *\n * Returns `0n` when `totalQty` is `0n` or the computed price is `≤ 0n`\n * (typically meaning the account has no liquidation risk at any positive price).\n * All math is pure `bigint`, so there is no floating-point drift.\n *\n * @example\n * ```ts\n * const liq = calculateLiquidationPrice({\n * positions: [{ quantity: 1_000_000_000_000_000_000n, openedPrice: 2_000_000_000_000_000_000n }],\n * positionType: PositionType.LONG,\n * allocatedBalance: 200_000_000_000_000_000_000n,\n * lockedCVA: 10_000_000_000_000_000_000n,\n * lockedLF: 5_000_000_000_000_000_000n,\n * });\n * ```\n */\nexport function calculateLiquidationPrice(inputs: CalculateLiquidationPriceInputs): bigint {\n let totalQty = 0n;\n let totalNotional = 0n;\n for (const position of inputs.positions) {\n const openQty = position.quantity - (position.closedAmount ?? 0n);\n if (openQty <= 0n) continue;\n totalQty += openQty;\n totalNotional += mulWei(openQty, position.openedPrice);\n }\n if (totalQty === 0n) return 0n;\n\n const freeBalance = inputs.allocatedBalance - inputs.lockedCVA - inputs.lockedLF;\n const numerator =\n inputs.positionType === PositionType.LONG ? totalNotional - freeBalance : totalNotional + freeBalance;\n\n const liquidationPrice = (numerator * WEI) / totalQty;\n return liquidationPrice > 0n ? liquidationPrice : 0n;\n}\n"],"mappings":";;;AAiEA,SAAgB,EAA0B,GAAiD;CACzF,IAAI,IAAW,IACX,IAAgB;CACpB,KAAK,IAAM,KAAY,EAAO,WAAW;EACvC,IAAM,IAAU,EAAS,YAAY,EAAS,gBAAgB;EAC1D,KAAW,OACf,KAAY,GACZ,KAAiB,EAAO,GAAS,EAAS,WAAW;CACvD;CACA,IAAI,MAAa,IAAI,OAAO;CAE5B,IAAM,IAAc,EAAO,mBAAmB,EAAO,YAAY,EAAO,UAIlE,KAFJ,EAAO,iBAAiB,EAAa,OAAO,IAAgB,IAAc,IAAgB,KAEtD,IAAO;CAC7C,OAAO,IAAmB,KAAK,IAAmB;AACpD"}
1
+ {"version":3,"file":"calculate-liquidation-price.js","names":[],"sources":["../../../src/quotes/liquidation/calculate-liquidation-price.ts"],"sourcesContent":["import { mulWei, WEI } from \"../../shared/utils/wei\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\n\n/**\n * One open position attributed to an account (sub-account or virtual account).\n * Used by every aggregate calc that runs over an account's positions (currently\n * {@link calculateLiquidationPrice}; more to follow).\n *\n * Every field is 18-decimal wei `bigint`. `closedAmount` defaults to `0n` when\n * omitted; `openedPrice` is the settled fill price.\n */\nexport interface AccountPosition {\n /** Total quote quantity (wei). */\n quantity: bigint;\n /** Already-closed quantity (wei). Defaults to `0n`. */\n closedAmount?: bigint;\n /** Settled `openedPrice` (wei). */\n openedPrice: bigint;\n}\n\n/**\n * Inputs for {@link calculateLiquidationPrice}. All bigint fields are 18-decimal wei.\n */\nexport interface CalculateLiquidationPriceInputs {\n /** Active positions in the account (sub-account or virtual account). */\n positions: readonly AccountPosition[];\n /** Direction of the account's net position (LONG or SHORT). */\n positionType: PositionType;\n /** Account's allocated collateral, from `balanceInfoOfPartyA(account)`. */\n allocatedBalance: bigint;\n /** Account's locked CVA, from `balanceInfoOfPartyA(account)`. */\n lockedCVA: bigint;\n /** Account's locked LF, from `balanceInfoOfPartyA(account)`. */\n lockedLF: bigint;\n /** CVA reserved by pending positions; defaults to zero for existing callers. */\n pendingLockedCVA?: bigint;\n /** Liquidation fees reserved by pending positions; defaults to zero. */\n pendingLockedLF?: bigint;\n}\n\n/**\n * Liquidation price for an account (sub-account or virtual account), in\n * 18-decimal-wei collateral units. Aggregates the account's active positions:\n *\n * ```\n * freeBalance = allocatedBalance − lockedCVA − lockedLF − pendingLockedCVA − pendingLockedLF\n * openQty_i = quantity_i − closedAmount_i\n * totalQty = Σ openQty_i\n * totalNotional = Σ (openQty_i × openedPrice_i)\n *\n * LONG : liqPrice = (totalNotional − freeBalance) / totalQty\n * SHORT: liqPrice = (totalNotional + freeBalance) / totalQty\n * ```\n *\n * Returns `0n` when `totalQty` is `0n` or the computed price is `≤ 0n`\n * (typically meaning the account has no liquidation risk at any positive price).\n * All math is pure `bigint`, so there is no floating-point drift.\n *\n * @example\n * ```ts\n * const liq = calculateLiquidationPrice({\n * positions: [{ quantity: 1_000_000_000_000_000_000n, openedPrice: 2_000_000_000_000_000_000n }],\n * positionType: PositionType.LONG,\n * allocatedBalance: 200_000_000_000_000_000_000n,\n * lockedCVA: 10_000_000_000_000_000_000n,\n * lockedLF: 5_000_000_000_000_000_000n,\n * });\n * ```\n */\nexport function calculateLiquidationPrice(inputs: CalculateLiquidationPriceInputs): bigint {\n let totalQty = 0n;\n let totalNotional = 0n;\n for (const position of inputs.positions) {\n const openQty = position.quantity - (position.closedAmount ?? 0n);\n if (openQty <= 0n) continue;\n totalQty += openQty;\n totalNotional += mulWei(openQty, position.openedPrice);\n }\n if (totalQty === 0n) return 0n;\n\n const freeBalance =\n inputs.allocatedBalance -\n inputs.lockedCVA -\n inputs.lockedLF -\n (inputs.pendingLockedCVA ?? 0n) -\n (inputs.pendingLockedLF ?? 0n);\n const numerator =\n inputs.positionType === PositionType.LONG ? totalNotional - freeBalance : totalNotional + freeBalance;\n\n const liquidationPrice = (numerator * WEI) / totalQty;\n return liquidationPrice > 0n ? liquidationPrice : 0n;\n}\n"],"mappings":";;;AAqEA,SAAgB,EAA0B,GAAiD;CACzF,IAAI,IAAW,IACX,IAAgB;CACpB,KAAK,IAAM,KAAY,EAAO,WAAW;EACvC,IAAM,IAAU,EAAS,YAAY,EAAS,gBAAgB;EAC1D,KAAW,OACf,KAAY,GACZ,KAAiB,EAAO,GAAS,EAAS,WAAW;CACvD;CACA,IAAI,MAAa,IAAI,OAAO;CAE5B,IAAM,IACJ,EAAO,mBACP,EAAO,YACP,EAAO,YACN,EAAO,oBAAoB,OAC3B,EAAO,mBAAmB,KAIvB,KAFJ,EAAO,iBAAiB,EAAa,OAAO,IAAgB,IAAc,IAAgB,KAEtD,IAAO;CAC7C,OAAO,IAAmB,KAAK,IAAmB;AACpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-quote-pnl.d.ts","sourceRoot":"","sources":["../../../src/quotes/upnl/calculate-quote-pnl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,YAAY,CAAC;IAC3B,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,2BAA2B,CA0B9F"}
1
+ {"version":3,"file":"calculate-quote-pnl.d.ts","sourceRoot":"","sources":["../../../src/quotes/upnl/calculate-quote-pnl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,YAAY,CAAC;IAC3B,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,2BAA2B,CA8B9F"}
@@ -8,21 +8,21 @@ function r(r) {
8
8
  pnl: "0",
9
9
  pnlPercent: "0"
10
10
  };
11
- let l = i * (a - o) * c;
12
- if (!Number.isFinite(l)) return {
11
+ let l = t(r.closedAmount * (r.closedPrice - r.openedPrice) * BigInt(c) / 10n ** 18n, n), u = Number(l);
12
+ if (!Number.isFinite(u)) return {
13
13
  pnl: "0",
14
14
  pnlPercent: "0"
15
15
  };
16
16
  if (o <= 0 || !Number.isFinite(s)) return {
17
- pnl: String(l),
17
+ pnl: l,
18
18
  pnlPercent: "0"
19
19
  };
20
- let u = l / i / o * s * 100;
21
- return Number.isFinite(u) ? {
22
- pnl: String(l),
23
- pnlPercent: u.toFixed(2)
20
+ let d = u / i / o * s * 100;
21
+ return Number.isFinite(d) ? {
22
+ pnl: l,
23
+ pnlPercent: d.toFixed(2)
24
24
  } : {
25
- pnl: String(l),
25
+ pnl: l,
26
26
  pnlPercent: "0"
27
27
  };
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-quote-pnl.js","names":[],"sources":["../../../src/quotes/upnl/calculate-quote-pnl.ts"],"sourcesContent":["import { formatUnits } from \"viem\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\n\nconst WEI_DECIMALS = 18;\n\n/**\n * Inputs for {@link calculateQuotePnl}. Bigint fields are 18-decimal wei.\n */\nexport interface CalculateQuotePnlInputs {\n positionType: PositionType;\n /** Already-closed quantity, wei. */\n closedAmount: bigint;\n /** Average close price for the realized closes, wei. */\n closedPrice: bigint;\n /** Original opened price, wei. */\n openedPrice: bigint;\n /** Decimal-string leverage. */\n leverage: string;\n}\n\n/**\n * Return value of {@link calculateQuotePnl}.\n */\nexport interface CalculateQuotePnlReturnType {\n /** Realized PNL in collateral units, decimal string. `\"0\"` when nothing has closed. */\n pnl: string;\n /** Decimal percent (e.g. `\"12.34\"`). `\"0\"` when indeterminate. */\n pnlPercent: string;\n}\n\n/**\n * Realized PNL for a single quote — i.e. the closed-out portion only.\n *\n * - `sideSign = positionType === SHORT ? -1 : 1`\n * - `pnl = closedAmount × (closedPrice − openedPrice) × sideSign`\n * - `pnlPercent = pnl / closedAmount / openedPrice × leverage × 100`\n * (only when `closedAmount > 0` and `openedPrice > 0`; else `\"0\"`).\n *\n * @example\n * ```ts\n * const { pnl, pnlPercent } = calculateQuotePnl({\n * positionType: PositionType.LONG,\n * closedAmount: 50n * 10n ** 18n,\n * closedPrice: 90_000_000_000_000_000n, // 0.09\n * openedPrice: 80_000_000_000_000_000n, // 0.08\n * leverage: \"10\",\n * });\n * ```\n */\nexport function calculateQuotePnl(inputs: CalculateQuotePnlInputs): CalculateQuotePnlReturnType {\n const closedAmount = Number(formatUnits(inputs.closedAmount, WEI_DECIMALS));\n const closedPrice = Number(formatUnits(inputs.closedPrice, WEI_DECIMALS));\n const openedPrice = Number(formatUnits(inputs.openedPrice, WEI_DECIMALS));\n const leverage = Number(inputs.leverage);\n const sideSign = inputs.positionType === PositionType.SHORT ? -1 : 1;\n\n if (\n !Number.isFinite(closedAmount) ||\n !Number.isFinite(closedPrice) ||\n !Number.isFinite(openedPrice) ||\n closedAmount <= 0\n ) {\n return { pnl: \"0\", pnlPercent: \"0\" };\n }\n\n const pnl = closedAmount * (closedPrice - openedPrice) * sideSign;\n if (!Number.isFinite(pnl)) return { pnl: \"0\", pnlPercent: \"0\" };\n\n if (openedPrice <= 0 || !Number.isFinite(leverage)) {\n return { pnl: String(pnl), pnlPercent: \"0\" };\n }\n const pnlPercent = (pnl / closedAmount / openedPrice) * leverage * 100;\n if (!Number.isFinite(pnlPercent)) return { pnl: String(pnl), pnlPercent: \"0\" };\n\n return { pnl: String(pnl), pnlPercent: pnlPercent.toFixed(2) };\n}\n"],"mappings":";;;AAGA,IAAM,IAAe;AA8CrB,SAAgB,EAAkB,GAA8D;CAC9F,IAAM,IAAe,OAAO,EAAY,EAAO,cAAc,CAAY,CAAC,GACpE,IAAc,OAAO,EAAY,EAAO,aAAa,CAAY,CAAC,GAClE,IAAc,OAAO,EAAY,EAAO,aAAa,CAAY,CAAC,GAClE,IAAW,OAAO,EAAO,QAAQ,GACjC,IAAW,EAAO,iBAAiB,EAAa,QAAQ,KAAK;CAEnE,IACE,CAAC,OAAO,SAAS,CAAY,KAC7B,CAAC,OAAO,SAAS,CAAW,KAC5B,CAAC,OAAO,SAAS,CAAW,KAC5B,KAAgB,GAEhB,OAAO;EAAE,KAAK;EAAK,YAAY;CAAI;CAGrC,IAAM,IAAM,KAAgB,IAAc,KAAe;CACzD,IAAI,CAAC,OAAO,SAAS,CAAG,GAAG,OAAO;EAAE,KAAK;EAAK,YAAY;CAAI;CAE9D,IAAI,KAAe,KAAK,CAAC,OAAO,SAAS,CAAQ,GAC/C,OAAO;EAAE,KAAK,OAAO,CAAG;EAAG,YAAY;CAAI;CAE7C,IAAM,IAAc,IAAM,IAAe,IAAe,IAAW;CAGnE,OAFK,OAAO,SAAS,CAAU,IAExB;EAAE,KAAK,OAAO,CAAG;EAAG,YAAY,EAAW,QAAQ,CAAC;CAAE,IAFpB;EAAE,KAAK,OAAO,CAAG;EAAG,YAAY;CAAI;AAG/E"}
1
+ {"version":3,"file":"calculate-quote-pnl.js","names":[],"sources":["../../../src/quotes/upnl/calculate-quote-pnl.ts"],"sourcesContent":["import { formatUnits } from \"viem\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\n\nconst WEI_DECIMALS = 18;\n\n/**\n * Inputs for {@link calculateQuotePnl}. Bigint fields are 18-decimal wei.\n */\nexport interface CalculateQuotePnlInputs {\n positionType: PositionType;\n /** Already-closed quantity, wei. */\n closedAmount: bigint;\n /** Average close price for the realized closes, wei. */\n closedPrice: bigint;\n /** Original opened price, wei. */\n openedPrice: bigint;\n /** Decimal-string leverage. */\n leverage: string;\n}\n\n/**\n * Return value of {@link calculateQuotePnl}.\n */\nexport interface CalculateQuotePnlReturnType {\n /** Realized PNL in collateral units, decimal string. `\"0\"` when nothing has closed. */\n pnl: string;\n /** Decimal percent (e.g. `\"12.34\"`). `\"0\"` when indeterminate. */\n pnlPercent: string;\n}\n\n/**\n * Realized PNL for a single quote — i.e. the closed-out portion only.\n *\n * - `sideSign = positionType === SHORT ? -1 : 1`\n * - `pnl = closedAmount × (closedPrice − openedPrice) × sideSign`\n * - `pnlPercent = pnl / closedAmount / openedPrice × leverage × 100`\n * (only when `closedAmount > 0` and `openedPrice > 0`; else `\"0\"`).\n *\n * @example\n * ```ts\n * const { pnl, pnlPercent } = calculateQuotePnl({\n * positionType: PositionType.LONG,\n * closedAmount: 50n * 10n ** 18n,\n * closedPrice: 90_000_000_000_000_000n, // 0.09\n * openedPrice: 80_000_000_000_000_000n, // 0.08\n * leverage: \"10\",\n * });\n * ```\n */\nexport function calculateQuotePnl(inputs: CalculateQuotePnlInputs): CalculateQuotePnlReturnType {\n const closedAmount = Number(formatUnits(inputs.closedAmount, WEI_DECIMALS));\n const closedPrice = Number(formatUnits(inputs.closedPrice, WEI_DECIMALS));\n const openedPrice = Number(formatUnits(inputs.openedPrice, WEI_DECIMALS));\n const leverage = Number(inputs.leverage);\n const sideSign = inputs.positionType === PositionType.SHORT ? -1 : 1;\n\n if (\n !Number.isFinite(closedAmount) ||\n !Number.isFinite(closedPrice) ||\n !Number.isFinite(openedPrice) ||\n closedAmount <= 0\n ) {\n return { pnl: \"0\", pnlPercent: \"0\" };\n }\n\n const pnlExact = formatUnits(\n (inputs.closedAmount * (inputs.closedPrice - inputs.openedPrice) * BigInt(sideSign)) / 10n ** 18n,\n WEI_DECIMALS,\n );\n const pnl = Number(pnlExact);\n if (!Number.isFinite(pnl)) return { pnl: \"0\", pnlPercent: \"0\" };\n\n if (openedPrice <= 0 || !Number.isFinite(leverage)) {\n return { pnl: pnlExact, pnlPercent: \"0\" };\n }\n const pnlPercent = (pnl / closedAmount / openedPrice) * leverage * 100;\n if (!Number.isFinite(pnlPercent)) return { pnl: pnlExact, pnlPercent: \"0\" };\n\n return { pnl: pnlExact, pnlPercent: pnlPercent.toFixed(2) };\n}\n"],"mappings":";;;AAGA,IAAM,IAAe;AA8CrB,SAAgB,EAAkB,GAA8D;CAC9F,IAAM,IAAe,OAAO,EAAY,EAAO,cAAc,CAAY,CAAC,GACpE,IAAc,OAAO,EAAY,EAAO,aAAa,CAAY,CAAC,GAClE,IAAc,OAAO,EAAY,EAAO,aAAa,CAAY,CAAC,GAClE,IAAW,OAAO,EAAO,QAAQ,GACjC,IAAW,EAAO,iBAAiB,EAAa,QAAQ,KAAK;CAEnE,IACE,CAAC,OAAO,SAAS,CAAY,KAC7B,CAAC,OAAO,SAAS,CAAW,KAC5B,CAAC,OAAO,SAAS,CAAW,KAC5B,KAAgB,GAEhB,OAAO;EAAE,KAAK;EAAK,YAAY;CAAI;CAGrC,IAAM,IAAW,EACd,EAAO,gBAAgB,EAAO,cAAc,EAAO,eAAe,OAAO,CAAQ,IAAK,OAAO,KAC9F,CACF,GACM,IAAM,OAAO,CAAQ;CAC3B,IAAI,CAAC,OAAO,SAAS,CAAG,GAAG,OAAO;EAAE,KAAK;EAAK,YAAY;CAAI;CAE9D,IAAI,KAAe,KAAK,CAAC,OAAO,SAAS,CAAQ,GAC/C,OAAO;EAAE,KAAK;EAAU,YAAY;CAAI;CAE1C,IAAM,IAAc,IAAM,IAAe,IAAe,IAAW;CAGnE,OAFK,OAAO,SAAS,CAAU,IAExB;EAAE,KAAK;EAAU,YAAY,EAAW,QAAQ,CAAC;CAAE,IAFjB;EAAE,KAAK;EAAU,YAAY;CAAI;AAG5E"}
@@ -33,8 +33,8 @@ export interface CalculateQuoteUpnlReturnType {
33
33
  * - `upnlPercent = upnl / openQty / openedPrice × leverage × 100`
34
34
  * (only when `openQty > 0` and `openedPrice > 0`; else `"0"`).
35
35
  *
36
- * All wei inputs are normalized to decimals (`formatUnits(value, 18)`) before
37
- * the math. Returns `"0"` for any non-finite intermediate.
36
+ * Price subtraction and amount multiplication retain 18-decimal bigint precision.
37
+ * Returns `"0"` for any non-finite intermediate; the percent is presentation-rounded.
38
38
  *
39
39
  * @example
40
40
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-quote-upnl.d.ts","sourceRoot":"","sources":["../../../src/quotes/upnl/calculate-quote-upnl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,4BAA4B,CAqBjG"}
1
+ {"version":3,"file":"calculate-quote-upnl.d.ts","sourceRoot":"","sources":["../../../src/quotes/upnl/calculate-quote-upnl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,4BAA4B,CA0BjG"}
@@ -1,32 +1,33 @@
1
1
  import { PositionType as e } from "../../symmio-contracts/symmio/types.js";
2
- import { formatUnits as t } from "viem";
2
+ import { formatUnits as t, parseUnits as n } from "viem";
3
+ import { toDecimal as r } from "@symmio/utils";
3
4
  //#region src/quotes/upnl/calculate-quote-upnl.ts
4
- var n = 18;
5
- function r(r) {
6
- let i = Number(r.markPrice), a = Number(t(r.openedPrice, n)), o = Number(t(r.quantity - r.closedAmount, n)), s = Number(r.leverage), c = r.positionType === e.SHORT ? -1 : 1;
7
- if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || o <= 0) return {
5
+ var i = 18;
6
+ function a(a) {
7
+ let o = Number(a.markPrice), s = Number(t(a.openedPrice, i)), c = Number(t(a.quantity - a.closedAmount, i)), l = Number(a.leverage), u = a.positionType === e.SHORT ? -1 : 1;
8
+ if (!Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(c) || c <= 0) return {
8
9
  upnl: "0",
9
10
  upnlPercent: "0"
10
11
  };
11
- let l = o * (i - a) * c;
12
- if (!Number.isFinite(l)) return {
12
+ let d = n(r(a.markPrice).toFixed(), i), f = t((a.quantity - a.closedAmount) * (d - a.openedPrice) * BigInt(u) / 10n ** 18n, i), p = Number(f);
13
+ if (!Number.isFinite(p)) return {
13
14
  upnl: "0",
14
15
  upnlPercent: "0"
15
16
  };
16
- if (a <= 0 || !Number.isFinite(s)) return {
17
- upnl: String(l),
17
+ if (s <= 0 || !Number.isFinite(l)) return {
18
+ upnl: f,
18
19
  upnlPercent: "0"
19
20
  };
20
- let u = l / o / a * s * 100;
21
- return Number.isFinite(u) ? {
22
- upnl: String(l),
23
- upnlPercent: u.toFixed(2)
21
+ let m = p / c / s * l * 100;
22
+ return Number.isFinite(m) ? {
23
+ upnl: f,
24
+ upnlPercent: m.toFixed(2)
24
25
  } : {
25
- upnl: String(l),
26
+ upnl: f,
26
27
  upnlPercent: "0"
27
28
  };
28
29
  }
29
30
  //#endregion
30
- export { r as calculateQuoteUpnl };
31
+ export { a as calculateQuoteUpnl };
31
32
 
32
33
  //# sourceMappingURL=calculate-quote-upnl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-quote-upnl.js","names":[],"sources":["../../../src/quotes/upnl/calculate-quote-upnl.ts"],"sourcesContent":["import { formatUnits } from \"viem\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\n\nconst WEI_DECIMALS = 18;\n\n/**\n * Inputs for {@link calculateQuoteUpnl}. Bigint fields are 18-decimal wei.\n */\nexport interface CalculateQuoteUpnlInputs {\n /** Decimal-string mark price for the quote's market. */\n markPrice: string;\n positionType: PositionType;\n /** Original quote quantity, wei. */\n quantity: bigint;\n /** Already-closed quantity, wei. */\n closedAmount: bigint;\n /** Quote's opened price, wei. */\n openedPrice: bigint;\n /** Decimal-string leverage. Used for the percent term. */\n leverage: string;\n}\n\n/**\n * Return value of {@link calculateQuoteUpnl}.\n */\nexport interface CalculateQuoteUpnlReturnType {\n /** Unrealized PNL in collateral units, decimal string. `\"0\"` when no open size. */\n upnl: string;\n /** Decimal percent (e.g. `\"12.34\"`). `\"0\"` when indeterminate. */\n upnlPercent: string;\n}\n\n/**\n * Unrealized PNL for a single quote against the current mark price.\n *\n * - `openQty = quantity − closedAmount`\n * - `sideSign = positionType === SHORT ? -1 : 1`\n * - `upnl = openQty × (markPrice − openedPrice) × sideSign`\n * - `upnlPercent = upnl / openQty / openedPrice × leverage × 100`\n * (only when `openQty > 0` and `openedPrice > 0`; else `\"0\"`).\n *\n * All wei inputs are normalized to decimals (`formatUnits(value, 18)`) before\n * the math. Returns `\"0\"` for any non-finite intermediate.\n *\n * @example\n * ```ts\n * const { upnl, upnlPercent } = calculateQuoteUpnl({\n * markPrice: \"0.0085\",\n * positionType: PositionType.LONG,\n * quantity: 100n * 10n ** 18n,\n * closedAmount: 0n,\n * openedPrice: 80_000_000_000_000_000n, // 0.08\n * leverage: \"10\",\n * });\n * ```\n */\nexport function calculateQuoteUpnl(inputs: CalculateQuoteUpnlInputs): CalculateQuoteUpnlReturnType {\n const markPrice = Number(inputs.markPrice);\n const openedPrice = Number(formatUnits(inputs.openedPrice, WEI_DECIMALS));\n const openQty = Number(formatUnits(inputs.quantity - inputs.closedAmount, WEI_DECIMALS));\n const leverage = Number(inputs.leverage);\n const sideSign = inputs.positionType === PositionType.SHORT ? -1 : 1;\n\n if (!Number.isFinite(markPrice) || !Number.isFinite(openedPrice) || !Number.isFinite(openQty) || openQty <= 0) {\n return { upnl: \"0\", upnlPercent: \"0\" };\n }\n\n const upnl = openQty * (markPrice - openedPrice) * sideSign;\n if (!Number.isFinite(upnl)) return { upnl: \"0\", upnlPercent: \"0\" };\n\n if (openedPrice <= 0 || !Number.isFinite(leverage)) {\n return { upnl: String(upnl), upnlPercent: \"0\" };\n }\n const upnlPercent = (upnl / openQty / openedPrice) * leverage * 100;\n if (!Number.isFinite(upnlPercent)) return { upnl: String(upnl), upnlPercent: \"0\" };\n\n return { upnl: String(upnl), upnlPercent: upnlPercent.toFixed(2) };\n}\n"],"mappings":";;;AAGA,IAAM,IAAe;AAqDrB,SAAgB,EAAmB,GAAgE;CACjG,IAAM,IAAY,OAAO,EAAO,SAAS,GACnC,IAAc,OAAO,EAAY,EAAO,aAAa,CAAY,CAAC,GAClE,IAAU,OAAO,EAAY,EAAO,WAAW,EAAO,cAAc,CAAY,CAAC,GACjF,IAAW,OAAO,EAAO,QAAQ,GACjC,IAAW,EAAO,iBAAiB,EAAa,QAAQ,KAAK;CAEnE,IAAI,CAAC,OAAO,SAAS,CAAS,KAAK,CAAC,OAAO,SAAS,CAAW,KAAK,CAAC,OAAO,SAAS,CAAO,KAAK,KAAW,GAC1G,OAAO;EAAE,MAAM;EAAK,aAAa;CAAI;CAGvC,IAAM,IAAO,KAAW,IAAY,KAAe;CACnD,IAAI,CAAC,OAAO,SAAS,CAAI,GAAG,OAAO;EAAE,MAAM;EAAK,aAAa;CAAI;CAEjE,IAAI,KAAe,KAAK,CAAC,OAAO,SAAS,CAAQ,GAC/C,OAAO;EAAE,MAAM,OAAO,CAAI;EAAG,aAAa;CAAI;CAEhD,IAAM,IAAe,IAAO,IAAU,IAAe,IAAW;CAGhE,OAFK,OAAO,SAAS,CAAW,IAEzB;EAAE,MAAM,OAAO,CAAI;EAAG,aAAa,EAAY,QAAQ,CAAC;CAAE,IAFvB;EAAE,MAAM,OAAO,CAAI;EAAG,aAAa;CAAI;AAGnF"}
1
+ {"version":3,"file":"calculate-quote-upnl.js","names":[],"sources":["../../../src/quotes/upnl/calculate-quote-upnl.ts"],"sourcesContent":["import { toDecimal } from \"@symmio/utils\";\nimport { formatUnits, parseUnits } from \"viem\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\n\nconst WEI_DECIMALS = 18;\n\n/**\n * Inputs for {@link calculateQuoteUpnl}. Bigint fields are 18-decimal wei.\n */\nexport interface CalculateQuoteUpnlInputs {\n /** Decimal-string mark price for the quote's market. */\n markPrice: string;\n positionType: PositionType;\n /** Original quote quantity, wei. */\n quantity: bigint;\n /** Already-closed quantity, wei. */\n closedAmount: bigint;\n /** Quote's opened price, wei. */\n openedPrice: bigint;\n /** Decimal-string leverage. Used for the percent term. */\n leverage: string;\n}\n\n/**\n * Return value of {@link calculateQuoteUpnl}.\n */\nexport interface CalculateQuoteUpnlReturnType {\n /** Unrealized PNL in collateral units, decimal string. `\"0\"` when no open size. */\n upnl: string;\n /** Decimal percent (e.g. `\"12.34\"`). `\"0\"` when indeterminate. */\n upnlPercent: string;\n}\n\n/**\n * Unrealized PNL for a single quote against the current mark price.\n *\n * - `openQty = quantity − closedAmount`\n * - `sideSign = positionType === SHORT ? -1 : 1`\n * - `upnl = openQty × (markPrice − openedPrice) × sideSign`\n * - `upnlPercent = upnl / openQty / openedPrice × leverage × 100`\n * (only when `openQty > 0` and `openedPrice > 0`; else `\"0\"`).\n *\n * Price subtraction and amount multiplication retain 18-decimal bigint precision.\n * Returns `\"0\"` for any non-finite intermediate; the percent is presentation-rounded.\n *\n * @example\n * ```ts\n * const { upnl, upnlPercent } = calculateQuoteUpnl({\n * markPrice: \"0.0085\",\n * positionType: PositionType.LONG,\n * quantity: 100n * 10n ** 18n,\n * closedAmount: 0n,\n * openedPrice: 80_000_000_000_000_000n, // 0.08\n * leverage: \"10\",\n * });\n * ```\n */\nexport function calculateQuoteUpnl(inputs: CalculateQuoteUpnlInputs): CalculateQuoteUpnlReturnType {\n const markPrice = Number(inputs.markPrice);\n const openedPrice = Number(formatUnits(inputs.openedPrice, WEI_DECIMALS));\n const openQty = Number(formatUnits(inputs.quantity - inputs.closedAmount, WEI_DECIMALS));\n const leverage = Number(inputs.leverage);\n const sideSign = inputs.positionType === PositionType.SHORT ? -1 : 1;\n\n if (!Number.isFinite(markPrice) || !Number.isFinite(openedPrice) || !Number.isFinite(openQty) || openQty <= 0) {\n return { upnl: \"0\", upnlPercent: \"0\" };\n }\n\n const markRaw = parseUnits(toDecimal(inputs.markPrice).toFixed(), WEI_DECIMALS);\n const upnlExact = formatUnits(\n ((inputs.quantity - inputs.closedAmount) * (markRaw - inputs.openedPrice) * BigInt(sideSign)) / 10n ** 18n,\n WEI_DECIMALS,\n );\n const upnl = Number(upnlExact);\n if (!Number.isFinite(upnl)) return { upnl: \"0\", upnlPercent: \"0\" };\n\n if (openedPrice <= 0 || !Number.isFinite(leverage)) {\n return { upnl: upnlExact, upnlPercent: \"0\" };\n }\n const upnlPercent = (upnl / openQty / openedPrice) * leverage * 100;\n if (!Number.isFinite(upnlPercent)) return { upnl: upnlExact, upnlPercent: \"0\" };\n\n return { upnl: upnlExact, upnlPercent: upnlPercent.toFixed(2) };\n}\n"],"mappings":";;;;AAIA,IAAM,IAAe;AAqDrB,SAAgB,EAAmB,GAAgE;CACjG,IAAM,IAAY,OAAO,EAAO,SAAS,GACnC,IAAc,OAAO,EAAY,EAAO,aAAa,CAAY,CAAC,GAClE,IAAU,OAAO,EAAY,EAAO,WAAW,EAAO,cAAc,CAAY,CAAC,GACjF,IAAW,OAAO,EAAO,QAAQ,GACjC,IAAW,EAAO,iBAAiB,EAAa,QAAQ,KAAK;CAEnE,IAAI,CAAC,OAAO,SAAS,CAAS,KAAK,CAAC,OAAO,SAAS,CAAW,KAAK,CAAC,OAAO,SAAS,CAAO,KAAK,KAAW,GAC1G,OAAO;EAAE,MAAM;EAAK,aAAa;CAAI;CAGvC,IAAM,IAAU,EAAW,EAAU,EAAO,SAAS,EAAE,QAAQ,GAAG,CAAY,GACxE,IAAY,GACd,EAAO,WAAW,EAAO,iBAAiB,IAAU,EAAO,eAAe,OAAO,CAAQ,IAAK,OAAO,KACvG,CACF,GACM,IAAO,OAAO,CAAS;CAC7B,IAAI,CAAC,OAAO,SAAS,CAAI,GAAG,OAAO;EAAE,MAAM;EAAK,aAAa;CAAI;CAEjE,IAAI,KAAe,KAAK,CAAC,OAAO,SAAS,CAAQ,GAC/C,OAAO;EAAE,MAAM;EAAW,aAAa;CAAI;CAE7C,IAAM,IAAe,IAAO,IAAU,IAAe,IAAW;CAGhE,OAFK,OAAO,SAAS,CAAW,IAEzB;EAAE,MAAM;EAAW,aAAa,EAAY,QAAQ,CAAC;CAAE,IAFpB;EAAE,MAAM;EAAW,aAAa;CAAI;AAGhF"}
@@ -21,11 +21,11 @@ export declare function graphql(source: "\n query MarginTransfers(\n $where:
21
21
  /**
22
22
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
23
23
  */
24
- export declare function graphql(source: "\n query PoolQuotes(\n $symbolId: BigInt!\n $source: Bytes!\n $quoteStatuses: [Int!]!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quotes(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\n ) {\n id\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n quantity\n closedAmount\n quantityToClose\n openedPrice\n requestedOpenPrice\n averageClosedPrice\n closePrice\n initialOpenedPrice\n liquidateAmount\n liquidatePrice\n timestamp\n blockNumber\n }\n }\n"): typeof import('./graphql.js').PoolQuotesDocument;
24
+ export declare function graphql(source: "\n query PoolQuotes(\n $symbolId: BigInt!\n $source: Bytes!\n $quoteStatuses: [Int!]!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quotes(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\n ) {\n id\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n quantity\n closedAmount\n quantityToClose\n openedPrice\n requestedOpenPrice\n averageClosedPrice\n closePrice\n initialOpenedPrice\n liquidateAmount\n liquidatePrice\n timestamp\n blockNumber\n timestampSendQuote\n timestampOpenPosition\n subAccount {\n id\n owner\n }\n closedPrice\n marketPrice\n tradingFee\n closeFee\n leverage\n initialCva\n initialPartyAmm\n initialLf\n userPaidFunding\n userReceivedFunding\n }\n }\n"): typeof import('./graphql.js').PoolQuotesDocument;
25
25
  /**
26
26
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
27
27
  */
28
- export declare function graphql(source: '\n query PoolQuoteEvents(\n $typeIn: [String!]!\n $symbolId: BigInt!\n $source: Bytes!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\n ) {\n id\n type\n metadata\n timestamp\n quoteId\n blockNumber\n transaction\n source\n quote {\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: "SEND_QUOTE" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: "OPEN_POSITION" }, first: 1000) {\n metadata\n }\n }\n }\n }\n'): typeof import('./graphql.js').PoolQuoteEventsDocument;
28
+ export declare function graphql(source: '\n query PoolQuoteEvents(\n $typeIn: [String!]!\n $symbolId: BigInt!\n $source: Bytes!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\n ) {\n id\n type\n metadata\n timestamp\n quoteId\n blockNumber\n transaction\n source\n quote {\n id\n timestamp\n blockNumber\n userPaidFunding\n userReceivedFunding\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: "SEND_QUOTE" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: "OPEN_POSITION" }, first: 1000) {\n metadata\n }\n }\n }\n }\n'): typeof import('./graphql.js').PoolQuoteEventsDocument;
29
29
  /**
30
30
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
31
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../../../src/symmio-subgraph/types/generated/analytics/gql.ts"],"names":[],"mappings":"AAuDA;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,kwBAAkwB,GACzwB,cAAc,WAAW,EAAE,sBAAsB,CAAC;AACrD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,wyBAAwyB,GAC/yB,cAAc,WAAW,EAAE,+BAA+B,CAAC;AAC9D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,o4BAAo4B,GAC34B,cAAc,WAAW,EAAE,+BAA+B,CAAC;AAC9D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,irBAAirB,GACxrB,cAAc,WAAW,EAAE,0BAA0B,CAAC;AACzD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,0fAA0f,GACjgB,cAAc,WAAW,EAAE,uBAAuB,CAAC;AACtD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,myBAAmyB,GAC1yB,cAAc,WAAW,EAAE,kBAAkB,CAAC;AACjD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,i9CAAi9C,GACx9C,cAAc,WAAW,EAAE,uBAAuB,CAAC;AACtD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,mYAAmY,GAC1Y,cAAc,WAAW,EAAE,iCAAiC,CAAC;AAChE;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,2LAA2L,GAClM,cAAc,WAAW,EAAE,qBAAqB,CAAC;AACpD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,qzCAAqzC,GAC5zC,cAAc,WAAW,EAAE,6BAA6B,CAAC;AAC5D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,oYAAoY,GAC3Y,cAAc,WAAW,EAAE,kCAAkC,CAAC;AACjE;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,ytBAAytB,GAChuB,cAAc,WAAW,EAAE,sBAAsB,CAAC"}
1
+ {"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../../../src/symmio-subgraph/types/generated/analytics/gql.ts"],"names":[],"mappings":"AAuDA;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,kwBAAkwB,GACzwB,cAAc,WAAW,EAAE,sBAAsB,CAAC;AACrD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,wyBAAwyB,GAC/yB,cAAc,WAAW,EAAE,+BAA+B,CAAC;AAC9D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,o4BAAo4B,GAC34B,cAAc,WAAW,EAAE,+BAA+B,CAAC;AAC9D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,irBAAirB,GACxrB,cAAc,WAAW,EAAE,0BAA0B,CAAC;AACzD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,0fAA0f,GACjgB,cAAc,WAAW,EAAE,uBAAuB,CAAC;AACtD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,slCAAslC,GAC7lC,cAAc,WAAW,EAAE,kBAAkB,CAAC;AACjD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,2jDAA2jD,GAClkD,cAAc,WAAW,EAAE,uBAAuB,CAAC;AACtD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,mYAAmY,GAC1Y,cAAc,WAAW,EAAE,iCAAiC,CAAC;AAChE;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,2LAA2L,GAClM,cAAc,WAAW,EAAE,qBAAqB,CAAC;AACpD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,qzCAAqzC,GAC5zC,cAAc,WAAW,EAAE,6BAA6B,CAAC;AAC5D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,oYAAoY,GAC3Y,cAAc,WAAW,EAAE,kCAAkC,CAAC;AACjE;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,ytBAAytB,GAChuB,cAAc,WAAW,EAAE,sBAAsB,CAAC"}
@@ -6,8 +6,8 @@ var f = {
6
6
  "\n query QuoteFundingSettlements(\n $where: QuoteFundingSettlement_filter!\n $first: Int!\n $skip: Int!\n $orderBy: QuoteFundingSettlement_orderBy!\n $orderDirection: OrderDirection!\n ) {\n quoteFundingSettlements(\n first: $first\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n where: $where\n ) {\n id\n source\n quoteId\n partyA\n partyB\n symbolId\n positionType\n trigger\n openAmount\n signedAmount\n paidByPartyA\n receivedByPartyA\n previousAccumulatedPaidFunding\n newAccumulatedPaidFunding\n fundingDeltaPerUnit\n previousLastFundingPaymentTimestamp\n newLastFundingPaymentTimestamp\n previousPaidThroughEpoch\n newPaidThroughEpoch\n balanceChanged\n timestamp\n blockNumber\n transaction\n }\n }\n": l,
7
7
  "\n query LiquidationDetails(\n $where: LiquidationDetail_filter!\n $first: Int!\n $skip: Int!\n $orderBy: LiquidationDetail_orderBy!\n $orderDirection: OrderDirection!\n ) {\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n source\n partyA\n liquidationId\n liquidationType\n liquidationTimestamp\n timestamp\n lockedCva\n lockedLf\n lockedPartyAmm\n paidCva\n paidLf\n upnl\n deficit\n liquidationFee\n settled\n fullyLiquidated\n settlementExpectedAmounts\n settlementActualAmounts\n }\n }\n": n,
8
8
  "\n query MarginTransfers(\n $where: MarginTransfer_filter!\n $first: Int!\n $skip: Int!\n $orderBy: MarginTransfer_orderBy!\n $orderDirection: OrderDirection!\n ) {\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n type\n amount\n source\n timestamp\n blockNumber\n transaction\n virtualAccount {\n id\n }\n subAccount {\n id\n }\n }\n }\n": r,
9
- "\n query PoolQuotes(\n $symbolId: BigInt!\n $source: Bytes!\n $quoteStatuses: [Int!]!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quotes(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\n ) {\n id\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n quantity\n closedAmount\n quantityToClose\n openedPrice\n requestedOpenPrice\n averageClosedPrice\n closePrice\n initialOpenedPrice\n liquidateAmount\n liquidatePrice\n timestamp\n blockNumber\n }\n }\n": a,
10
- "\n query PoolQuoteEvents(\n $typeIn: [String!]!\n $symbolId: BigInt!\n $source: Bytes!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\n ) {\n id\n type\n metadata\n timestamp\n quoteId\n blockNumber\n transaction\n source\n quote {\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\n metadata\n }\n }\n }\n }\n": i,
9
+ "\n query PoolQuotes(\n $symbolId: BigInt!\n $source: Bytes!\n $quoteStatuses: [Int!]!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quotes(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\n ) {\n id\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n quantity\n closedAmount\n quantityToClose\n openedPrice\n requestedOpenPrice\n averageClosedPrice\n closePrice\n initialOpenedPrice\n liquidateAmount\n liquidatePrice\n timestamp\n blockNumber\n timestampSendQuote\n timestampOpenPosition\n subAccount {\n id\n owner\n }\n closedPrice\n marketPrice\n tradingFee\n closeFee\n leverage\n initialCva\n initialPartyAmm\n initialLf\n userPaidFunding\n userReceivedFunding\n }\n }\n": a,
10
+ "\n query PoolQuoteEvents(\n $typeIn: [String!]!\n $symbolId: BigInt!\n $source: Bytes!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\n ) {\n id\n type\n metadata\n timestamp\n quoteId\n blockNumber\n transaction\n source\n quote {\n id\n timestamp\n blockNumber\n userPaidFunding\n userReceivedFunding\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\n metadata\n }\n }\n }\n }\n": i,
11
11
  "\n query QuoteEventsForQuoteByType(\n $where: QuoteEvent_filter!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n blockNumber\n transaction\n quoteId\n }\n }\n": s,
12
12
  "\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\n quotes(first: $first, where: $where) {\n quoteId\n userPaidFunding\n userReceivedFunding\n }\n }\n": u,
13
13
  "\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n quoteId\n blockNumber\n transaction\n source\n quote {\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\n metadata\n }\n }\n }\n }\n": o,
@@ -1 +1 @@
1
- {"version":3,"file":"gql.js","names":[],"sources":["../../../../../src/symmio-subgraph/types/generated/analytics/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from \"./graphql\";\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size\n */\ntype Documents = {\n \"\\n query BalanceChanges(\\n $accounts: [Bytes!]!\\n $typeIn: [String!]!\\n $isMarginTransferSideEffectIn: [Boolean!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n $startDate: BigInt!\\n $endDate: BigInt!\\n ) {\\n balanceChanges(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: {\\n account_in: $accounts\\n type_in: $typeIn\\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\\n timestamp_gte: $startDate\\n timestamp_lte: $endDate\\n }\\n ) {\\n id\\n type\\n amount\\n account\\n timestamp\\n transaction\\n isMarginTransferSideEffect\\n marginTransferType\\n }\\n }\\n\": typeof types.BalanceChangesDocument;\n \"\\n query FundingIndexCheckpoints(\\n $where: FundingIndexCheckpoint_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: FundingIndexCheckpoint_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n fundingIndexCheckpoints(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n symbolId\\n partyB\\n eventType\\n rawLongRate\\n rawShortRate\\n marketPrice\\n currentLongRate\\n currentShortRate\\n accumulatedLongRate\\n accumulatedShortRate\\n epochDuration\\n lastUpdatedEpoch\\n startEpoch\\n startEpochTimestamp\\n snapshotLongFee\\n snapshotShortFee\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\": typeof types.FundingIndexCheckpointsDocument;\n \"\\n query QuoteFundingSettlements(\\n $where: QuoteFundingSettlement_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: QuoteFundingSettlement_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteFundingSettlements(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n quoteId\\n partyA\\n partyB\\n symbolId\\n positionType\\n trigger\\n openAmount\\n signedAmount\\n paidByPartyA\\n receivedByPartyA\\n previousAccumulatedPaidFunding\\n newAccumulatedPaidFunding\\n fundingDeltaPerUnit\\n previousLastFundingPaymentTimestamp\\n newLastFundingPaymentTimestamp\\n previousPaidThroughEpoch\\n newPaidThroughEpoch\\n balanceChanged\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\": typeof types.QuoteFundingSettlementsDocument;\n \"\\n query LiquidationDetails(\\n $where: LiquidationDetail_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: LiquidationDetail_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n partyA\\n liquidationId\\n liquidationType\\n liquidationTimestamp\\n timestamp\\n lockedCva\\n lockedLf\\n lockedPartyAmm\\n paidCva\\n paidLf\\n upnl\\n deficit\\n liquidationFee\\n settled\\n fullyLiquidated\\n settlementExpectedAmounts\\n settlementActualAmounts\\n }\\n }\\n\": typeof types.LiquidationDetailsDocument;\n \"\\n query MarginTransfers(\\n $where: MarginTransfer_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: MarginTransfer_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n amount\\n source\\n timestamp\\n blockNumber\\n transaction\\n virtualAccount {\\n id\\n }\\n subAccount {\\n id\\n }\\n }\\n }\\n\": typeof types.MarginTransfersDocument;\n \"\\n query PoolQuotes(\\n $symbolId: BigInt!\\n $source: Bytes!\\n $quoteStatuses: [Int!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\\n ) {\\n id\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n quantity\\n closedAmount\\n quantityToClose\\n openedPrice\\n requestedOpenPrice\\n averageClosedPrice\\n closePrice\\n initialOpenedPrice\\n liquidateAmount\\n liquidatePrice\\n timestamp\\n blockNumber\\n }\\n }\\n\": typeof types.PoolQuotesDocument;\n '\\n query PoolQuoteEvents(\\n $typeIn: [String!]!\\n $symbolId: BigInt!\\n $source: Bytes!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\\n ) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n': typeof types.PoolQuoteEventsDocument;\n \"\\n query QuoteEventsForQuoteByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\": typeof types.QuoteEventsForQuoteByTypeDocument;\n \"\\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\\n quotes(first: $first, where: $where) {\\n quoteId\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\": typeof types.QuotesFundingDocument;\n '\\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n': typeof types.QuoteEventsForHistoryDocument;\n \"\\n query QuoteEventsForQuotesByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\": typeof types.QuoteEventsForQuotesByTypeDocument;\n \"\\n query SubgraphQuotes(\\n $where: Quote_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: Quote_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n quoteId\\n quoteStatus\\n partyA\\n partyB\\n symbolId\\n symbol\\n positionType\\n quantity\\n fillAmount\\n closedAmount\\n openedPrice\\n accumulatedPaidFunding\\n lastFundingPaymentTimestamp\\n userPaidFunding\\n userReceivedFunding\\n timestampSendQuote\\n timestampOpenPosition\\n timestampFullyClose\\n timestamp\\n blockNumber\\n }\\n }\\n\": typeof types.SubgraphQuotesDocument;\n};\nconst documents: Documents = {\n \"\\n query BalanceChanges(\\n $accounts: [Bytes!]!\\n $typeIn: [String!]!\\n $isMarginTransferSideEffectIn: [Boolean!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n $startDate: BigInt!\\n $endDate: BigInt!\\n ) {\\n balanceChanges(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: {\\n account_in: $accounts\\n type_in: $typeIn\\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\\n timestamp_gte: $startDate\\n timestamp_lte: $endDate\\n }\\n ) {\\n id\\n type\\n amount\\n account\\n timestamp\\n transaction\\n isMarginTransferSideEffect\\n marginTransferType\\n }\\n }\\n\":\n types.BalanceChangesDocument,\n \"\\n query FundingIndexCheckpoints(\\n $where: FundingIndexCheckpoint_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: FundingIndexCheckpoint_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n fundingIndexCheckpoints(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n symbolId\\n partyB\\n eventType\\n rawLongRate\\n rawShortRate\\n marketPrice\\n currentLongRate\\n currentShortRate\\n accumulatedLongRate\\n accumulatedShortRate\\n epochDuration\\n lastUpdatedEpoch\\n startEpoch\\n startEpochTimestamp\\n snapshotLongFee\\n snapshotShortFee\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\":\n types.FundingIndexCheckpointsDocument,\n \"\\n query QuoteFundingSettlements(\\n $where: QuoteFundingSettlement_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: QuoteFundingSettlement_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteFundingSettlements(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n quoteId\\n partyA\\n partyB\\n symbolId\\n positionType\\n trigger\\n openAmount\\n signedAmount\\n paidByPartyA\\n receivedByPartyA\\n previousAccumulatedPaidFunding\\n newAccumulatedPaidFunding\\n fundingDeltaPerUnit\\n previousLastFundingPaymentTimestamp\\n newLastFundingPaymentTimestamp\\n previousPaidThroughEpoch\\n newPaidThroughEpoch\\n balanceChanged\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\":\n types.QuoteFundingSettlementsDocument,\n \"\\n query LiquidationDetails(\\n $where: LiquidationDetail_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: LiquidationDetail_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n partyA\\n liquidationId\\n liquidationType\\n liquidationTimestamp\\n timestamp\\n lockedCva\\n lockedLf\\n lockedPartyAmm\\n paidCva\\n paidLf\\n upnl\\n deficit\\n liquidationFee\\n settled\\n fullyLiquidated\\n settlementExpectedAmounts\\n settlementActualAmounts\\n }\\n }\\n\":\n types.LiquidationDetailsDocument,\n \"\\n query MarginTransfers(\\n $where: MarginTransfer_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: MarginTransfer_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n amount\\n source\\n timestamp\\n blockNumber\\n transaction\\n virtualAccount {\\n id\\n }\\n subAccount {\\n id\\n }\\n }\\n }\\n\":\n types.MarginTransfersDocument,\n \"\\n query PoolQuotes(\\n $symbolId: BigInt!\\n $source: Bytes!\\n $quoteStatuses: [Int!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\\n ) {\\n id\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n quantity\\n closedAmount\\n quantityToClose\\n openedPrice\\n requestedOpenPrice\\n averageClosedPrice\\n closePrice\\n initialOpenedPrice\\n liquidateAmount\\n liquidatePrice\\n timestamp\\n blockNumber\\n }\\n }\\n\":\n types.PoolQuotesDocument,\n '\\n query PoolQuoteEvents(\\n $typeIn: [String!]!\\n $symbolId: BigInt!\\n $source: Bytes!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\\n ) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n':\n types.PoolQuoteEventsDocument,\n \"\\n query QuoteEventsForQuoteByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\":\n types.QuoteEventsForQuoteByTypeDocument,\n \"\\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\\n quotes(first: $first, where: $where) {\\n quoteId\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\":\n types.QuotesFundingDocument,\n '\\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n':\n types.QuoteEventsForHistoryDocument,\n \"\\n query QuoteEventsForQuotesByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\":\n types.QuoteEventsForQuotesByTypeDocument,\n \"\\n query SubgraphQuotes(\\n $where: Quote_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: Quote_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n quoteId\\n quoteStatus\\n partyA\\n partyB\\n symbolId\\n symbol\\n positionType\\n quantity\\n fillAmount\\n closedAmount\\n openedPrice\\n accumulatedPaidFunding\\n lastFundingPaymentTimestamp\\n userPaidFunding\\n userReceivedFunding\\n timestampSendQuote\\n timestampOpenPosition\\n timestampFullyClose\\n timestamp\\n blockNumber\\n }\\n }\\n\":\n types.SubgraphQuotesDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query BalanceChanges(\\n $accounts: [Bytes!]!\\n $typeIn: [String!]!\\n $isMarginTransferSideEffectIn: [Boolean!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n $startDate: BigInt!\\n $endDate: BigInt!\\n ) {\\n balanceChanges(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: {\\n account_in: $accounts\\n type_in: $typeIn\\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\\n timestamp_gte: $startDate\\n timestamp_lte: $endDate\\n }\\n ) {\\n id\\n type\\n amount\\n account\\n timestamp\\n transaction\\n isMarginTransferSideEffect\\n marginTransferType\\n }\\n }\\n\",\n): typeof import(\"./graphql\").BalanceChangesDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query FundingIndexCheckpoints(\\n $where: FundingIndexCheckpoint_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: FundingIndexCheckpoint_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n fundingIndexCheckpoints(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n symbolId\\n partyB\\n eventType\\n rawLongRate\\n rawShortRate\\n marketPrice\\n currentLongRate\\n currentShortRate\\n accumulatedLongRate\\n accumulatedShortRate\\n epochDuration\\n lastUpdatedEpoch\\n startEpoch\\n startEpochTimestamp\\n snapshotLongFee\\n snapshotShortFee\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\",\n): typeof import(\"./graphql\").FundingIndexCheckpointsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuoteFundingSettlements(\\n $where: QuoteFundingSettlement_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: QuoteFundingSettlement_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteFundingSettlements(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n quoteId\\n partyA\\n partyB\\n symbolId\\n positionType\\n trigger\\n openAmount\\n signedAmount\\n paidByPartyA\\n receivedByPartyA\\n previousAccumulatedPaidFunding\\n newAccumulatedPaidFunding\\n fundingDeltaPerUnit\\n previousLastFundingPaymentTimestamp\\n newLastFundingPaymentTimestamp\\n previousPaidThroughEpoch\\n newPaidThroughEpoch\\n balanceChanged\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuoteFundingSettlementsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query LiquidationDetails(\\n $where: LiquidationDetail_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: LiquidationDetail_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n partyA\\n liquidationId\\n liquidationType\\n liquidationTimestamp\\n timestamp\\n lockedCva\\n lockedLf\\n lockedPartyAmm\\n paidCva\\n paidLf\\n upnl\\n deficit\\n liquidationFee\\n settled\\n fullyLiquidated\\n settlementExpectedAmounts\\n settlementActualAmounts\\n }\\n }\\n\",\n): typeof import(\"./graphql\").LiquidationDetailsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query MarginTransfers(\\n $where: MarginTransfer_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: MarginTransfer_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n amount\\n source\\n timestamp\\n blockNumber\\n transaction\\n virtualAccount {\\n id\\n }\\n subAccount {\\n id\\n }\\n }\\n }\\n\",\n): typeof import(\"./graphql\").MarginTransfersDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query PoolQuotes(\\n $symbolId: BigInt!\\n $source: Bytes!\\n $quoteStatuses: [Int!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\\n ) {\\n id\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n quantity\\n closedAmount\\n quantityToClose\\n openedPrice\\n requestedOpenPrice\\n averageClosedPrice\\n closePrice\\n initialOpenedPrice\\n liquidateAmount\\n liquidatePrice\\n timestamp\\n blockNumber\\n }\\n }\\n\",\n): typeof import(\"./graphql\").PoolQuotesDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query PoolQuoteEvents(\\n $typeIn: [String!]!\\n $symbolId: BigInt!\\n $source: Bytes!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\\n ) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n',\n): typeof import(\"./graphql\").PoolQuoteEventsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuoteEventsForQuoteByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuoteEventsForQuoteByTypeDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\\n quotes(first: $first, where: $where) {\\n quoteId\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuotesFundingDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n',\n): typeof import(\"./graphql\").QuoteEventsForHistoryDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuoteEventsForQuotesByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuoteEventsForQuotesByTypeDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query SubgraphQuotes(\\n $where: Quote_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: Quote_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n quoteId\\n quoteStatus\\n partyA\\n partyB\\n symbolId\\n symbol\\n positionType\\n quantity\\n fillAmount\\n closedAmount\\n openedPrice\\n accumulatedPaidFunding\\n lastFundingPaymentTimestamp\\n userPaidFunding\\n userReceivedFunding\\n timestampSendQuote\\n timestampOpenPosition\\n timestampFullyClose\\n timestamp\\n blockNumber\\n }\\n }\\n\",\n): typeof import(\"./graphql\").SubgraphQuotesDocument;\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n"],"mappings":";;AA4BA,IAAM,IAAuB;CAC3B,owBACE;CACF,0yBACE;CACF,s4BACE;CACF,mrBACE;CACF,4fACE;CACF,qyBACE;CACF,u9CACE;CACF,qYACE;CACF,6LACE;CACF,2zCACE;CACF,sYACE;CACF,2tBACE;AACJ;AA2EA,SAAgB,EAAQ,GAAgB;CACtC,OAAQ,EAAkB,MAAW,CAAC;AACxC"}
1
+ {"version":3,"file":"gql.js","names":[],"sources":["../../../../../src/symmio-subgraph/types/generated/analytics/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from \"./graphql\";\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size\n */\ntype Documents = {\n \"\\n query BalanceChanges(\\n $accounts: [Bytes!]!\\n $typeIn: [String!]!\\n $isMarginTransferSideEffectIn: [Boolean!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n $startDate: BigInt!\\n $endDate: BigInt!\\n ) {\\n balanceChanges(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: {\\n account_in: $accounts\\n type_in: $typeIn\\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\\n timestamp_gte: $startDate\\n timestamp_lte: $endDate\\n }\\n ) {\\n id\\n type\\n amount\\n account\\n timestamp\\n transaction\\n isMarginTransferSideEffect\\n marginTransferType\\n }\\n }\\n\": typeof types.BalanceChangesDocument;\n \"\\n query FundingIndexCheckpoints(\\n $where: FundingIndexCheckpoint_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: FundingIndexCheckpoint_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n fundingIndexCheckpoints(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n symbolId\\n partyB\\n eventType\\n rawLongRate\\n rawShortRate\\n marketPrice\\n currentLongRate\\n currentShortRate\\n accumulatedLongRate\\n accumulatedShortRate\\n epochDuration\\n lastUpdatedEpoch\\n startEpoch\\n startEpochTimestamp\\n snapshotLongFee\\n snapshotShortFee\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\": typeof types.FundingIndexCheckpointsDocument;\n \"\\n query QuoteFundingSettlements(\\n $where: QuoteFundingSettlement_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: QuoteFundingSettlement_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteFundingSettlements(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n quoteId\\n partyA\\n partyB\\n symbolId\\n positionType\\n trigger\\n openAmount\\n signedAmount\\n paidByPartyA\\n receivedByPartyA\\n previousAccumulatedPaidFunding\\n newAccumulatedPaidFunding\\n fundingDeltaPerUnit\\n previousLastFundingPaymentTimestamp\\n newLastFundingPaymentTimestamp\\n previousPaidThroughEpoch\\n newPaidThroughEpoch\\n balanceChanged\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\": typeof types.QuoteFundingSettlementsDocument;\n \"\\n query LiquidationDetails(\\n $where: LiquidationDetail_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: LiquidationDetail_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n partyA\\n liquidationId\\n liquidationType\\n liquidationTimestamp\\n timestamp\\n lockedCva\\n lockedLf\\n lockedPartyAmm\\n paidCva\\n paidLf\\n upnl\\n deficit\\n liquidationFee\\n settled\\n fullyLiquidated\\n settlementExpectedAmounts\\n settlementActualAmounts\\n }\\n }\\n\": typeof types.LiquidationDetailsDocument;\n \"\\n query MarginTransfers(\\n $where: MarginTransfer_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: MarginTransfer_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n amount\\n source\\n timestamp\\n blockNumber\\n transaction\\n virtualAccount {\\n id\\n }\\n subAccount {\\n id\\n }\\n }\\n }\\n\": typeof types.MarginTransfersDocument;\n \"\\n query PoolQuotes(\\n $symbolId: BigInt!\\n $source: Bytes!\\n $quoteStatuses: [Int!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\\n ) {\\n id\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n quantity\\n closedAmount\\n quantityToClose\\n openedPrice\\n requestedOpenPrice\\n averageClosedPrice\\n closePrice\\n initialOpenedPrice\\n liquidateAmount\\n liquidatePrice\\n timestamp\\n blockNumber\\n timestampSendQuote\\n timestampOpenPosition\\n subAccount {\\n id\\n owner\\n }\\n closedPrice\\n marketPrice\\n tradingFee\\n closeFee\\n leverage\\n initialCva\\n initialPartyAmm\\n initialLf\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\": typeof types.PoolQuotesDocument;\n '\\n query PoolQuoteEvents(\\n $typeIn: [String!]!\\n $symbolId: BigInt!\\n $source: Bytes!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\\n ) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n id\\n timestamp\\n blockNumber\\n userPaidFunding\\n userReceivedFunding\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n': typeof types.PoolQuoteEventsDocument;\n \"\\n query QuoteEventsForQuoteByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\": typeof types.QuoteEventsForQuoteByTypeDocument;\n \"\\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\\n quotes(first: $first, where: $where) {\\n quoteId\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\": typeof types.QuotesFundingDocument;\n '\\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n': typeof types.QuoteEventsForHistoryDocument;\n \"\\n query QuoteEventsForQuotesByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\": typeof types.QuoteEventsForQuotesByTypeDocument;\n \"\\n query SubgraphQuotes(\\n $where: Quote_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: Quote_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n quoteId\\n quoteStatus\\n partyA\\n partyB\\n symbolId\\n symbol\\n positionType\\n quantity\\n fillAmount\\n closedAmount\\n openedPrice\\n accumulatedPaidFunding\\n lastFundingPaymentTimestamp\\n userPaidFunding\\n userReceivedFunding\\n timestampSendQuote\\n timestampOpenPosition\\n timestampFullyClose\\n timestamp\\n blockNumber\\n }\\n }\\n\": typeof types.SubgraphQuotesDocument;\n};\nconst documents: Documents = {\n \"\\n query BalanceChanges(\\n $accounts: [Bytes!]!\\n $typeIn: [String!]!\\n $isMarginTransferSideEffectIn: [Boolean!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n $startDate: BigInt!\\n $endDate: BigInt!\\n ) {\\n balanceChanges(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: {\\n account_in: $accounts\\n type_in: $typeIn\\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\\n timestamp_gte: $startDate\\n timestamp_lte: $endDate\\n }\\n ) {\\n id\\n type\\n amount\\n account\\n timestamp\\n transaction\\n isMarginTransferSideEffect\\n marginTransferType\\n }\\n }\\n\":\n types.BalanceChangesDocument,\n \"\\n query FundingIndexCheckpoints(\\n $where: FundingIndexCheckpoint_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: FundingIndexCheckpoint_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n fundingIndexCheckpoints(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n symbolId\\n partyB\\n eventType\\n rawLongRate\\n rawShortRate\\n marketPrice\\n currentLongRate\\n currentShortRate\\n accumulatedLongRate\\n accumulatedShortRate\\n epochDuration\\n lastUpdatedEpoch\\n startEpoch\\n startEpochTimestamp\\n snapshotLongFee\\n snapshotShortFee\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\":\n types.FundingIndexCheckpointsDocument,\n \"\\n query QuoteFundingSettlements(\\n $where: QuoteFundingSettlement_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: QuoteFundingSettlement_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteFundingSettlements(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n quoteId\\n partyA\\n partyB\\n symbolId\\n positionType\\n trigger\\n openAmount\\n signedAmount\\n paidByPartyA\\n receivedByPartyA\\n previousAccumulatedPaidFunding\\n newAccumulatedPaidFunding\\n fundingDeltaPerUnit\\n previousLastFundingPaymentTimestamp\\n newLastFundingPaymentTimestamp\\n previousPaidThroughEpoch\\n newPaidThroughEpoch\\n balanceChanged\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\":\n types.QuoteFundingSettlementsDocument,\n \"\\n query LiquidationDetails(\\n $where: LiquidationDetail_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: LiquidationDetail_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n partyA\\n liquidationId\\n liquidationType\\n liquidationTimestamp\\n timestamp\\n lockedCva\\n lockedLf\\n lockedPartyAmm\\n paidCva\\n paidLf\\n upnl\\n deficit\\n liquidationFee\\n settled\\n fullyLiquidated\\n settlementExpectedAmounts\\n settlementActualAmounts\\n }\\n }\\n\":\n types.LiquidationDetailsDocument,\n \"\\n query MarginTransfers(\\n $where: MarginTransfer_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: MarginTransfer_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n amount\\n source\\n timestamp\\n blockNumber\\n transaction\\n virtualAccount {\\n id\\n }\\n subAccount {\\n id\\n }\\n }\\n }\\n\":\n types.MarginTransfersDocument,\n \"\\n query PoolQuotes(\\n $symbolId: BigInt!\\n $source: Bytes!\\n $quoteStatuses: [Int!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\\n ) {\\n id\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n quantity\\n closedAmount\\n quantityToClose\\n openedPrice\\n requestedOpenPrice\\n averageClosedPrice\\n closePrice\\n initialOpenedPrice\\n liquidateAmount\\n liquidatePrice\\n timestamp\\n blockNumber\\n timestampSendQuote\\n timestampOpenPosition\\n subAccount {\\n id\\n owner\\n }\\n closedPrice\\n marketPrice\\n tradingFee\\n closeFee\\n leverage\\n initialCva\\n initialPartyAmm\\n initialLf\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\":\n types.PoolQuotesDocument,\n '\\n query PoolQuoteEvents(\\n $typeIn: [String!]!\\n $symbolId: BigInt!\\n $source: Bytes!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\\n ) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n id\\n timestamp\\n blockNumber\\n userPaidFunding\\n userReceivedFunding\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n':\n types.PoolQuoteEventsDocument,\n \"\\n query QuoteEventsForQuoteByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\":\n types.QuoteEventsForQuoteByTypeDocument,\n \"\\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\\n quotes(first: $first, where: $where) {\\n quoteId\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\":\n types.QuotesFundingDocument,\n '\\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n':\n types.QuoteEventsForHistoryDocument,\n \"\\n query QuoteEventsForQuotesByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\":\n types.QuoteEventsForQuotesByTypeDocument,\n \"\\n query SubgraphQuotes(\\n $where: Quote_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: Quote_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n quoteId\\n quoteStatus\\n partyA\\n partyB\\n symbolId\\n symbol\\n positionType\\n quantity\\n fillAmount\\n closedAmount\\n openedPrice\\n accumulatedPaidFunding\\n lastFundingPaymentTimestamp\\n userPaidFunding\\n userReceivedFunding\\n timestampSendQuote\\n timestampOpenPosition\\n timestampFullyClose\\n timestamp\\n blockNumber\\n }\\n }\\n\":\n types.SubgraphQuotesDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query BalanceChanges(\\n $accounts: [Bytes!]!\\n $typeIn: [String!]!\\n $isMarginTransferSideEffectIn: [Boolean!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n $startDate: BigInt!\\n $endDate: BigInt!\\n ) {\\n balanceChanges(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: {\\n account_in: $accounts\\n type_in: $typeIn\\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\\n timestamp_gte: $startDate\\n timestamp_lte: $endDate\\n }\\n ) {\\n id\\n type\\n amount\\n account\\n timestamp\\n transaction\\n isMarginTransferSideEffect\\n marginTransferType\\n }\\n }\\n\",\n): typeof import(\"./graphql\").BalanceChangesDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query FundingIndexCheckpoints(\\n $where: FundingIndexCheckpoint_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: FundingIndexCheckpoint_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n fundingIndexCheckpoints(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n symbolId\\n partyB\\n eventType\\n rawLongRate\\n rawShortRate\\n marketPrice\\n currentLongRate\\n currentShortRate\\n accumulatedLongRate\\n accumulatedShortRate\\n epochDuration\\n lastUpdatedEpoch\\n startEpoch\\n startEpochTimestamp\\n snapshotLongFee\\n snapshotShortFee\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\",\n): typeof import(\"./graphql\").FundingIndexCheckpointsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuoteFundingSettlements(\\n $where: QuoteFundingSettlement_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: QuoteFundingSettlement_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteFundingSettlements(\\n first: $first\\n skip: $skip\\n orderBy: $orderBy\\n orderDirection: $orderDirection\\n where: $where\\n ) {\\n id\\n source\\n quoteId\\n partyA\\n partyB\\n symbolId\\n positionType\\n trigger\\n openAmount\\n signedAmount\\n paidByPartyA\\n receivedByPartyA\\n previousAccumulatedPaidFunding\\n newAccumulatedPaidFunding\\n fundingDeltaPerUnit\\n previousLastFundingPaymentTimestamp\\n newLastFundingPaymentTimestamp\\n previousPaidThroughEpoch\\n newPaidThroughEpoch\\n balanceChanged\\n timestamp\\n blockNumber\\n transaction\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuoteFundingSettlementsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query LiquidationDetails(\\n $where: LiquidationDetail_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: LiquidationDetail_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n partyA\\n liquidationId\\n liquidationType\\n liquidationTimestamp\\n timestamp\\n lockedCva\\n lockedLf\\n lockedPartyAmm\\n paidCva\\n paidLf\\n upnl\\n deficit\\n liquidationFee\\n settled\\n fullyLiquidated\\n settlementExpectedAmounts\\n settlementActualAmounts\\n }\\n }\\n\",\n): typeof import(\"./graphql\").LiquidationDetailsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query MarginTransfers(\\n $where: MarginTransfer_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: MarginTransfer_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n amount\\n source\\n timestamp\\n blockNumber\\n transaction\\n virtualAccount {\\n id\\n }\\n subAccount {\\n id\\n }\\n }\\n }\\n\",\n): typeof import(\"./graphql\").MarginTransfersDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query PoolQuotes(\\n $symbolId: BigInt!\\n $source: Bytes!\\n $quoteStatuses: [Int!]!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\\n ) {\\n id\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n quantity\\n closedAmount\\n quantityToClose\\n openedPrice\\n requestedOpenPrice\\n averageClosedPrice\\n closePrice\\n initialOpenedPrice\\n liquidateAmount\\n liquidatePrice\\n timestamp\\n blockNumber\\n timestampSendQuote\\n timestampOpenPosition\\n subAccount {\\n id\\n owner\\n }\\n closedPrice\\n marketPrice\\n tradingFee\\n closeFee\\n leverage\\n initialCva\\n initialPartyAmm\\n initialLf\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\",\n): typeof import(\"./graphql\").PoolQuotesDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query PoolQuoteEvents(\\n $typeIn: [String!]!\\n $symbolId: BigInt!\\n $source: Bytes!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(\\n first: $first\\n skip: $skip\\n orderBy: timestamp\\n orderDirection: $orderDirection\\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\\n ) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n id\\n timestamp\\n blockNumber\\n userPaidFunding\\n userReceivedFunding\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n',\n): typeof import(\"./graphql\").PoolQuoteEventsDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuoteEventsForQuoteByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuoteEventsForQuoteByTypeDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\\n quotes(first: $first, where: $where) {\\n quoteId\\n userPaidFunding\\n userReceivedFunding\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuotesFundingDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n quoteId\\n blockNumber\\n transaction\\n source\\n quote {\\n quoteId\\n quoteStatus\\n positionType\\n orderTypeOpen\\n symbol\\n symbolId\\n partyA\\n partyB\\n subAccount {\\n id\\n owner\\n }\\n quantity\\n openedPrice\\n initialOpenedPrice\\n requestedOpenPrice\\n marketPrice\\n averageClosedPrice\\n closePrice\\n closedPrice\\n closedAmount\\n quantityToClose\\n liquidateAmount\\n liquidatePrice\\n tradingFee\\n closeFee\\n leverage\\n cva\\n lf\\n initialCva\\n initialLf\\n initialPartyAmm\\n timestampSendQuote\\n timestampOpenPosition\\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\\n transaction\\n }\\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\\n metadata\\n }\\n }\\n }\\n }\\n',\n): typeof import(\"./graphql\").QuoteEventsForHistoryDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query QuoteEventsForQuotesByType(\\n $where: QuoteEvent_filter!\\n $first: Int!\\n $skip: Int!\\n $orderDirection: OrderDirection!\\n ) {\\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\\n id\\n type\\n metadata\\n timestamp\\n blockNumber\\n transaction\\n quoteId\\n }\\n }\\n\",\n): typeof import(\"./graphql\").QuoteEventsForQuotesByTypeDocument;\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: \"\\n query SubgraphQuotes(\\n $where: Quote_filter!\\n $first: Int!\\n $skip: Int!\\n $orderBy: Quote_orderBy!\\n $orderDirection: OrderDirection!\\n ) {\\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\\n id\\n source\\n quoteId\\n quoteStatus\\n partyA\\n partyB\\n symbolId\\n symbol\\n positionType\\n quantity\\n fillAmount\\n closedAmount\\n openedPrice\\n accumulatedPaidFunding\\n lastFundingPaymentTimestamp\\n userPaidFunding\\n userReceivedFunding\\n timestampSendQuote\\n timestampOpenPosition\\n timestampFullyClose\\n timestamp\\n blockNumber\\n }\\n }\\n\",\n): typeof import(\"./graphql\").SubgraphQuotesDocument;\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n"],"mappings":";;AA4BA,IAAM,IAAuB;CAC3B,owBACE;CACF,0yBACE;CACF,s4BACE;CACF,mrBACE;CACF,4fACE;CACF,wlCACE;CACF,ikDACE;CACF,qYACE;CACF,6LACE;CACF,2zCACE;CACF,sYACE;CACF,2tBACE;AACJ;AA2EA,SAAgB,EAAQ,GAAgB;CACtC,OAAQ,EAAkB,MAAW,CAAC;AACxC"}
@@ -3620,6 +3620,22 @@ export type PoolQuotesQuery = {
3620
3620
  liquidatePrice: string | null;
3621
3621
  timestamp: string;
3622
3622
  blockNumber: string;
3623
+ timestampSendQuote: string | null;
3624
+ timestampOpenPosition: string | null;
3625
+ closedPrice: string | null;
3626
+ marketPrice: string | null;
3627
+ tradingFee: string;
3628
+ closeFee: string;
3629
+ leverage: string | null;
3630
+ initialCva: string;
3631
+ initialPartyAmm: string | null;
3632
+ initialLf: string;
3633
+ userPaidFunding: string | null;
3634
+ userReceivedFunding: string | null;
3635
+ subAccount: {
3636
+ id: string;
3637
+ owner: string;
3638
+ } | null;
3623
3639
  }>;
3624
3640
  };
3625
3641
  export type PoolQuoteEventsQueryVariables = Exact<{
@@ -3641,6 +3657,11 @@ export type PoolQuoteEventsQuery = {
3641
3657
  transaction: string;
3642
3658
  source: string;
3643
3659
  quote: {
3660
+ id: string;
3661
+ timestamp: string;
3662
+ blockNumber: string;
3663
+ userPaidFunding: string | null;
3664
+ userReceivedFunding: string | null;
3644
3665
  quoteId: string;
3645
3666
  quoteStatus: number | null;
3646
3667
  positionType: number | null;