@gmx-io/sdk 1.6.3 → 1.6.4

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 (247) hide show
  1. package/README.md +1 -1
  2. package/build/cjs/scripts/generate-synthetics-abis.js +181 -0
  3. package/build/cjs/scripts/subsquid-codegen.js +1 -1
  4. package/build/cjs/src/abis/AbstractSubaccountApprovalNonceable.js +23 -0
  5. package/build/cjs/src/abis/CustomErrors.js +198 -88
  6. package/build/cjs/src/abis/ExchangeRouter.js +155 -272
  7. package/build/cjs/src/abis/GelatoRelayRouter.js +331 -0
  8. package/build/cjs/src/abis/SimulationRouter.js +583 -0
  9. package/build/cjs/src/abis/SubaccountGelatoRelayRouter.js +393 -0
  10. package/build/cjs/src/abis/SyntheticsReader.js +40 -0
  11. package/build/cjs/src/abis/index.js +4 -24
  12. package/build/cjs/src/clients/v1/modules/markets/index.js +10 -6
  13. package/build/cjs/src/clients/v1/modules/orders/utils.js +1 -0
  14. package/build/cjs/src/clients/v1/modules/orders/utils.spec.js +66 -0
  15. package/build/cjs/src/clients/v1/modules/positions/positions.js +2 -10
  16. package/build/cjs/src/clients/v1/modules/positions/positions.spec.js +1 -1
  17. package/build/cjs/src/clients/v1/modules/trades/trades.js +5 -1
  18. package/build/cjs/src/clients/v1/simulateExecuteOrder.js +33 -54
  19. package/build/cjs/src/clients/v1/testUtil.js +1 -1
  20. package/build/cjs/src/clients/v2/__tests__/editCancel.spec.js +3 -1
  21. package/build/cjs/src/clients/v2/__tests__/increase.spec.js +8 -6
  22. package/build/cjs/src/clients/v2/index.js +6 -0
  23. package/build/cjs/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +0 -26
  24. package/build/cjs/src/codegen/prebuilt/hashedMarketConfigKeys.json +1692 -561
  25. package/build/cjs/src/codegen/prebuilt/hashedMarketValuesKeys.json +0 -47
  26. package/build/cjs/src/codegen/subsquid.js +101 -2
  27. package/build/cjs/src/configs/__tests__/tokens.spec.js +0 -1
  28. package/build/cjs/src/configs/api.js +0 -4
  29. package/build/cjs/src/configs/batch.js +0 -1
  30. package/build/cjs/src/configs/chainIds.js +1 -2
  31. package/build/cjs/src/configs/chains.js +2 -57
  32. package/build/cjs/src/configs/contracts.js +77 -133
  33. package/build/cjs/src/configs/dataStore.js +23 -8
  34. package/build/cjs/src/configs/express.js +0 -2
  35. package/build/cjs/src/configs/gasLimits.js +0 -7
  36. package/build/cjs/src/configs/markets.js +0 -23
  37. package/build/cjs/src/configs/multichainTokens.js +1 -1
  38. package/build/cjs/src/configs/oracleKeeper.js +0 -2
  39. package/build/cjs/src/configs/tokens.js +2 -104
  40. package/build/cjs/src/test/fixtures/arbitrumMarkets.json +1210 -0
  41. package/build/cjs/src/test/fixtures/arbitrumTickers.json +1002 -0
  42. package/build/cjs/src/test/fixtures/arbitrumTokens.json +136 -0
  43. package/build/cjs/src/test/mockCrossFetch.js +28 -0
  44. package/build/cjs/src/utils/__tests__/fees.spec.js +264 -0
  45. package/build/cjs/src/utils/__tests__/marketsRisk.spec.js +80 -0
  46. package/build/cjs/src/utils/__tests__/numbers.spec.js +49 -0
  47. package/build/cjs/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +6 -25
  48. package/build/cjs/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +6 -25
  49. package/build/cjs/src/utils/__tests__/orderTransactions/swapOrders.spec.js +3 -13
  50. package/build/cjs/src/utils/__tests__/parseError.spec.js +23 -0
  51. package/build/cjs/src/utils/__tests__/uiFeeReceiver.spec.js +159 -58
  52. package/build/cjs/src/utils/errors/parseError.js +13 -1
  53. package/build/cjs/src/utils/errors/transactionsErrors.js +2 -0
  54. package/build/cjs/src/utils/express/utils/batchOrderUtils.js +1 -2
  55. package/build/cjs/src/utils/express/utils/estimateExpressParams.js +2 -0
  56. package/build/cjs/src/utils/express/utils/estimateExpressParams.spec.js +81 -0
  57. package/build/cjs/src/utils/express/utils/expressParamsUtils.js +5 -1
  58. package/build/cjs/src/utils/express/utils/expressParamsUtils.spec.js +27 -0
  59. package/build/cjs/src/utils/fees/executionFee.js +0 -1
  60. package/build/cjs/src/utils/fees/priceImpact.js +61 -20
  61. package/build/cjs/src/utils/http/validation.js +33 -0
  62. package/build/cjs/src/utils/markets/__tests__/api.spec.js +168 -0
  63. package/build/cjs/src/utils/markets/__tests__/mockMarkets.js +14 -5
  64. package/build/cjs/src/utils/markets/api.js +45 -3
  65. package/build/cjs/src/utils/markets/hashKeys.js +34 -6
  66. package/build/cjs/src/utils/markets/multicall.js +110 -11
  67. package/build/cjs/src/utils/markets/types.js +23 -0
  68. package/build/cjs/src/utils/markets/utils.js +15 -1
  69. package/build/cjs/src/utils/numbers/utils.js +26 -5
  70. package/build/cjs/src/utils/orderTransactions/simulation.js +13 -0
  71. package/build/cjs/src/utils/orderTransactions/utils.js +21 -8
  72. package/build/cjs/src/utils/positions/__tests__/api.spec.js +50 -0
  73. package/build/cjs/src/utils/positions/api.js +7 -1
  74. package/build/cjs/src/utils/positions/utils.js +7 -1
  75. package/build/cjs/src/utils/prices/utils.js +2 -0
  76. package/build/cjs/src/utils/subaccount/sdkClient.js +0 -1
  77. package/build/cjs/src/utils/swap/buildSwapStrategy.js +6 -123
  78. package/build/cjs/src/utils/swap/index.js +0 -3
  79. package/build/cjs/src/utils/swap/swapValues.js +0 -67
  80. package/build/cjs/src/utils/tokens/utils.js +9 -10
  81. package/build/cjs/src/utils/trade/__tests__/getMaxWithdrawAmount.spec.js +44 -0
  82. package/build/cjs/src/utils/trade/decrease.js +47 -23
  83. package/build/cjs/src/utils/trade/increase.js +22 -6
  84. package/build/cjs/src/utils/trade/types.js +0 -1
  85. package/build/cjs/src/utils/tradeHistory/types.js +3 -1
  86. package/build/cjs/src/utils/tradeHistory/utils.js +7 -0
  87. package/build/cjs/src/utils/twap/uiFeeReceiver.js +134 -47
  88. package/build/esm/scripts/generate-synthetics-abis.js +153 -0
  89. package/build/esm/scripts/subsquid-codegen.js +1 -1
  90. package/build/esm/src/abis/AbstractSubaccountApprovalNonceable.js +21 -0
  91. package/build/esm/src/abis/CustomErrors.js +198 -88
  92. package/build/esm/src/abis/ExchangeRouter.js +155 -272
  93. package/build/esm/src/abis/GelatoRelayRouter.js +331 -0
  94. package/build/esm/src/abis/SimulationRouter.js +581 -0
  95. package/build/esm/src/abis/SubaccountGelatoRelayRouter.js +393 -0
  96. package/build/esm/src/abis/SyntheticsReader.js +40 -0
  97. package/build/esm/src/abis/index.js +3 -23
  98. package/build/esm/src/clients/v1/modules/markets/index.js +10 -6
  99. package/build/esm/src/clients/v1/modules/orders/utils.js +1 -0
  100. package/build/esm/src/clients/v1/modules/orders/utils.spec.js +64 -0
  101. package/build/esm/src/clients/v1/modules/positions/positions.js +2 -10
  102. package/build/esm/src/clients/v1/modules/positions/positions.spec.js +1 -1
  103. package/build/esm/src/clients/v1/modules/trades/trades.js +5 -1
  104. package/build/esm/src/clients/v1/simulateExecuteOrder.js +35 -55
  105. package/build/esm/src/clients/v1/testUtil.js +1 -1
  106. package/build/esm/src/clients/v2/__tests__/editCancel.spec.js +3 -1
  107. package/build/esm/src/clients/v2/__tests__/increase.spec.js +8 -6
  108. package/build/esm/src/clients/v2/__tests__/swap.spec.js +1 -1
  109. package/build/esm/src/clients/v2/index.js +7 -1
  110. package/build/esm/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +0 -26
  111. package/build/esm/src/codegen/prebuilt/hashedMarketConfigKeys.json +1692 -561
  112. package/build/esm/src/codegen/prebuilt/hashedMarketValuesKeys.json +0 -47
  113. package/build/esm/src/codegen/subsquid.js +99 -0
  114. package/build/esm/src/configs/__tests__/multichainTokens.spec.js +1 -1
  115. package/build/esm/src/configs/__tests__/tokens.spec.js +1 -2
  116. package/build/esm/src/configs/api.js +1 -5
  117. package/build/esm/src/configs/batch.js +1 -2
  118. package/build/esm/src/configs/chainIds.js +0 -1
  119. package/build/esm/src/configs/chains.js +3 -57
  120. package/build/esm/src/configs/contracts.js +76 -133
  121. package/build/esm/src/configs/dataStore.js +16 -4
  122. package/build/esm/src/configs/express.js +1 -3
  123. package/build/esm/src/configs/gasLimits.js +1 -8
  124. package/build/esm/src/configs/markets.js +1 -24
  125. package/build/esm/src/configs/multichainTokens.js +1 -1
  126. package/build/esm/src/configs/oracleKeeper.js +1 -3
  127. package/build/esm/src/configs/tokens.js +3 -105
  128. package/build/esm/src/test/fixtures/arbitrumMarkets.json +1210 -0
  129. package/build/esm/src/test/fixtures/arbitrumTickers.json +1002 -0
  130. package/build/esm/src/test/fixtures/arbitrumTokens.json +136 -0
  131. package/build/esm/src/test/mockCrossFetch.js +23 -0
  132. package/build/esm/src/utils/__tests__/fees.spec.js +266 -2
  133. package/build/esm/src/utils/__tests__/marketsRisk.spec.js +78 -0
  134. package/build/esm/src/utils/__tests__/numbers.spec.js +50 -1
  135. package/build/esm/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +6 -25
  136. package/build/esm/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +6 -25
  137. package/build/esm/src/utils/__tests__/orderTransactions/swapOrders.spec.js +3 -13
  138. package/build/esm/src/utils/__tests__/parseError.spec.js +25 -2
  139. package/build/esm/src/utils/__tests__/uiFeeReceiver.spec.js +161 -60
  140. package/build/esm/src/utils/errors/parseError.js +12 -1
  141. package/build/esm/src/utils/errors/transactionsErrors.js +2 -0
  142. package/build/esm/src/utils/express/utils/batchOrderUtils.js +2 -3
  143. package/build/esm/src/utils/express/utils/estimateExpressParams.js +2 -0
  144. package/build/esm/src/utils/express/utils/estimateExpressParams.spec.js +79 -0
  145. package/build/esm/src/utils/express/utils/expressParamsUtils.js +3 -0
  146. package/build/esm/src/utils/express/utils/expressParamsUtils.spec.js +25 -0
  147. package/build/esm/src/utils/fees/executionFee.js +0 -1
  148. package/build/esm/src/utils/fees/priceImpact.js +54 -13
  149. package/build/esm/src/utils/http/validation.js +28 -0
  150. package/build/esm/src/utils/markets/__tests__/api.spec.js +166 -0
  151. package/build/esm/src/utils/markets/__tests__/mockMarkets.js +15 -6
  152. package/build/esm/src/utils/markets/api.js +42 -2
  153. package/build/esm/src/utils/markets/hashKeys.js +35 -7
  154. package/build/esm/src/utils/markets/multicall.js +108 -11
  155. package/build/esm/src/utils/markets/types.js +22 -1
  156. package/build/esm/src/utils/markets/utils.js +13 -0
  157. package/build/esm/src/utils/numbers/utils.js +21 -3
  158. package/build/esm/src/utils/orderTransactions/simulation.js +9 -0
  159. package/build/esm/src/utils/orderTransactions/utils.js +22 -9
  160. package/build/esm/src/utils/positions/__tests__/api.spec.js +48 -0
  161. package/build/esm/src/utils/positions/api.js +7 -1
  162. package/build/esm/src/utils/positions/utils.js +7 -1
  163. package/build/esm/src/utils/prices/utils.js +2 -0
  164. package/build/esm/src/utils/subaccount/sdkClient.js +0 -1
  165. package/build/esm/src/utils/swap/buildSwapStrategy.js +7 -124
  166. package/build/esm/src/utils/swap/index.js +0 -3
  167. package/build/esm/src/utils/swap/swapValues.js +1 -68
  168. package/build/esm/src/utils/tokens/utils.js +8 -8
  169. package/build/esm/src/utils/trade/__tests__/getMaxWithdrawAmount.spec.js +45 -1
  170. package/build/esm/src/utils/trade/decrease.js +44 -22
  171. package/build/esm/src/utils/trade/increase.js +23 -7
  172. package/build/esm/src/utils/trade/types.js +0 -1
  173. package/build/esm/src/utils/tradeHistory/types.js +2 -0
  174. package/build/esm/src/utils/tradeHistory/utils.js +7 -0
  175. package/build/esm/src/utils/twap/uiFeeReceiver.js +127 -42
  176. package/build/tsconfig.tsbuildinfo +1 -1
  177. package/build/types/scripts/generate-synthetics-abis.d.ts +17 -0
  178. package/build/types/src/abis/AbstractSubaccountApprovalNonceable.d.ts +16 -0
  179. package/build/types/src/abis/CustomErrors.d.ts +331 -139
  180. package/build/types/src/abis/ExchangeRouter.d.ts +121 -209
  181. package/build/types/src/abis/GelatoRelayRouter.d.ts +258 -0
  182. package/build/types/src/abis/SimulationRouter.d.ts +448 -0
  183. package/build/types/src/abis/SubaccountGelatoRelayRouter.d.ts +307 -0
  184. package/build/types/src/abis/SyntheticsReader.d.ts +32 -0
  185. package/build/types/src/abis/index.d.ts +8108 -7891
  186. package/build/types/src/clients/v1/index.d.ts +1 -1
  187. package/build/types/src/clients/v1/modules/base.d.ts +1 -1
  188. package/build/types/src/clients/v1/modules/orders/utils.spec.d.ts +1 -0
  189. package/build/types/src/clients/v1/multicall.d.ts +1 -1
  190. package/build/types/src/clients/v1/simulateExecuteOrder.d.ts +0 -1
  191. package/build/types/src/clients/v2/index.d.ts +2 -0
  192. package/build/types/src/codegen/prebuilt/index.d.ts +1692 -634
  193. package/build/types/src/codegen/subsquid.d.ts +368 -0
  194. package/build/types/src/configs/chainIds.d.ts +0 -1
  195. package/build/types/src/configs/chains.d.ts +9 -34
  196. package/build/types/src/configs/contracts.d.ts +5 -66
  197. package/build/types/src/configs/dataStore.d.ts +8 -2
  198. package/build/types/src/configs/multichainTokens.d.ts +1 -1
  199. package/build/types/src/test/mockCrossFetch.d.ts +2 -0
  200. package/build/types/src/utils/__tests__/marketsRisk.spec.d.ts +1 -0
  201. package/build/types/src/utils/errors/parseError.d.ts +1 -0
  202. package/build/types/src/utils/errors/transactionsErrors.d.ts +2 -0
  203. package/build/types/src/utils/express/types.d.ts +2 -1
  204. package/build/types/src/utils/express/utils/batchOrderUtils.d.ts +1 -1
  205. package/build/types/src/utils/express/utils/estimateExpressParams.spec.d.ts +1 -0
  206. package/build/types/src/utils/express/utils/expressParamsUtils.d.ts +1 -0
  207. package/build/types/src/utils/express/utils/expressParamsUtils.spec.d.ts +1 -0
  208. package/build/types/src/utils/express/utils/globalExpressParams.d.ts +1 -1
  209. package/build/types/src/utils/fees/priceImpact.d.ts +2 -0
  210. package/build/types/src/utils/http/validation.d.ts +7 -0
  211. package/build/types/src/utils/markets/__tests__/api.spec.d.ts +1 -0
  212. package/build/types/src/utils/markets/api.d.ts +7 -1
  213. package/build/types/src/utils/markets/hashKeys.d.ts +1 -1
  214. package/build/types/src/utils/markets/multicall.d.ts +13 -2
  215. package/build/types/src/utils/markets/types.d.ts +18 -4
  216. package/build/types/src/utils/markets/utils.d.ts +2 -1
  217. package/build/types/src/utils/numbers/utils.d.ts +5 -1
  218. package/build/types/src/utils/orderTransactions/simulation.d.ts +1 -0
  219. package/build/types/src/utils/orders/types.d.ts +2 -0
  220. package/build/types/src/utils/positions/__tests__/api.spec.d.ts +1 -0
  221. package/build/types/src/utils/positions/types.d.ts +1 -0
  222. package/build/types/src/utils/positions/utils.d.ts +1 -0
  223. package/build/types/src/utils/prices/utils.d.ts +1 -0
  224. package/build/types/src/utils/swap/buildSwapStrategy.d.ts +3 -5
  225. package/build/types/src/utils/swap/index.d.ts +0 -3
  226. package/build/types/src/utils/swap/swapValues.d.ts +1 -1
  227. package/build/types/src/utils/swap/types.d.ts +2 -7
  228. package/build/types/src/utils/tokens/types.d.ts +0 -1
  229. package/build/types/src/utils/tokens/utils.d.ts +1 -2
  230. package/build/types/src/utils/trade/decrease.d.ts +11 -0
  231. package/build/types/src/utils/trade/types.d.ts +2 -8
  232. package/build/types/src/utils/tradeHistory/types.d.ts +7 -0
  233. package/build/types/src/utils/twap/types.d.ts +1 -1
  234. package/build/types/src/utils/twap/uiFeeReceiver.d.ts +23 -22
  235. package/package.json +10 -7
  236. package/build/cjs/src/abis/StBTC.js +0 -513
  237. package/build/cjs/src/utils/swap/botanixStaking.js +0 -90
  238. package/build/cjs/src/utils/swap/externalSwapPath.js +0 -41
  239. package/build/cjs/src/utils/swap/externalSwapQuoteByPath.js +0 -27
  240. package/build/esm/src/abis/StBTC.js +0 -511
  241. package/build/esm/src/utils/swap/botanixStaking.js +0 -83
  242. package/build/esm/src/utils/swap/externalSwapPath.js +0 -37
  243. package/build/esm/src/utils/swap/externalSwapQuoteByPath.js +0 -23
  244. package/build/types/src/abis/StBTC.d.ts +0 -932
  245. package/build/types/src/utils/swap/botanixStaking.d.ts +0 -11
  246. package/build/types/src/utils/swap/externalSwapPath.d.ts +0 -13
  247. package/build/types/src/utils/swap/externalSwapQuoteByPath.d.ts +0 -6
@@ -81,14 +81,224 @@ export interface AccountPnlHistoryPointObject {
81
81
  /** Field for debug */
82
82
  unrealizedPnl: Scalars["BigInt"]["output"];
83
83
  }
84
+ export interface AccountPnlRankMetric {
85
+ __typename?: "AccountPnlRankMetric";
86
+ account: Scalars["String"]["output"];
87
+ fromTimestamp: Scalars["Int"]["output"];
88
+ id: Scalars["String"]["output"];
89
+ maxCapital: Scalars["BigInt"]["output"];
90
+ period: Scalars["String"]["output"];
91
+ pnlBps: Scalars["BigInt"]["output"];
92
+ pnlUsd: Scalars["BigInt"]["output"];
93
+ updatedAt: Scalars["Int"]["output"];
94
+ volume: Scalars["BigInt"]["output"];
95
+ }
96
+ export interface AccountPnlRankMetricEdge {
97
+ __typename?: "AccountPnlRankMetricEdge";
98
+ cursor: Scalars["String"]["output"];
99
+ node: AccountPnlRankMetric;
100
+ }
101
+ export declare enum AccountPnlRankMetricOrderByInput {
102
+ account_ASC = "account_ASC",
103
+ account_ASC_NULLS_FIRST = "account_ASC_NULLS_FIRST",
104
+ account_ASC_NULLS_LAST = "account_ASC_NULLS_LAST",
105
+ account_DESC = "account_DESC",
106
+ account_DESC_NULLS_FIRST = "account_DESC_NULLS_FIRST",
107
+ account_DESC_NULLS_LAST = "account_DESC_NULLS_LAST",
108
+ fromTimestamp_ASC = "fromTimestamp_ASC",
109
+ fromTimestamp_ASC_NULLS_FIRST = "fromTimestamp_ASC_NULLS_FIRST",
110
+ fromTimestamp_ASC_NULLS_LAST = "fromTimestamp_ASC_NULLS_LAST",
111
+ fromTimestamp_DESC = "fromTimestamp_DESC",
112
+ fromTimestamp_DESC_NULLS_FIRST = "fromTimestamp_DESC_NULLS_FIRST",
113
+ fromTimestamp_DESC_NULLS_LAST = "fromTimestamp_DESC_NULLS_LAST",
114
+ id_ASC = "id_ASC",
115
+ id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST",
116
+ id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST",
117
+ id_DESC = "id_DESC",
118
+ id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST",
119
+ id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST",
120
+ maxCapital_ASC = "maxCapital_ASC",
121
+ maxCapital_ASC_NULLS_FIRST = "maxCapital_ASC_NULLS_FIRST",
122
+ maxCapital_ASC_NULLS_LAST = "maxCapital_ASC_NULLS_LAST",
123
+ maxCapital_DESC = "maxCapital_DESC",
124
+ maxCapital_DESC_NULLS_FIRST = "maxCapital_DESC_NULLS_FIRST",
125
+ maxCapital_DESC_NULLS_LAST = "maxCapital_DESC_NULLS_LAST",
126
+ period_ASC = "period_ASC",
127
+ period_ASC_NULLS_FIRST = "period_ASC_NULLS_FIRST",
128
+ period_ASC_NULLS_LAST = "period_ASC_NULLS_LAST",
129
+ period_DESC = "period_DESC",
130
+ period_DESC_NULLS_FIRST = "period_DESC_NULLS_FIRST",
131
+ period_DESC_NULLS_LAST = "period_DESC_NULLS_LAST",
132
+ pnlBps_ASC = "pnlBps_ASC",
133
+ pnlBps_ASC_NULLS_FIRST = "pnlBps_ASC_NULLS_FIRST",
134
+ pnlBps_ASC_NULLS_LAST = "pnlBps_ASC_NULLS_LAST",
135
+ pnlBps_DESC = "pnlBps_DESC",
136
+ pnlBps_DESC_NULLS_FIRST = "pnlBps_DESC_NULLS_FIRST",
137
+ pnlBps_DESC_NULLS_LAST = "pnlBps_DESC_NULLS_LAST",
138
+ pnlUsd_ASC = "pnlUsd_ASC",
139
+ pnlUsd_ASC_NULLS_FIRST = "pnlUsd_ASC_NULLS_FIRST",
140
+ pnlUsd_ASC_NULLS_LAST = "pnlUsd_ASC_NULLS_LAST",
141
+ pnlUsd_DESC = "pnlUsd_DESC",
142
+ pnlUsd_DESC_NULLS_FIRST = "pnlUsd_DESC_NULLS_FIRST",
143
+ pnlUsd_DESC_NULLS_LAST = "pnlUsd_DESC_NULLS_LAST",
144
+ updatedAt_ASC = "updatedAt_ASC",
145
+ updatedAt_ASC_NULLS_FIRST = "updatedAt_ASC_NULLS_FIRST",
146
+ updatedAt_ASC_NULLS_LAST = "updatedAt_ASC_NULLS_LAST",
147
+ updatedAt_DESC = "updatedAt_DESC",
148
+ updatedAt_DESC_NULLS_FIRST = "updatedAt_DESC_NULLS_FIRST",
149
+ updatedAt_DESC_NULLS_LAST = "updatedAt_DESC_NULLS_LAST",
150
+ volume_ASC = "volume_ASC",
151
+ volume_ASC_NULLS_FIRST = "volume_ASC_NULLS_FIRST",
152
+ volume_ASC_NULLS_LAST = "volume_ASC_NULLS_LAST",
153
+ volume_DESC = "volume_DESC",
154
+ volume_DESC_NULLS_FIRST = "volume_DESC_NULLS_FIRST",
155
+ volume_DESC_NULLS_LAST = "volume_DESC_NULLS_LAST"
156
+ }
157
+ export interface AccountPnlRankMetricWhereInput {
158
+ AND?: InputMaybe<Array<AccountPnlRankMetricWhereInput>>;
159
+ OR?: InputMaybe<Array<AccountPnlRankMetricWhereInput>>;
160
+ account_contains?: InputMaybe<Scalars["String"]["input"]>;
161
+ account_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
162
+ account_endsWith?: InputMaybe<Scalars["String"]["input"]>;
163
+ account_eq?: InputMaybe<Scalars["String"]["input"]>;
164
+ account_gt?: InputMaybe<Scalars["String"]["input"]>;
165
+ account_gte?: InputMaybe<Scalars["String"]["input"]>;
166
+ account_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
167
+ account_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
168
+ account_lt?: InputMaybe<Scalars["String"]["input"]>;
169
+ account_lte?: InputMaybe<Scalars["String"]["input"]>;
170
+ account_not_contains?: InputMaybe<Scalars["String"]["input"]>;
171
+ account_not_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
172
+ account_not_endsWith?: InputMaybe<Scalars["String"]["input"]>;
173
+ account_not_eq?: InputMaybe<Scalars["String"]["input"]>;
174
+ account_not_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
175
+ account_not_startsWith?: InputMaybe<Scalars["String"]["input"]>;
176
+ account_startsWith?: InputMaybe<Scalars["String"]["input"]>;
177
+ fromTimestamp_eq?: InputMaybe<Scalars["Int"]["input"]>;
178
+ fromTimestamp_gt?: InputMaybe<Scalars["Int"]["input"]>;
179
+ fromTimestamp_gte?: InputMaybe<Scalars["Int"]["input"]>;
180
+ fromTimestamp_in?: InputMaybe<Array<Scalars["Int"]["input"]>>;
181
+ fromTimestamp_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
182
+ fromTimestamp_lt?: InputMaybe<Scalars["Int"]["input"]>;
183
+ fromTimestamp_lte?: InputMaybe<Scalars["Int"]["input"]>;
184
+ fromTimestamp_not_eq?: InputMaybe<Scalars["Int"]["input"]>;
185
+ fromTimestamp_not_in?: InputMaybe<Array<Scalars["Int"]["input"]>>;
186
+ id_contains?: InputMaybe<Scalars["String"]["input"]>;
187
+ id_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
188
+ id_endsWith?: InputMaybe<Scalars["String"]["input"]>;
189
+ id_eq?: InputMaybe<Scalars["String"]["input"]>;
190
+ id_gt?: InputMaybe<Scalars["String"]["input"]>;
191
+ id_gte?: InputMaybe<Scalars["String"]["input"]>;
192
+ id_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
193
+ id_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
194
+ id_lt?: InputMaybe<Scalars["String"]["input"]>;
195
+ id_lte?: InputMaybe<Scalars["String"]["input"]>;
196
+ id_not_contains?: InputMaybe<Scalars["String"]["input"]>;
197
+ id_not_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
198
+ id_not_endsWith?: InputMaybe<Scalars["String"]["input"]>;
199
+ id_not_eq?: InputMaybe<Scalars["String"]["input"]>;
200
+ id_not_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
201
+ id_not_startsWith?: InputMaybe<Scalars["String"]["input"]>;
202
+ id_startsWith?: InputMaybe<Scalars["String"]["input"]>;
203
+ maxCapital_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
204
+ maxCapital_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
205
+ maxCapital_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
206
+ maxCapital_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
207
+ maxCapital_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
208
+ maxCapital_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
209
+ maxCapital_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
210
+ maxCapital_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
211
+ maxCapital_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
212
+ period_contains?: InputMaybe<Scalars["String"]["input"]>;
213
+ period_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
214
+ period_endsWith?: InputMaybe<Scalars["String"]["input"]>;
215
+ period_eq?: InputMaybe<Scalars["String"]["input"]>;
216
+ period_gt?: InputMaybe<Scalars["String"]["input"]>;
217
+ period_gte?: InputMaybe<Scalars["String"]["input"]>;
218
+ period_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
219
+ period_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
220
+ period_lt?: InputMaybe<Scalars["String"]["input"]>;
221
+ period_lte?: InputMaybe<Scalars["String"]["input"]>;
222
+ period_not_contains?: InputMaybe<Scalars["String"]["input"]>;
223
+ period_not_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
224
+ period_not_endsWith?: InputMaybe<Scalars["String"]["input"]>;
225
+ period_not_eq?: InputMaybe<Scalars["String"]["input"]>;
226
+ period_not_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
227
+ period_not_startsWith?: InputMaybe<Scalars["String"]["input"]>;
228
+ period_startsWith?: InputMaybe<Scalars["String"]["input"]>;
229
+ pnlBps_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
230
+ pnlBps_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
231
+ pnlBps_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
232
+ pnlBps_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
233
+ pnlBps_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
234
+ pnlBps_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
235
+ pnlBps_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
236
+ pnlBps_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
237
+ pnlBps_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
238
+ pnlUsd_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
239
+ pnlUsd_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
240
+ pnlUsd_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
241
+ pnlUsd_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
242
+ pnlUsd_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
243
+ pnlUsd_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
244
+ pnlUsd_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
245
+ pnlUsd_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
246
+ pnlUsd_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
247
+ updatedAt_eq?: InputMaybe<Scalars["Int"]["input"]>;
248
+ updatedAt_gt?: InputMaybe<Scalars["Int"]["input"]>;
249
+ updatedAt_gte?: InputMaybe<Scalars["Int"]["input"]>;
250
+ updatedAt_in?: InputMaybe<Array<Scalars["Int"]["input"]>>;
251
+ updatedAt_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
252
+ updatedAt_lt?: InputMaybe<Scalars["Int"]["input"]>;
253
+ updatedAt_lte?: InputMaybe<Scalars["Int"]["input"]>;
254
+ updatedAt_not_eq?: InputMaybe<Scalars["Int"]["input"]>;
255
+ updatedAt_not_in?: InputMaybe<Array<Scalars["Int"]["input"]>>;
256
+ volume_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
257
+ volume_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
258
+ volume_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
259
+ volume_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
260
+ volume_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
261
+ volume_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
262
+ volume_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
263
+ volume_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
264
+ volume_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
265
+ }
266
+ export interface AccountPnlRankMetricsConnection {
267
+ __typename?: "AccountPnlRankMetricsConnection";
268
+ edges: Array<AccountPnlRankMetricEdge>;
269
+ pageInfo: PageInfo;
270
+ totalCount: Scalars["Int"]["output"];
271
+ }
84
272
  export interface AccountPnlSummaryBucketObject {
85
273
  __typename?: "AccountPnlSummaryBucketObject";
274
+ /** Signed PnL contribution from borrowing fees */
275
+ borrowingFeesUsd: Scalars["BigInt"]["output"];
86
276
  bucketLabel: Scalars["String"]["output"];
277
+ /** Signed PnL contribution from close fees */
278
+ closeFeesUsd: Scalars["BigInt"]["output"];
279
+ /** Signed PnL contribution from liquidation fees */
280
+ liquidationFeesUsd: Scalars["BigInt"]["output"];
87
281
  losses: Scalars["Int"]["output"];
282
+ /** Signed PnL contribution from funding paid */
283
+ negativeFundingFeesUsd: Scalars["BigInt"]["output"];
284
+ /** Signed PnL contribution from net price impact */
285
+ netPriceImpactUsd: Scalars["BigInt"]["output"];
286
+ /** Signed PnL contribution from open fees */
287
+ openFeesUsd: Scalars["BigInt"]["output"];
88
288
  pnlBps: Scalars["BigInt"]["output"];
289
+ pnlBpsRank?: Maybe<Scalars["Int"]["output"]>;
89
290
  pnlUsd: Scalars["BigInt"]["output"];
291
+ pnlUsdRank?: Maybe<Scalars["Int"]["output"]>;
292
+ /** Signed PnL contribution from funding received */
293
+ positiveFundingFeesUsd: Scalars["BigInt"]["output"];
90
294
  /** Field for debug */
91
295
  realizedBasePnlUsd: Scalars["BigInt"]["output"];
296
+ /** Whether realized fee contribution is fully covered by split fee fields */
297
+ realizedFeesComponentsComplete: Scalars["Boolean"]["output"];
298
+ /** Signed PnL contribution from realized position fees */
299
+ realizedFeesContributionUsd: Scalars["BigInt"]["output"];
300
+ /** Signed realized-fee contribution not covered by split fee fields */
301
+ realizedFeesRemainderUsd: Scalars["BigInt"]["output"];
92
302
  /** Field for debug */
93
303
  realizedFeesUsd: Scalars["BigInt"]["output"];
94
304
  realizedPnlUsd: Scalars["BigInt"]["output"];
@@ -98,18 +308,29 @@ export interface AccountPnlSummaryBucketObject {
98
308
  realizedSwapFeesUsd: Scalars["BigInt"]["output"];
99
309
  /** Field for debug */
100
310
  realizedSwapImpactUsd: Scalars["BigInt"]["output"];
311
+ /** Signed PnL contribution from start unrealized base PnL */
312
+ startUnrealizedBasePnlContributionUsd: Scalars["BigInt"]["output"];
101
313
  /** Field for debug */
102
314
  startUnrealizedBasePnlUsd: Scalars["BigInt"]["output"];
103
315
  /** Field for debug */
104
316
  startUnrealizedFeesUsd: Scalars["BigInt"]["output"];
105
317
  startUnrealizedPnlUsd: Scalars["BigInt"]["output"];
318
+ /** Signed PnL contribution from swap fees */
319
+ swapFeesUsd: Scalars["BigInt"]["output"];
320
+ /** Signed PnL contribution from swap price impact */
321
+ swapPriceImpactUsd: Scalars["BigInt"]["output"];
106
322
  /** Field for debug */
107
323
  unrealizedBasePnlUsd: Scalars["BigInt"]["output"];
324
+ /** Whether unrealized fee contribution is fully covered by split fee fields */
325
+ unrealizedFeesComponentsComplete: Scalars["Boolean"]["output"];
326
+ /** Signed PnL contribution from open position pending fees */
327
+ unrealizedFeesContributionUsd: Scalars["BigInt"]["output"];
108
328
  /** Field for debug */
109
329
  unrealizedFeesUsd: Scalars["BigInt"]["output"];
110
330
  unrealizedPnlUsd: Scalars["BigInt"]["output"];
111
331
  usedCapitalUsd: Scalars["BigInt"]["output"];
112
332
  volume: Scalars["BigInt"]["output"];
333
+ volumeRank?: Maybe<Scalars["Int"]["output"]>;
113
334
  wins: Scalars["Int"]["output"];
114
335
  /** Null when no losses and no wins */
115
336
  winsLossesRatioBps?: Maybe<Scalars["BigInt"]["output"]>;
@@ -2956,6 +3177,8 @@ export interface MarketInfo {
2956
3177
  fundingFactor: Scalars["BigInt"]["output"];
2957
3178
  fundingFactorPerSecond: Scalars["BigInt"]["output"];
2958
3179
  fundingIncreaseFactorPerSecond: Scalars["BigInt"]["output"];
3180
+ fundingUpdatedAt: Scalars["Int"]["output"];
3181
+ minFundingIncreaseRatePerSecond: Scalars["BigInt"]["output"];
2959
3182
  id: Scalars["String"]["output"];
2960
3183
  indexTokenAddress: Scalars["String"]["output"];
2961
3184
  isDisabled: Scalars["Boolean"]["output"];
@@ -2972,6 +3195,8 @@ export interface MarketInfo {
2972
3195
  marketTokenAddress: Scalars["String"]["output"];
2973
3196
  marketTokenSupply: Scalars["BigInt"]["output"];
2974
3197
  maxFundingFactorPerSecond: Scalars["BigInt"]["output"];
3198
+ maxFundingFactorPerSecondLong: Scalars["BigInt"]["output"];
3199
+ maxFundingFactorPerSecondShort: Scalars["BigInt"]["output"];
2975
3200
  maxLendableImpactFactor: Scalars["BigInt"]["output"];
2976
3201
  maxLendableImpactFactorForWithdrawals: Scalars["BigInt"]["output"];
2977
3202
  maxLendableImpactUsd: Scalars["BigInt"]["output"];
@@ -2991,6 +3216,8 @@ export interface MarketInfo {
2991
3216
  minCollateralFactorForOpenInterestLong: Scalars["BigInt"]["output"];
2992
3217
  minCollateralFactorForOpenInterestShort: Scalars["BigInt"]["output"];
2993
3218
  minFundingFactorPerSecond: Scalars["BigInt"]["output"];
3219
+ minFundingFactorPerSecondLong: Scalars["BigInt"]["output"];
3220
+ minFundingFactorPerSecondShort: Scalars["BigInt"]["output"];
2994
3221
  minPositionImpactPoolAmount: Scalars["BigInt"]["output"];
2995
3222
  openInterestReserveFactorLong: Scalars["BigInt"]["output"];
2996
3223
  openInterestReserveFactorShort: Scalars["BigInt"]["output"];
@@ -3009,6 +3236,7 @@ export interface MarketInfo {
3009
3236
  positionImpactPoolDistributionRate: Scalars["BigInt"]["output"];
3010
3237
  reserveFactorLong: Scalars["BigInt"]["output"];
3011
3238
  reserveFactorShort: Scalars["BigInt"]["output"];
3239
+ savedFundingFactorPerSecond: Scalars["BigInt"]["output"];
3012
3240
  shortOpenInterestInTokens: Scalars["BigInt"]["output"];
3013
3241
  shortOpenInterestInTokensUsingLongToken: Scalars["BigInt"]["output"];
3014
3242
  shortOpenInterestInTokensUsingShortToken: Scalars["BigInt"]["output"];
@@ -3138,6 +3366,18 @@ export declare enum MarketInfoOrderByInput {
3138
3366
  fundingIncreaseFactorPerSecond_DESC = "fundingIncreaseFactorPerSecond_DESC",
3139
3367
  fundingIncreaseFactorPerSecond_DESC_NULLS_FIRST = "fundingIncreaseFactorPerSecond_DESC_NULLS_FIRST",
3140
3368
  fundingIncreaseFactorPerSecond_DESC_NULLS_LAST = "fundingIncreaseFactorPerSecond_DESC_NULLS_LAST",
3369
+ fundingUpdatedAt_ASC = "fundingUpdatedAt_ASC",
3370
+ fundingUpdatedAt_ASC_NULLS_FIRST = "fundingUpdatedAt_ASC_NULLS_FIRST",
3371
+ fundingUpdatedAt_ASC_NULLS_LAST = "fundingUpdatedAt_ASC_NULLS_LAST",
3372
+ fundingUpdatedAt_DESC = "fundingUpdatedAt_DESC",
3373
+ fundingUpdatedAt_DESC_NULLS_FIRST = "fundingUpdatedAt_DESC_NULLS_FIRST",
3374
+ fundingUpdatedAt_DESC_NULLS_LAST = "fundingUpdatedAt_DESC_NULLS_LAST",
3375
+ minFundingIncreaseRatePerSecond_ASC = "minFundingIncreaseRatePerSecond_ASC",
3376
+ minFundingIncreaseRatePerSecond_ASC_NULLS_FIRST = "minFundingIncreaseRatePerSecond_ASC_NULLS_FIRST",
3377
+ minFundingIncreaseRatePerSecond_ASC_NULLS_LAST = "minFundingIncreaseRatePerSecond_ASC_NULLS_LAST",
3378
+ minFundingIncreaseRatePerSecond_DESC = "minFundingIncreaseRatePerSecond_DESC",
3379
+ minFundingIncreaseRatePerSecond_DESC_NULLS_FIRST = "minFundingIncreaseRatePerSecond_DESC_NULLS_FIRST",
3380
+ minFundingIncreaseRatePerSecond_DESC_NULLS_LAST = "minFundingIncreaseRatePerSecond_DESC_NULLS_LAST",
3141
3381
  id_ASC = "id_ASC",
3142
3382
  id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST",
3143
3383
  id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST",
@@ -3456,6 +3696,12 @@ export declare enum MarketInfoOrderByInput {
3456
3696
  reserveFactorShort_DESC = "reserveFactorShort_DESC",
3457
3697
  reserveFactorShort_DESC_NULLS_FIRST = "reserveFactorShort_DESC_NULLS_FIRST",
3458
3698
  reserveFactorShort_DESC_NULLS_LAST = "reserveFactorShort_DESC_NULLS_LAST",
3699
+ savedFundingFactorPerSecond_ASC = "savedFundingFactorPerSecond_ASC",
3700
+ savedFundingFactorPerSecond_ASC_NULLS_FIRST = "savedFundingFactorPerSecond_ASC_NULLS_FIRST",
3701
+ savedFundingFactorPerSecond_ASC_NULLS_LAST = "savedFundingFactorPerSecond_ASC_NULLS_LAST",
3702
+ savedFundingFactorPerSecond_DESC = "savedFundingFactorPerSecond_DESC",
3703
+ savedFundingFactorPerSecond_DESC_NULLS_FIRST = "savedFundingFactorPerSecond_DESC_NULLS_FIRST",
3704
+ savedFundingFactorPerSecond_DESC_NULLS_LAST = "savedFundingFactorPerSecond_DESC_NULLS_LAST",
3459
3705
  shortOpenInterestInTokensUsingLongToken_ASC = "shortOpenInterestInTokensUsingLongToken_ASC",
3460
3706
  shortOpenInterestInTokensUsingLongToken_ASC_NULLS_FIRST = "shortOpenInterestInTokensUsingLongToken_ASC_NULLS_FIRST",
3461
3707
  shortOpenInterestInTokensUsingLongToken_ASC_NULLS_LAST = "shortOpenInterestInTokensUsingLongToken_ASC_NULLS_LAST",
@@ -3760,6 +4006,24 @@ export interface MarketInfoWhereInput {
3760
4006
  fundingIncreaseFactorPerSecond_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
3761
4007
  fundingIncreaseFactorPerSecond_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
3762
4008
  fundingIncreaseFactorPerSecond_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
4009
+ fundingUpdatedAt_eq?: InputMaybe<Scalars["Int"]["input"]>;
4010
+ fundingUpdatedAt_gt?: InputMaybe<Scalars["Int"]["input"]>;
4011
+ fundingUpdatedAt_gte?: InputMaybe<Scalars["Int"]["input"]>;
4012
+ fundingUpdatedAt_in?: InputMaybe<Array<Scalars["Int"]["input"]>>;
4013
+ fundingUpdatedAt_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
4014
+ fundingUpdatedAt_lt?: InputMaybe<Scalars["Int"]["input"]>;
4015
+ fundingUpdatedAt_lte?: InputMaybe<Scalars["Int"]["input"]>;
4016
+ fundingUpdatedAt_not_eq?: InputMaybe<Scalars["Int"]["input"]>;
4017
+ fundingUpdatedAt_not_in?: InputMaybe<Array<Scalars["Int"]["input"]>>;
4018
+ minFundingIncreaseRatePerSecond_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
4019
+ minFundingIncreaseRatePerSecond_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
4020
+ minFundingIncreaseRatePerSecond_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
4021
+ minFundingIncreaseRatePerSecond_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
4022
+ minFundingIncreaseRatePerSecond_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
4023
+ minFundingIncreaseRatePerSecond_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
4024
+ minFundingIncreaseRatePerSecond_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
4025
+ minFundingIncreaseRatePerSecond_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
4026
+ minFundingIncreaseRatePerSecond_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
3763
4027
  id_contains?: InputMaybe<Scalars["String"]["input"]>;
3764
4028
  id_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
3765
4029
  id_endsWith?: InputMaybe<Scalars["String"]["input"]>;
@@ -4257,6 +4521,15 @@ export interface MarketInfoWhereInput {
4257
4521
  reserveFactorShort_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
4258
4522
  reserveFactorShort_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
4259
4523
  reserveFactorShort_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
4524
+ savedFundingFactorPerSecond_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
4525
+ savedFundingFactorPerSecond_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
4526
+ savedFundingFactorPerSecond_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
4527
+ savedFundingFactorPerSecond_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
4528
+ savedFundingFactorPerSecond_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
4529
+ savedFundingFactorPerSecond_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
4530
+ savedFundingFactorPerSecond_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
4531
+ savedFundingFactorPerSecond_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
4532
+ savedFundingFactorPerSecond_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
4260
4533
  shortOpenInterestInTokensUsingLongToken_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
4261
4534
  shortOpenInterestInTokensUsingLongToken_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
4262
4535
  shortOpenInterestInTokensUsingLongToken_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
@@ -6105,6 +6378,8 @@ export interface PeriodAccountStatObject {
6105
6378
  losses: Scalars["Float"]["output"];
6106
6379
  maxCapital: Scalars["BigInt"]["output"];
6107
6380
  netCapital: Scalars["BigInt"]["output"];
6381
+ /** Positive funding accrued as claimable in the period (claimed or not) */
6382
+ positiveFundingFeesUsd: Scalars["BigInt"]["output"];
6108
6383
  realizedFees: Scalars["BigInt"]["output"];
6109
6384
  realizedPnl: Scalars["BigInt"]["output"];
6110
6385
  realizedPriceImpact: Scalars["BigInt"]["output"];
@@ -8406,6 +8681,9 @@ export interface ProcessorStatusesConnection {
8406
8681
  export interface Query {
8407
8682
  __typename?: "Query";
8408
8683
  accountPnlHistoryStats: Array<AccountPnlHistoryPointObject>;
8684
+ accountPnlRankMetricById?: Maybe<AccountPnlRankMetric>;
8685
+ accountPnlRankMetrics: Array<AccountPnlRankMetric>;
8686
+ accountPnlRankMetricsConnection: AccountPnlRankMetricsConnection;
8409
8687
  accountPnlSummaryStats: Array<AccountPnlSummaryBucketObject>;
8410
8688
  accountStatById?: Maybe<AccountStat>;
8411
8689
  accountStats: Array<AccountStat>;
@@ -8559,9 +8837,26 @@ export interface Query {
8559
8837
  export interface QueryaccountPnlHistoryStatsArgs {
8560
8838
  account: Scalars["String"]["input"];
8561
8839
  from?: InputMaybe<Scalars["Int"]["input"]>;
8840
+ to?: InputMaybe<Scalars["Int"]["input"]>;
8841
+ }
8842
+ export interface QueryaccountPnlRankMetricByIdArgs {
8843
+ id: Scalars["String"]["input"];
8844
+ }
8845
+ export interface QueryaccountPnlRankMetricsArgs {
8846
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
8847
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
8848
+ orderBy?: InputMaybe<Array<AccountPnlRankMetricOrderByInput>>;
8849
+ where?: InputMaybe<AccountPnlRankMetricWhereInput>;
8850
+ }
8851
+ export interface QueryaccountPnlRankMetricsConnectionArgs {
8852
+ after?: InputMaybe<Scalars["String"]["input"]>;
8853
+ first?: InputMaybe<Scalars["Int"]["input"]>;
8854
+ orderBy: Array<AccountPnlRankMetricOrderByInput>;
8855
+ where?: InputMaybe<AccountPnlRankMetricWhereInput>;
8562
8856
  }
8563
8857
  export interface QueryaccountPnlSummaryStatsArgs {
8564
8858
  account: Scalars["String"]["input"];
8859
+ rankMaxCapitalGte?: InputMaybe<Scalars["String"]["input"]>;
8565
8860
  }
8566
8861
  export interface QueryaccountStatByIdArgs {
8567
8862
  id: Scalars["String"]["input"];
@@ -10295,12 +10590,17 @@ export interface TradeAction {
10295
10590
  isLong?: Maybe<Scalars["Boolean"]["output"]>;
10296
10591
  liquidationFeeAmount?: Maybe<Scalars["BigInt"]["output"]>;
10297
10592
  marketAddress?: Maybe<Scalars["String"]["output"]>;
10593
+ minCollateralFactorForLiquidation?: Maybe<Scalars["BigInt"]["output"]>;
10298
10594
  minOutputAmount?: Maybe<Scalars["BigInt"]["output"]>;
10299
10595
  numberOfParts?: Maybe<Scalars["Int"]["output"]>;
10300
10596
  orderKey: Scalars["String"]["output"];
10301
10597
  orderType: Scalars["Int"]["output"];
10302
10598
  pnlUsd?: Maybe<Scalars["BigInt"]["output"]>;
10599
+ positionKey?: Maybe<Scalars["String"]["output"]>;
10600
+ positionLifecycleId?: Maybe<Scalars["String"]["output"]>;
10303
10601
  positionFeeAmount?: Maybe<Scalars["BigInt"]["output"]>;
10602
+ positionSizeInTokens?: Maybe<Scalars["BigInt"]["output"]>;
10603
+ positionSizeInUsd?: Maybe<Scalars["BigInt"]["output"]>;
10304
10604
  priceImpactAmount?: Maybe<Scalars["BigInt"]["output"]>;
10305
10605
  priceImpactDiffUsd?: Maybe<Scalars["BigInt"]["output"]>;
10306
10606
  priceImpactUsd?: Maybe<Scalars["BigInt"]["output"]>;
@@ -10454,6 +10754,12 @@ export declare enum TradeActionOrderByInput {
10454
10754
  marketAddress_DESC = "marketAddress_DESC",
10455
10755
  marketAddress_DESC_NULLS_FIRST = "marketAddress_DESC_NULLS_FIRST",
10456
10756
  marketAddress_DESC_NULLS_LAST = "marketAddress_DESC_NULLS_LAST",
10757
+ minCollateralFactorForLiquidation_ASC = "minCollateralFactorForLiquidation_ASC",
10758
+ minCollateralFactorForLiquidation_ASC_NULLS_FIRST = "minCollateralFactorForLiquidation_ASC_NULLS_FIRST",
10759
+ minCollateralFactorForLiquidation_ASC_NULLS_LAST = "minCollateralFactorForLiquidation_ASC_NULLS_LAST",
10760
+ minCollateralFactorForLiquidation_DESC = "minCollateralFactorForLiquidation_DESC",
10761
+ minCollateralFactorForLiquidation_DESC_NULLS_FIRST = "minCollateralFactorForLiquidation_DESC_NULLS_FIRST",
10762
+ minCollateralFactorForLiquidation_DESC_NULLS_LAST = "minCollateralFactorForLiquidation_DESC_NULLS_LAST",
10457
10763
  minOutputAmount_ASC = "minOutputAmount_ASC",
10458
10764
  minOutputAmount_ASC_NULLS_FIRST = "minOutputAmount_ASC_NULLS_FIRST",
10459
10765
  minOutputAmount_ASC_NULLS_LAST = "minOutputAmount_ASC_NULLS_LAST",
@@ -10490,6 +10796,24 @@ export declare enum TradeActionOrderByInput {
10490
10796
  positionFeeAmount_DESC = "positionFeeAmount_DESC",
10491
10797
  positionFeeAmount_DESC_NULLS_FIRST = "positionFeeAmount_DESC_NULLS_FIRST",
10492
10798
  positionFeeAmount_DESC_NULLS_LAST = "positionFeeAmount_DESC_NULLS_LAST",
10799
+ positionKey_ASC = "positionKey_ASC",
10800
+ positionKey_ASC_NULLS_FIRST = "positionKey_ASC_NULLS_FIRST",
10801
+ positionKey_ASC_NULLS_LAST = "positionKey_ASC_NULLS_LAST",
10802
+ positionKey_DESC = "positionKey_DESC",
10803
+ positionKey_DESC_NULLS_FIRST = "positionKey_DESC_NULLS_FIRST",
10804
+ positionKey_DESC_NULLS_LAST = "positionKey_DESC_NULLS_LAST",
10805
+ positionSizeInTokens_ASC = "positionSizeInTokens_ASC",
10806
+ positionSizeInTokens_ASC_NULLS_FIRST = "positionSizeInTokens_ASC_NULLS_FIRST",
10807
+ positionSizeInTokens_ASC_NULLS_LAST = "positionSizeInTokens_ASC_NULLS_LAST",
10808
+ positionSizeInTokens_DESC = "positionSizeInTokens_DESC",
10809
+ positionSizeInTokens_DESC_NULLS_FIRST = "positionSizeInTokens_DESC_NULLS_FIRST",
10810
+ positionSizeInTokens_DESC_NULLS_LAST = "positionSizeInTokens_DESC_NULLS_LAST",
10811
+ positionSizeInUsd_ASC = "positionSizeInUsd_ASC",
10812
+ positionSizeInUsd_ASC_NULLS_FIRST = "positionSizeInUsd_ASC_NULLS_FIRST",
10813
+ positionSizeInUsd_ASC_NULLS_LAST = "positionSizeInUsd_ASC_NULLS_LAST",
10814
+ positionSizeInUsd_DESC = "positionSizeInUsd_DESC",
10815
+ positionSizeInUsd_DESC_NULLS_FIRST = "positionSizeInUsd_DESC_NULLS_FIRST",
10816
+ positionSizeInUsd_DESC_NULLS_LAST = "positionSizeInUsd_DESC_NULLS_LAST",
10493
10817
  priceImpactAmount_ASC = "priceImpactAmount_ASC",
10494
10818
  priceImpactAmount_ASC_NULLS_FIRST = "priceImpactAmount_ASC_NULLS_FIRST",
10495
10819
  priceImpactAmount_ASC_NULLS_LAST = "priceImpactAmount_ASC_NULLS_LAST",
@@ -10831,6 +11155,15 @@ export interface TradeActionWhereInput {
10831
11155
  marketAddress_not_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
10832
11156
  marketAddress_not_startsWith?: InputMaybe<Scalars["String"]["input"]>;
10833
11157
  marketAddress_startsWith?: InputMaybe<Scalars["String"]["input"]>;
11158
+ minCollateralFactorForLiquidation_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
11159
+ minCollateralFactorForLiquidation_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
11160
+ minCollateralFactorForLiquidation_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
11161
+ minCollateralFactorForLiquidation_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
11162
+ minCollateralFactorForLiquidation_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
11163
+ minCollateralFactorForLiquidation_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
11164
+ minCollateralFactorForLiquidation_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
11165
+ minCollateralFactorForLiquidation_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
11166
+ minCollateralFactorForLiquidation_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
10834
11167
  minOutputAmount_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
10835
11168
  minOutputAmount_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
10836
11169
  minOutputAmount_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
@@ -10893,6 +11226,41 @@ export interface TradeActionWhereInput {
10893
11226
  positionFeeAmount_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
10894
11227
  positionFeeAmount_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
10895
11228
  positionFeeAmount_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
11229
+ positionKey_contains?: InputMaybe<Scalars["String"]["input"]>;
11230
+ positionKey_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
11231
+ positionKey_endsWith?: InputMaybe<Scalars["String"]["input"]>;
11232
+ positionKey_eq?: InputMaybe<Scalars["String"]["input"]>;
11233
+ positionKey_gt?: InputMaybe<Scalars["String"]["input"]>;
11234
+ positionKey_gte?: InputMaybe<Scalars["String"]["input"]>;
11235
+ positionKey_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
11236
+ positionKey_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
11237
+ positionKey_lt?: InputMaybe<Scalars["String"]["input"]>;
11238
+ positionKey_lte?: InputMaybe<Scalars["String"]["input"]>;
11239
+ positionKey_not_contains?: InputMaybe<Scalars["String"]["input"]>;
11240
+ positionKey_not_containsInsensitive?: InputMaybe<Scalars["String"]["input"]>;
11241
+ positionKey_not_endsWith?: InputMaybe<Scalars["String"]["input"]>;
11242
+ positionKey_not_eq?: InputMaybe<Scalars["String"]["input"]>;
11243
+ positionKey_not_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
11244
+ positionKey_not_startsWith?: InputMaybe<Scalars["String"]["input"]>;
11245
+ positionKey_startsWith?: InputMaybe<Scalars["String"]["input"]>;
11246
+ positionSizeInTokens_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
11247
+ positionSizeInTokens_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
11248
+ positionSizeInTokens_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
11249
+ positionSizeInTokens_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
11250
+ positionSizeInTokens_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
11251
+ positionSizeInTokens_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
11252
+ positionSizeInTokens_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
11253
+ positionSizeInTokens_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
11254
+ positionSizeInTokens_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
11255
+ positionSizeInUsd_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
11256
+ positionSizeInUsd_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
11257
+ positionSizeInUsd_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
11258
+ positionSizeInUsd_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
11259
+ positionSizeInUsd_isNull?: InputMaybe<Scalars["Boolean"]["input"]>;
11260
+ positionSizeInUsd_lt?: InputMaybe<Scalars["BigInt"]["input"]>;
11261
+ positionSizeInUsd_lte?: InputMaybe<Scalars["BigInt"]["input"]>;
11262
+ positionSizeInUsd_not_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
11263
+ positionSizeInUsd_not_in?: InputMaybe<Array<Scalars["BigInt"]["input"]>>;
10896
11264
  priceImpactAmount_eq?: InputMaybe<Scalars["BigInt"]["input"]>;
10897
11265
  priceImpactAmount_gt?: InputMaybe<Scalars["BigInt"]["input"]>;
10898
11266
  priceImpactAmount_gte?: InputMaybe<Scalars["BigInt"]["input"]>;
@@ -1,6 +1,5 @@
1
1
  export declare const AVALANCHE = 43114;
2
2
  export declare const ARBITRUM = 42161;
3
- export declare const BOTANIX = 3637;
4
3
  export declare const MEGAETH = 4326;
5
4
  export declare const SOURCE_ETHEREUM_MAINNET = 1;
6
5
  export declare const SOURCE_BASE_MAINNET = 8453;
@@ -1,8 +1,8 @@
1
1
  import { Chain } from "viem/chains";
2
- import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, MEGAETH, SOURCE_ETHEREUM_MAINNET, SOURCE_BASE_MAINNET, SOURCE_BSC_MAINNET, SOURCE_OPTIMISM_SEPOLIA, SOURCE_SEPOLIA } from "./chainIds";
3
- export { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, MEGAETH, ARBITRUM_SEPOLIA, SOURCE_ETHEREUM_MAINNET, SOURCE_BASE_MAINNET, SOURCE_BSC_MAINNET, SOURCE_OPTIMISM_SEPOLIA, SOURCE_SEPOLIA, };
4
- export declare const CONTRACTS_CHAIN_IDS: readonly [42161, 43114, 3637, 4326];
5
- export declare const CONTRACTS_CHAIN_IDS_DEV: readonly [42161, 43114, 3637, 4326, 43113, 421614];
2
+ import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, MEGAETH, SOURCE_ETHEREUM_MAINNET, SOURCE_BASE_MAINNET, SOURCE_BSC_MAINNET, SOURCE_OPTIMISM_SEPOLIA, SOURCE_SEPOLIA } from "./chainIds";
3
+ export { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, MEGAETH, ARBITRUM_SEPOLIA, SOURCE_ETHEREUM_MAINNET, SOURCE_BASE_MAINNET, SOURCE_BSC_MAINNET, SOURCE_OPTIMISM_SEPOLIA, SOURCE_SEPOLIA, };
4
+ export declare const CONTRACTS_CHAIN_IDS: readonly [42161, 43114, 4326];
5
+ export declare const CONTRACTS_CHAIN_IDS_DEV: readonly [42161, 43114, 4326, 43113, 421614];
6
6
  export declare const SETTLEMENT_CHAIN_IDS: readonly [42161, 43114];
7
7
  export declare const SETTLEMENT_CHAIN_IDS_DEV: readonly [42161, 43114, 421614, 43113];
8
8
  export declare const SOURCE_CHAIN_IDS: readonly [11155420, 11155111, 8453, 56, 1, 421614, 42161, 43114, 43113];
@@ -94,30 +94,6 @@ declare const CONTRACTS_CHAIN_CONFIGS: {
94
94
  readonly gasPriceBuffer: undefined;
95
95
  readonly isDisabled: false;
96
96
  };
97
- readonly 3637: {
98
- readonly chainId: 3637;
99
- readonly name: "Botanix";
100
- readonly slug: "botanix";
101
- readonly explorerUrl: "https://botanixscan.io/";
102
- readonly nativeTokenSymbol: "BTC";
103
- readonly wrappedTokenSymbol: "PBTC";
104
- readonly defaultCollateralSymbol: "USDC.E";
105
- readonly highExecutionFee: 5;
106
- readonly shouldUseMaxPriorityFeePerGas: true;
107
- readonly defaultExecutionFeeBufferBps: 3000;
108
- readonly maxFeePerGas: 20n;
109
- readonly gasPricePremium: undefined;
110
- readonly maxPriorityFeePerGas: 7n;
111
- readonly excessiveExecutionFee: 10;
112
- /**
113
- * avoid botanix gas spikes when chain is not actively used
114
- * if set, execution fee value should not be less than this in USD equivalent
115
- */
116
- readonly minExecutionFee: 1000000000000000000000000000n;
117
- readonly residualGasUsd: undefined;
118
- readonly gasPriceBuffer: undefined;
119
- readonly isDisabled: false;
120
- };
121
97
  readonly 4326: {
122
98
  readonly chainId: 4326;
123
99
  readonly name: "MegaETH";
@@ -218,7 +194,6 @@ export type ChainName = ContractsChainName | SourceChainName | "Unknown";
218
194
  export type ContractsChainSlug = (typeof CONTRACTS_CHAIN_CONFIGS)[keyof typeof CONTRACTS_CHAIN_CONFIGS]["slug"];
219
195
  export type SourceChainSlug = (typeof SOURCE_CHAIN_CONFIGS)[keyof typeof SOURCE_CHAIN_CONFIGS]["slug"];
220
196
  export type ChainSlug = ContractsChainSlug | SourceChainSlug | "unknown";
221
- export declare const botanix: Chain;
222
197
  export declare const megaeth: Chain;
223
198
  export declare const VIEM_CHAIN_BY_CHAIN_ID: Record<AnyChainId, Chain>;
224
199
  export declare function getChainName(chainId: number): ChainName;
@@ -231,17 +206,17 @@ export declare function isContractsChain(chainId: number, dev?: boolean): chainI
231
206
  export declare function isTestnetChain(chainId: number): boolean;
232
207
  export declare function getMaxFeePerGas(chainId: ContractsChainId): bigint | undefined;
233
208
  export declare function getGasPricePremium(chainId: ContractsChainId): bigint | undefined;
234
- export declare function getMaxPriorityFeePerGas(chainId: ContractsChainId): 1500000000n | 7n | 500000n;
235
- export declare function getMinExecutionFeeUsd(chainId: ContractsChainId): 1000000000000000000000000000n | undefined;
209
+ export declare function getMaxPriorityFeePerGas(chainId: ContractsChainId): 1500000000n | 500000n;
210
+ export declare function getMinExecutionFeeUsd(chainId: ContractsChainId): undefined;
236
211
  export declare function getResidualGasUsdConfig(chainId: ContractsChainId): {
237
212
  readonly min: 1;
238
213
  readonly max: 2;
239
214
  } | undefined;
240
215
  export declare function getGasPriceBuffer(chainId: ContractsChainId | SourceChainId): 2000n | 3000n | undefined;
241
216
  export declare function isChainDisabled(chainId: ContractsChainId): false;
242
- export declare function getChainNativeTokenSymbol(chainId: ContractsChainId): "ETH" | "AVAX" | "BTC";
243
- export declare function getChainWrappedTokenSymbol(chainId: ContractsChainId): "WETH" | "WAVAX" | "PBTC";
244
- export declare function getChainDefaultCollateralSymbol(chainId: ContractsChainId): "USDC.e" | "USDC" | "USDC.E" | "USDM";
217
+ export declare function getChainNativeTokenSymbol(chainId: ContractsChainId): "ETH" | "AVAX";
218
+ export declare function getChainWrappedTokenSymbol(chainId: ContractsChainId): "WETH" | "WAVAX";
219
+ export declare function getChainDefaultCollateralSymbol(chainId: ContractsChainId): "USDC.e" | "USDC" | "USDM";
245
220
  export declare function getExplorerUrl(chainId: number | "layerzero" | "layerzero-testnet"): string;
246
221
  export declare function getTokenExplorerUrl(chainId: number, tokenAddress: string): string;
247
222
  export declare function getExecutionFeeConfig(chainId: ContractsChainId): {