@gmx-io/sdk 1.3.0 → 1.4.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 (443) hide show
  1. package/README.md +37 -37
  2. package/build/cjs/src/abis/ArbitrumNodeInterface.js +105 -0
  3. package/build/cjs/src/abis/ClaimHandler.js +424 -0
  4. package/build/cjs/src/abis/CustomErrors.js +1884 -0
  5. package/build/cjs/src/abis/DataStore.js +639 -0
  6. package/build/cjs/src/abis/ERC20PermitInterface.js +54 -0
  7. package/build/cjs/src/abis/ERC721.js +196 -0
  8. package/build/cjs/src/abis/EventEmitter.js +1228 -0
  9. package/build/cjs/src/abis/ExchangeRouter.js +1590 -0
  10. package/build/cjs/src/abis/GelatoRelayRouter.js +1579 -0
  11. package/build/cjs/src/abis/GlpManager.js +246 -0
  12. package/build/cjs/src/abis/GlvReader.js +1471 -0
  13. package/build/cjs/src/abis/GlvRouter.js +764 -0
  14. package/build/cjs/src/abis/GmxMigrator.js +269 -0
  15. package/build/cjs/src/abis/GovToken.js +325 -0
  16. package/build/cjs/src/abis/LayerZeroProvider.js +161 -0
  17. package/build/cjs/src/abis/MintableBaseToken.js +323 -0
  18. package/build/cjs/src/abis/Multicall.js +231 -0
  19. package/build/cjs/src/abis/MultichainClaimsRouter.js +1266 -0
  20. package/build/cjs/src/abis/MultichainGlvRouter.js +1150 -0
  21. package/build/cjs/src/abis/MultichainGmRouter.js +1449 -0
  22. package/build/cjs/src/abis/MultichainOrderRouter.js +2009 -0
  23. package/build/cjs/src/abis/MultichainSubaccountRouter.js +2069 -0
  24. package/build/cjs/src/abis/MultichainTransferRouter.js +915 -0
  25. package/build/cjs/src/abis/MultichainUtils.js +133 -0
  26. package/build/cjs/src/abis/MultichainVault.js +275 -0
  27. package/build/cjs/src/abis/Reader.js +140 -0
  28. package/build/cjs/src/abis/ReaderV2.js +259 -0
  29. package/build/cjs/src/abis/ReferralStorage.js +261 -0
  30. package/build/cjs/src/abis/RelayParams.js +55 -0
  31. package/build/cjs/src/abis/RewardReader.js +35 -0
  32. package/build/cjs/src/abis/RewardRouter.js +460 -0
  33. package/build/cjs/src/abis/RewardTracker.js +415 -0
  34. package/build/cjs/src/abis/SmartAccount.js +14 -0
  35. package/build/cjs/src/abis/StBTC.js +513 -0
  36. package/build/cjs/src/abis/SubaccountApproval.js +17 -0
  37. package/build/cjs/src/abis/SubaccountGelatoRelayRouter.js +2019 -0
  38. package/build/cjs/src/abis/SubaccountRouter.js +602 -0
  39. package/build/cjs/src/abis/SyntheticsReader.js +4905 -0
  40. package/build/cjs/src/abis/SyntheticsRouter.js +72 -0
  41. package/build/cjs/src/abis/Timelock.js +778 -0
  42. package/build/cjs/src/abis/Token.js +150 -0
  43. package/build/cjs/src/abis/Treasury.js +206 -0
  44. package/build/cjs/src/abis/UniPool.js +36 -0
  45. package/build/cjs/src/abis/UniswapV2.js +287 -0
  46. package/build/cjs/src/abis/UniswapV3Factory.js +200 -0
  47. package/build/cjs/src/abis/UniswapV3Pool.js +985 -0
  48. package/build/cjs/src/abis/UniswapV3PositionManager.js +991 -0
  49. package/build/cjs/src/abis/Vault.js +1308 -0
  50. package/build/cjs/src/abis/VaultReader.js +30 -0
  51. package/build/cjs/src/abis/VaultV2.js +1222 -0
  52. package/build/cjs/src/abis/VaultV2b.js +1308 -0
  53. package/build/cjs/src/abis/VenusVToken.js +49 -0
  54. package/build/cjs/src/abis/Vester.js +456 -0
  55. package/build/cjs/src/abis/WETH.js +137 -0
  56. package/build/cjs/src/abis/index.js +106 -118
  57. package/build/cjs/src/configs/batch.js +14 -1
  58. package/build/cjs/src/configs/chainIds.js +17 -0
  59. package/build/cjs/src/configs/chains.js +77 -66
  60. package/build/cjs/src/configs/contracts.js +59 -80
  61. package/build/cjs/src/configs/dataStore.js +6 -10
  62. package/build/cjs/src/configs/express.js +16 -3
  63. package/build/cjs/src/configs/factors.js +2 -3
  64. package/build/cjs/src/configs/markets.js +127 -1
  65. package/build/cjs/src/configs/multichain.js +26 -0
  66. package/build/cjs/src/configs/oracleKeeper.js +19 -4
  67. package/build/cjs/src/configs/tokens.js +110 -5
  68. package/build/cjs/src/configs/uniswapV3.js +18 -0
  69. package/build/cjs/src/configs/venus.js +58 -0
  70. package/build/cjs/src/modules/markets/index.js +36 -14
  71. package/build/cjs/src/modules/markets/query-builders.js +6 -10
  72. package/build/cjs/src/modules/orders/helpers.js +1 -0
  73. package/build/cjs/src/modules/orders/transactions/createDecreaseOrderTxn.js +1 -0
  74. package/build/cjs/src/modules/orders/transactions/createIncreaseOrderTxn.js +1 -0
  75. package/build/cjs/src/modules/orders/transactions/createSwapOrderTxn.js +1 -0
  76. package/build/cjs/src/modules/positions/positions.js +10 -2
  77. package/build/cjs/src/modules/trades/trades.js +2 -2
  78. package/build/cjs/src/prebuilt/hashedKinkModelMarketRatesKeys.json +88 -0
  79. package/build/cjs/src/prebuilt/hashedMarketConfigKeys.json +907 -453
  80. package/build/cjs/src/prebuilt/hashedMarketValuesKeys.json +165 -0
  81. package/build/cjs/src/test/mock.js +3 -3
  82. package/build/cjs/src/types/subsquid.js +193 -217
  83. package/build/cjs/src/types/tradeHistory.js +9 -1
  84. package/build/cjs/src/utils/LruCache.js +21 -17
  85. package/build/cjs/src/utils/__tests__/LruCache.spec.js +11 -0
  86. package/build/cjs/src/utils/__tests__/fees.spec.js +4 -4
  87. package/build/cjs/src/utils/__tests__/{subgraph.spec.js → indexers.spec.js} +18 -18
  88. package/build/cjs/src/utils/__tests__/numbers.spec.js +1 -1
  89. package/build/cjs/src/utils/bigmath.js +3 -0
  90. package/build/cjs/src/utils/buildUrl.js +1 -0
  91. package/build/cjs/src/utils/errors/transactionsErrors.js +1 -0
  92. package/build/cjs/src/utils/fees/index.js +5 -6
  93. package/build/cjs/src/utils/fees/priceImpact.js +29 -19
  94. package/build/cjs/src/utils/{subgraph.js → indexers.js} +17 -1
  95. package/build/cjs/src/utils/marketKeysAndConfigs.js +7 -11
  96. package/build/cjs/src/utils/markets.js +10 -1
  97. package/build/cjs/src/utils/numbers.js +11 -6
  98. package/build/cjs/src/utils/orderTransactions.js +5 -5
  99. package/build/cjs/src/utils/orders.js +9 -1
  100. package/build/cjs/src/utils/prices.js +0 -2
  101. package/build/cjs/src/utils/swap/botanixStaking.js +3 -3
  102. package/build/cjs/src/utils/swap/swapPath.js +1 -10
  103. package/build/cjs/src/utils/swap/swapValues.js +15 -15
  104. package/build/cjs/src/utils/trade/decrease.js +6 -9
  105. package/build/cjs/src/utils/trade/increase.js +9 -8
  106. package/build/cjs/src/utils/tradeHistory.js +3 -0
  107. package/build/esm/src/abis/ArbitrumNodeInterface.js +103 -0
  108. package/build/esm/src/abis/ClaimHandler.js +422 -0
  109. package/build/esm/src/abis/CustomErrors.js +1882 -0
  110. package/build/esm/src/abis/DataStore.js +637 -0
  111. package/build/esm/src/abis/ERC20PermitInterface.js +52 -0
  112. package/build/esm/src/abis/ERC721.js +194 -0
  113. package/build/esm/src/abis/EventEmitter.js +1226 -0
  114. package/build/esm/src/abis/ExchangeRouter.js +1588 -0
  115. package/build/esm/src/abis/GelatoRelayRouter.js +1577 -0
  116. package/build/esm/src/abis/GlpManager.js +244 -0
  117. package/build/esm/src/abis/GlvReader.js +1469 -0
  118. package/build/esm/src/abis/GlvRouter.js +762 -0
  119. package/build/esm/src/abis/GmxMigrator.js +267 -0
  120. package/build/esm/src/abis/GovToken.js +323 -0
  121. package/build/esm/src/abis/LayerZeroProvider.js +159 -0
  122. package/build/esm/src/abis/MintableBaseToken.js +321 -0
  123. package/build/esm/src/abis/Multicall.js +229 -0
  124. package/build/esm/src/abis/MultichainClaimsRouter.js +1264 -0
  125. package/build/esm/src/abis/MultichainGlvRouter.js +1148 -0
  126. package/build/esm/src/abis/MultichainGmRouter.js +1447 -0
  127. package/build/esm/src/abis/MultichainOrderRouter.js +2007 -0
  128. package/build/esm/src/abis/MultichainSubaccountRouter.js +2067 -0
  129. package/build/esm/src/abis/MultichainTransferRouter.js +913 -0
  130. package/build/esm/src/abis/MultichainUtils.js +131 -0
  131. package/build/esm/src/abis/MultichainVault.js +273 -0
  132. package/build/esm/src/abis/Reader.js +138 -0
  133. package/build/esm/src/abis/ReaderV2.js +257 -0
  134. package/build/esm/src/abis/ReferralStorage.js +259 -0
  135. package/build/esm/src/abis/RelayParams.js +53 -0
  136. package/build/esm/src/abis/RewardReader.js +33 -0
  137. package/build/esm/src/abis/RewardRouter.js +458 -0
  138. package/build/esm/src/abis/RewardTracker.js +413 -0
  139. package/build/esm/src/abis/SmartAccount.js +12 -0
  140. package/build/esm/src/abis/StBTC.js +511 -0
  141. package/build/esm/src/abis/SubaccountApproval.js +15 -0
  142. package/build/esm/src/abis/SubaccountGelatoRelayRouter.js +2017 -0
  143. package/build/esm/src/abis/SubaccountRouter.js +600 -0
  144. package/build/esm/src/abis/SyntheticsReader.js +4903 -0
  145. package/build/esm/src/abis/SyntheticsRouter.js +70 -0
  146. package/build/esm/src/abis/Timelock.js +776 -0
  147. package/build/esm/src/abis/Token.js +148 -0
  148. package/build/esm/src/abis/Treasury.js +204 -0
  149. package/build/esm/src/abis/UniPool.js +34 -0
  150. package/build/esm/src/abis/UniswapV2.js +285 -0
  151. package/build/esm/src/abis/UniswapV3Factory.js +198 -0
  152. package/build/esm/src/abis/UniswapV3Pool.js +983 -0
  153. package/build/esm/src/abis/UniswapV3PositionManager.js +989 -0
  154. package/build/esm/src/abis/Vault.js +1306 -0
  155. package/build/esm/src/abis/VaultReader.js +28 -0
  156. package/build/esm/src/abis/VaultV2.js +1220 -0
  157. package/build/esm/src/abis/VaultV2b.js +1306 -0
  158. package/build/esm/src/abis/VenusVToken.js +47 -0
  159. package/build/esm/src/abis/Vester.js +454 -0
  160. package/build/esm/src/abis/WETH.js +135 -0
  161. package/build/esm/src/abis/index.js +106 -118
  162. package/build/esm/src/configs/batch.js +14 -1
  163. package/build/esm/src/configs/chainIds.js +14 -0
  164. package/build/esm/src/configs/chains.js +15 -14
  165. package/build/esm/src/configs/contracts.js +59 -80
  166. package/build/esm/src/configs/dataStore.js +3 -6
  167. package/build/esm/src/configs/express.js +15 -2
  168. package/build/esm/src/configs/factors.js +1 -2
  169. package/build/esm/src/configs/markets.js +124 -0
  170. package/build/esm/src/configs/multichain.js +21 -0
  171. package/build/esm/src/configs/oracleKeeper.js +19 -4
  172. package/build/esm/src/configs/tokens.js +108 -4
  173. package/build/esm/src/configs/uniswapV3.js +13 -0
  174. package/build/esm/src/configs/venus.js +53 -0
  175. package/build/esm/src/modules/markets/index.js +36 -14
  176. package/build/esm/src/modules/markets/query-builders.js +6 -10
  177. package/build/esm/src/modules/orders/helpers.js +1 -0
  178. package/build/esm/src/modules/orders/transactions/createDecreaseOrderTxn.js +1 -0
  179. package/build/esm/src/modules/orders/transactions/createIncreaseOrderTxn.js +1 -0
  180. package/build/esm/src/modules/orders/transactions/createSwapOrderTxn.js +1 -0
  181. package/build/esm/src/modules/positions/positions.js +10 -2
  182. package/build/esm/src/modules/trades/trades.js +1 -1
  183. package/build/esm/src/prebuilt/hashedKinkModelMarketRatesKeys.json +88 -0
  184. package/build/esm/src/prebuilt/hashedMarketConfigKeys.json +907 -453
  185. package/build/esm/src/prebuilt/hashedMarketValuesKeys.json +165 -0
  186. package/build/esm/src/test/mock.js +3 -3
  187. package/build/esm/src/types/subsquid.js +192 -216
  188. package/build/esm/src/types/tradeHistory.js +6 -0
  189. package/build/esm/src/utils/LruCache.js +21 -17
  190. package/build/esm/src/utils/__tests__/LruCache.spec.js +11 -0
  191. package/build/esm/src/utils/__tests__/fees.spec.js +4 -4
  192. package/build/esm/src/utils/__tests__/{subgraph.spec.js → indexers.spec.js} +1 -1
  193. package/build/esm/src/utils/__tests__/numbers.spec.js +1 -1
  194. package/build/esm/src/utils/bigmath.js +3 -0
  195. package/build/esm/src/utils/buildUrl.js +1 -0
  196. package/build/esm/src/utils/errors/transactionsErrors.js +1 -0
  197. package/build/esm/src/utils/fees/index.js +5 -6
  198. package/build/esm/src/utils/fees/priceImpact.js +28 -19
  199. package/build/esm/src/utils/{subgraph.js → indexers.js} +15 -0
  200. package/build/esm/src/utils/marketKeysAndConfigs.js +8 -12
  201. package/build/esm/src/utils/markets.js +8 -0
  202. package/build/esm/src/utils/numbers.js +8 -4
  203. package/build/esm/src/utils/orderTransactions.js +5 -5
  204. package/build/esm/src/utils/orders.js +8 -1
  205. package/build/esm/src/utils/prices.js +0 -2
  206. package/build/esm/src/utils/swap/botanixStaking.js +3 -3
  207. package/build/esm/src/utils/swap/swapPath.js +1 -10
  208. package/build/esm/src/utils/swap/swapValues.js +15 -15
  209. package/build/esm/src/utils/trade/decrease.js +6 -9
  210. package/build/esm/src/utils/trade/increase.js +9 -8
  211. package/build/esm/src/utils/tradeHistory.js +3 -0
  212. package/build/types/src/abis/ArbitrumNodeInterface.d.ts +214 -0
  213. package/build/types/src/abis/ClaimHandler.d.ts +322 -0
  214. package/build/types/src/abis/CustomErrors.d.ts +3330 -0
  215. package/build/types/src/abis/DataStore.d.ts +1098 -0
  216. package/build/types/src/abis/ERC20PermitInterface.d.ts +90 -0
  217. package/build/types/src/abis/ERC721.d.ts +334 -0
  218. package/build/types/src/abis/EventEmitter.d.ts +1564 -0
  219. package/build/types/src/abis/ExchangeRouter.d.ts +1224 -0
  220. package/build/types/src/abis/GelatoRelayRouter.d.ts +1222 -0
  221. package/build/types/src/abis/GlpManager.d.ts +452 -0
  222. package/build/types/src/abis/GlvReader.d.ts +1131 -0
  223. package/build/types/src/abis/GlvRouter.d.ts +588 -0
  224. package/build/types/src/abis/GmxMigrator.d.ts +497 -0
  225. package/build/types/src/abis/GovToken.d.ts +588 -0
  226. package/build/types/src/abis/LayerZeroProvider.d.ts +285 -0
  227. package/build/types/src/abis/MintableBaseToken.d.ts +526 -0
  228. package/build/types/src/abis/Multicall.d.ts +323 -0
  229. package/build/types/src/abis/MultichainClaimsRouter.d.ts +973 -0
  230. package/build/types/src/abis/MultichainGlvRouter.d.ts +886 -0
  231. package/build/types/src/abis/MultichainGmRouter.d.ts +1118 -0
  232. package/build/types/src/abis/MultichainOrderRouter.d.ts +1557 -0
  233. package/build/types/src/abis/MultichainSubaccountRouter.d.ts +1606 -0
  234. package/build/types/src/abis/MultichainTransferRouter.d.ts +702 -0
  235. package/build/types/src/abis/MultichainUtils.d.ts +100 -0
  236. package/build/types/src/abis/MultichainVault.d.ts +208 -0
  237. package/build/types/src/abis/Reader.d.ts +264 -0
  238. package/build/types/src/abis/ReaderV2.d.ts +474 -0
  239. package/build/types/src/abis/ReferralStorage.d.ts +429 -0
  240. package/build/types/src/abis/RelayParams.d.ts +114 -0
  241. package/build/types/src/abis/RewardReader.d.ts +60 -0
  242. package/build/types/src/abis/RewardRouter.d.ts +790 -0
  243. package/build/types/src/abis/RewardTracker.d.ts +695 -0
  244. package/build/types/src/abis/SmartAccount.d.ts +20 -0
  245. package/build/types/src/abis/StBTC.d.ts +932 -0
  246. package/build/types/src/abis/SubaccountApproval.d.ts +29 -0
  247. package/build/types/src/abis/SubaccountGelatoRelayRouter.d.ts +1567 -0
  248. package/build/types/src/abis/SubaccountRouter.d.ts +465 -0
  249. package/build/types/src/abis/SyntheticsReader.d.ts +3780 -0
  250. package/build/types/src/abis/SyntheticsRouter.d.ts +54 -0
  251. package/build/types/src/abis/Timelock.d.ts +1356 -0
  252. package/build/types/src/abis/Token.d.ts +260 -0
  253. package/build/types/src/abis/Treasury.d.ts +312 -0
  254. package/build/types/src/abis/UniPool.d.ts +64 -0
  255. package/build/types/src/abis/UniswapV2.d.ts +511 -0
  256. package/build/types/src/abis/UniswapV3Factory.d.ts +154 -0
  257. package/build/types/src/abis/UniswapV3Pool.d.ts +771 -0
  258. package/build/types/src/abis/UniswapV3PositionManager.d.ts +767 -0
  259. package/build/types/src/abis/Vault.d.ts +2482 -0
  260. package/build/types/src/abis/VaultReader.d.ts +62 -0
  261. package/build/types/src/abis/VaultV2.d.ts +2327 -0
  262. package/build/types/src/abis/VaultV2b.d.ts +2482 -0
  263. package/build/types/src/abis/VenusVToken.d.ts +36 -0
  264. package/build/types/src/abis/Vester.d.ts +782 -0
  265. package/build/types/src/abis/WETH.d.ts +240 -0
  266. package/build/types/src/abis/index.d.ts +43288 -23
  267. package/build/types/src/configs/batch.d.ts +1 -0
  268. package/build/types/src/configs/chainIds.d.ts +10 -0
  269. package/build/types/src/configs/chains.d.ts +7 -12
  270. package/build/types/src/configs/contracts.d.ts +0 -21
  271. package/build/types/src/configs/dataStore.d.ts +2 -3
  272. package/build/types/src/configs/express.d.ts +4 -0
  273. package/build/types/src/configs/factors.d.ts +1 -2
  274. package/build/types/src/configs/markets.d.ts +3 -0
  275. package/build/types/src/configs/multichain.d.ts +5 -0
  276. package/build/types/src/configs/tokens.d.ts +1 -0
  277. package/build/types/src/configs/uniswapV3.d.ts +7 -0
  278. package/build/types/src/configs/venus.d.ts +16 -0
  279. package/build/types/src/index.d.ts +2 -2
  280. package/build/types/src/modules/base.d.ts +1 -1
  281. package/build/types/src/modules/markets/index.d.ts +1 -0
  282. package/build/types/src/modules/markets/query-builders.d.ts +2 -2
  283. package/build/types/src/modules/markets/types.d.ts +2 -2
  284. package/build/types/src/modules/orders/orders.d.ts +2 -2
  285. package/build/types/src/modules/orders/transactions/cancelOrdersTxn.d.ts +2 -2
  286. package/build/types/src/modules/orders/transactions/createDecreaseOrderTxn.d.ts +2 -1
  287. package/build/types/src/modules/orders/transactions/createIncreaseOrderTxn.d.ts +1 -0
  288. package/build/types/src/modules/orders/transactions/createSwapOrderTxn.d.ts +1 -0
  289. package/build/types/src/modules/orders/transactions/createWrapOrUnwrapTxn.d.ts +1 -1
  290. package/build/types/src/modules/orders/transactions/updateOrderTxn.d.ts +1 -1
  291. package/build/types/src/modules/orders/utils.d.ts +2 -2
  292. package/build/types/src/modules/positions/positions.d.ts +1 -1
  293. package/build/types/src/types/markets.d.ts +3 -3
  294. package/build/types/src/types/orders.d.ts +1 -0
  295. package/build/types/src/types/positions.d.ts +1 -0
  296. package/build/types/src/types/subsquid.d.ts +633 -305
  297. package/build/types/src/types/tokens.d.ts +15 -4
  298. package/build/types/src/types/trade.d.ts +1 -0
  299. package/build/types/src/types/tradeHistory.d.ts +5 -0
  300. package/build/types/src/utils/LruCache.d.ts +2 -2
  301. package/build/types/src/utils/bigmath.d.ts +1 -0
  302. package/build/types/src/utils/callContract.d.ts +1 -1
  303. package/build/types/src/utils/fees/priceImpact.d.ts +9 -3
  304. package/build/types/src/utils/hash.d.ts +1 -1
  305. package/build/types/src/utils/{subgraph.d.ts → indexers.d.ts} +1 -0
  306. package/build/types/src/utils/marketKeysAndConfigs.d.ts +2 -3
  307. package/build/types/src/utils/markets.d.ts +1 -0
  308. package/build/types/src/utils/numbers.d.ts +4 -0
  309. package/build/types/src/utils/orderTransactions.d.ts +7 -7
  310. package/build/types/src/utils/orders.d.ts +1 -0
  311. package/build/types/src/utils/prices.d.ts +0 -2
  312. package/build/types/src/utils/swap/swapPath.d.ts +0 -1
  313. package/build/types/src/utils/trade/decrease.d.ts +1 -0
  314. package/build/types/src/utils/trade/increase.d.ts +1 -0
  315. package/build/types/src/utils/tradeHistory.d.ts +1 -2
  316. package/package.json +6 -2
  317. package/build/cjs/src/abis/ArbitrumNodeInterface.json +0 -105
  318. package/build/cjs/src/abis/ClaimHandler.json +0 -424
  319. package/build/cjs/src/abis/CustomErrors.json +0 -4432
  320. package/build/cjs/src/abis/DataStore.json +0 -1459
  321. package/build/cjs/src/abis/ERC20PermitInterface.json +0 -118
  322. package/build/cjs/src/abis/ERC721.json +0 -442
  323. package/build/cjs/src/abis/EventEmitter.json +0 -2060
  324. package/build/cjs/src/abis/ExchangeRouter.json +0 -1706
  325. package/build/cjs/src/abis/GMT.json +0 -522
  326. package/build/cjs/src/abis/GelatoRelayRouter.json +0 -1579
  327. package/build/cjs/src/abis/GlpManager.json +0 -591
  328. package/build/cjs/src/abis/GlvReader.json +0 -1471
  329. package/build/cjs/src/abis/GlvRouter.json +0 -764
  330. package/build/cjs/src/abis/GmxMigrator.json +0 -657
  331. package/build/cjs/src/abis/GovToken.json +0 -768
  332. package/build/cjs/src/abis/LayerZeroProvider.json +0 -372
  333. package/build/cjs/src/abis/MintableBaseToken.json +0 -696
  334. package/build/cjs/src/abis/Multicall.json +0 -429
  335. package/build/cjs/src/abis/MultichainClaimsRouter.json +0 -1266
  336. package/build/cjs/src/abis/MultichainGlvRouter.json +0 -1150
  337. package/build/cjs/src/abis/MultichainGmRouter.json +0 -1449
  338. package/build/cjs/src/abis/MultichainOrderRouter.json +0 -1820
  339. package/build/cjs/src/abis/MultichainSubaccountRouter.json +0 -2069
  340. package/build/cjs/src/abis/MultichainTransferRouter.json +0 -915
  341. package/build/cjs/src/abis/MultichainUtils.json +0 -133
  342. package/build/cjs/src/abis/MultichainVault.json +0 -275
  343. package/build/cjs/src/abis/OrderBook.json +0 -1997
  344. package/build/cjs/src/abis/OrderBookReader.json +0 -111
  345. package/build/cjs/src/abis/OrderExecutor.json +0 -122
  346. package/build/cjs/src/abis/PositionManager.json +0 -1165
  347. package/build/cjs/src/abis/PositionRouter.json +0 -2030
  348. package/build/cjs/src/abis/Reader.json +0 -355
  349. package/build/cjs/src/abis/ReaderV2.json +0 -630
  350. package/build/cjs/src/abis/ReferralStorage.json +0 -557
  351. package/build/cjs/src/abis/RelayParams.json +0 -147
  352. package/build/cjs/src/abis/RewardReader.json +0 -86
  353. package/build/cjs/src/abis/RewardRouter.json +0 -1024
  354. package/build/cjs/src/abis/RewardTracker.json +0 -918
  355. package/build/cjs/src/abis/Router-v2.json +0 -605
  356. package/build/cjs/src/abis/Router.json +0 -605
  357. package/build/cjs/src/abis/SmartAccount.json +0 -28
  358. package/build/cjs/src/abis/StBTC.json +0 -1225
  359. package/build/cjs/src/abis/SubaccountApproval.json +0 -17
  360. package/build/cjs/src/abis/SubaccountGelatoRelayRouter.json +0 -2019
  361. package/build/cjs/src/abis/SubaccountRouter.json +0 -602
  362. package/build/cjs/src/abis/SyntheticsReader.json +0 -4905
  363. package/build/cjs/src/abis/SyntheticsRouter.json +0 -72
  364. package/build/cjs/src/abis/Timelock.json +0 -1737
  365. package/build/cjs/src/abis/Token.json +0 -345
  366. package/build/cjs/src/abis/Treasury.json +0 -411
  367. package/build/cjs/src/abis/UniPool.json +0 -89
  368. package/build/cjs/src/abis/UniswapV2.json +0 -1
  369. package/build/cjs/src/abis/Vault.json +0 -3220
  370. package/build/cjs/src/abis/VaultReader.json +0 -87
  371. package/build/cjs/src/abis/VaultV2.json +0 -3019
  372. package/build/cjs/src/abis/VaultV2b.json +0 -3220
  373. package/build/cjs/src/abis/Vester.json +0 -1031
  374. package/build/cjs/src/abis/WETH.json +0 -320
  375. package/build/cjs/src/abis/YieldFarm.json +0 -599
  376. package/build/cjs/src/abis/YieldToken.json +0 -560
  377. package/build/cjs/src/abis/__tests__/abis.spec.js +0 -40
  378. package/build/cjs/src/configs/__tests__/permits.spec.js +0 -109
  379. package/build/esm/src/abis/ArbitrumNodeInterface.json +0 -105
  380. package/build/esm/src/abis/ClaimHandler.json +0 -424
  381. package/build/esm/src/abis/CustomErrors.json +0 -4432
  382. package/build/esm/src/abis/DataStore.json +0 -1459
  383. package/build/esm/src/abis/ERC20PermitInterface.json +0 -118
  384. package/build/esm/src/abis/ERC721.json +0 -442
  385. package/build/esm/src/abis/EventEmitter.json +0 -2060
  386. package/build/esm/src/abis/ExchangeRouter.json +0 -1706
  387. package/build/esm/src/abis/GMT.json +0 -522
  388. package/build/esm/src/abis/GelatoRelayRouter.json +0 -1579
  389. package/build/esm/src/abis/GlpManager.json +0 -591
  390. package/build/esm/src/abis/GlvReader.json +0 -1471
  391. package/build/esm/src/abis/GlvRouter.json +0 -764
  392. package/build/esm/src/abis/GmxMigrator.json +0 -657
  393. package/build/esm/src/abis/GovToken.json +0 -768
  394. package/build/esm/src/abis/LayerZeroProvider.json +0 -372
  395. package/build/esm/src/abis/MintableBaseToken.json +0 -696
  396. package/build/esm/src/abis/Multicall.json +0 -429
  397. package/build/esm/src/abis/MultichainClaimsRouter.json +0 -1266
  398. package/build/esm/src/abis/MultichainGlvRouter.json +0 -1150
  399. package/build/esm/src/abis/MultichainGmRouter.json +0 -1449
  400. package/build/esm/src/abis/MultichainOrderRouter.json +0 -1820
  401. package/build/esm/src/abis/MultichainSubaccountRouter.json +0 -2069
  402. package/build/esm/src/abis/MultichainTransferRouter.json +0 -915
  403. package/build/esm/src/abis/MultichainUtils.json +0 -133
  404. package/build/esm/src/abis/MultichainVault.json +0 -275
  405. package/build/esm/src/abis/OrderBook.json +0 -1997
  406. package/build/esm/src/abis/OrderBookReader.json +0 -111
  407. package/build/esm/src/abis/OrderExecutor.json +0 -122
  408. package/build/esm/src/abis/PositionManager.json +0 -1165
  409. package/build/esm/src/abis/PositionRouter.json +0 -2030
  410. package/build/esm/src/abis/Reader.json +0 -355
  411. package/build/esm/src/abis/ReaderV2.json +0 -630
  412. package/build/esm/src/abis/ReferralStorage.json +0 -557
  413. package/build/esm/src/abis/RelayParams.json +0 -147
  414. package/build/esm/src/abis/RewardReader.json +0 -86
  415. package/build/esm/src/abis/RewardRouter.json +0 -1024
  416. package/build/esm/src/abis/RewardTracker.json +0 -918
  417. package/build/esm/src/abis/Router-v2.json +0 -605
  418. package/build/esm/src/abis/Router.json +0 -605
  419. package/build/esm/src/abis/SmartAccount.json +0 -28
  420. package/build/esm/src/abis/StBTC.json +0 -1225
  421. package/build/esm/src/abis/SubaccountApproval.json +0 -17
  422. package/build/esm/src/abis/SubaccountGelatoRelayRouter.json +0 -2019
  423. package/build/esm/src/abis/SubaccountRouter.json +0 -602
  424. package/build/esm/src/abis/SyntheticsReader.json +0 -4905
  425. package/build/esm/src/abis/SyntheticsRouter.json +0 -72
  426. package/build/esm/src/abis/Timelock.json +0 -1737
  427. package/build/esm/src/abis/Token.json +0 -345
  428. package/build/esm/src/abis/Treasury.json +0 -411
  429. package/build/esm/src/abis/UniPool.json +0 -89
  430. package/build/esm/src/abis/UniswapV2.json +0 -1
  431. package/build/esm/src/abis/Vault.json +0 -3220
  432. package/build/esm/src/abis/VaultReader.json +0 -87
  433. package/build/esm/src/abis/VaultV2.json +0 -3019
  434. package/build/esm/src/abis/VaultV2b.json +0 -3220
  435. package/build/esm/src/abis/Vester.json +0 -1031
  436. package/build/esm/src/abis/WETH.json +0 -320
  437. package/build/esm/src/abis/YieldFarm.json +0 -599
  438. package/build/esm/src/abis/YieldToken.json +0 -560
  439. package/build/esm/src/abis/__tests__/abis.spec.js +0 -35
  440. package/build/esm/src/configs/__tests__/permits.spec.js +0 -107
  441. package/build/types/src/configs/__tests__/permits.spec.d.ts +0 -1
  442. package/build/types/src/utils/__tests__/subgraph.spec.d.ts +0 -1
  443. /package/build/types/src/{abis/__tests__/abis.spec.d.ts → utils/__tests__/indexers.spec.d.ts} +0 -0
@@ -0,0 +1,4903 @@
1
+ export default [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: "contract DataStore",
6
+ name: "dataStore",
7
+ type: "address",
8
+ },
9
+ {
10
+ internalType: "address",
11
+ name: "account",
12
+ type: "address",
13
+ },
14
+ {
15
+ internalType: "uint256",
16
+ name: "start",
17
+ type: "uint256",
18
+ },
19
+ {
20
+ internalType: "uint256",
21
+ name: "end",
22
+ type: "uint256",
23
+ },
24
+ ],
25
+ name: "getAccountOrders",
26
+ outputs: [
27
+ {
28
+ components: [
29
+ {
30
+ internalType: "bytes32",
31
+ name: "orderKey",
32
+ type: "bytes32",
33
+ },
34
+ {
35
+ components: [
36
+ {
37
+ components: [
38
+ {
39
+ internalType: "address",
40
+ name: "account",
41
+ type: "address",
42
+ },
43
+ {
44
+ internalType: "address",
45
+ name: "receiver",
46
+ type: "address",
47
+ },
48
+ {
49
+ internalType: "address",
50
+ name: "cancellationReceiver",
51
+ type: "address",
52
+ },
53
+ {
54
+ internalType: "address",
55
+ name: "callbackContract",
56
+ type: "address",
57
+ },
58
+ {
59
+ internalType: "address",
60
+ name: "uiFeeReceiver",
61
+ type: "address",
62
+ },
63
+ {
64
+ internalType: "address",
65
+ name: "market",
66
+ type: "address",
67
+ },
68
+ {
69
+ internalType: "address",
70
+ name: "initialCollateralToken",
71
+ type: "address",
72
+ },
73
+ {
74
+ internalType: "address[]",
75
+ name: "swapPath",
76
+ type: "address[]",
77
+ },
78
+ ],
79
+ internalType: "struct Order.Addresses",
80
+ name: "addresses",
81
+ type: "tuple",
82
+ },
83
+ {
84
+ components: [
85
+ {
86
+ internalType: "enum Order.OrderType",
87
+ name: "orderType",
88
+ type: "uint8",
89
+ },
90
+ {
91
+ internalType: "enum Order.DecreasePositionSwapType",
92
+ name: "decreasePositionSwapType",
93
+ type: "uint8",
94
+ },
95
+ {
96
+ internalType: "uint256",
97
+ name: "sizeDeltaUsd",
98
+ type: "uint256",
99
+ },
100
+ {
101
+ internalType: "uint256",
102
+ name: "initialCollateralDeltaAmount",
103
+ type: "uint256",
104
+ },
105
+ {
106
+ internalType: "uint256",
107
+ name: "triggerPrice",
108
+ type: "uint256",
109
+ },
110
+ {
111
+ internalType: "uint256",
112
+ name: "acceptablePrice",
113
+ type: "uint256",
114
+ },
115
+ {
116
+ internalType: "uint256",
117
+ name: "executionFee",
118
+ type: "uint256",
119
+ },
120
+ {
121
+ internalType: "uint256",
122
+ name: "callbackGasLimit",
123
+ type: "uint256",
124
+ },
125
+ {
126
+ internalType: "uint256",
127
+ name: "minOutputAmount",
128
+ type: "uint256",
129
+ },
130
+ {
131
+ internalType: "uint256",
132
+ name: "updatedAtTime",
133
+ type: "uint256",
134
+ },
135
+ {
136
+ internalType: "uint256",
137
+ name: "validFromTime",
138
+ type: "uint256",
139
+ },
140
+ {
141
+ internalType: "uint256",
142
+ name: "srcChainId",
143
+ type: "uint256",
144
+ },
145
+ ],
146
+ internalType: "struct Order.Numbers",
147
+ name: "numbers",
148
+ type: "tuple",
149
+ },
150
+ {
151
+ components: [
152
+ {
153
+ internalType: "bool",
154
+ name: "isLong",
155
+ type: "bool",
156
+ },
157
+ {
158
+ internalType: "bool",
159
+ name: "shouldUnwrapNativeToken",
160
+ type: "bool",
161
+ },
162
+ {
163
+ internalType: "bool",
164
+ name: "isFrozen",
165
+ type: "bool",
166
+ },
167
+ {
168
+ internalType: "bool",
169
+ name: "autoCancel",
170
+ type: "bool",
171
+ },
172
+ ],
173
+ internalType: "struct Order.Flags",
174
+ name: "flags",
175
+ type: "tuple",
176
+ },
177
+ {
178
+ internalType: "bytes32[]",
179
+ name: "_dataList",
180
+ type: "bytes32[]",
181
+ },
182
+ ],
183
+ internalType: "struct Order.Props",
184
+ name: "order",
185
+ type: "tuple",
186
+ },
187
+ ],
188
+ internalType: "struct ReaderUtils.OrderInfo[]",
189
+ name: "",
190
+ type: "tuple[]",
191
+ },
192
+ ],
193
+ stateMutability: "view",
194
+ type: "function",
195
+ },
196
+ {
197
+ inputs: [
198
+ {
199
+ internalType: "contract DataStore",
200
+ name: "dataStore",
201
+ type: "address",
202
+ },
203
+ {
204
+ internalType: "contract IReferralStorage",
205
+ name: "referralStorage",
206
+ type: "address",
207
+ },
208
+ {
209
+ internalType: "address",
210
+ name: "account",
211
+ type: "address",
212
+ },
213
+ {
214
+ internalType: "address[]",
215
+ name: "markets",
216
+ type: "address[]",
217
+ },
218
+ {
219
+ components: [
220
+ {
221
+ components: [
222
+ {
223
+ internalType: "uint256",
224
+ name: "min",
225
+ type: "uint256",
226
+ },
227
+ {
228
+ internalType: "uint256",
229
+ name: "max",
230
+ type: "uint256",
231
+ },
232
+ ],
233
+ internalType: "struct Price.Props",
234
+ name: "indexTokenPrice",
235
+ type: "tuple",
236
+ },
237
+ {
238
+ components: [
239
+ {
240
+ internalType: "uint256",
241
+ name: "min",
242
+ type: "uint256",
243
+ },
244
+ {
245
+ internalType: "uint256",
246
+ name: "max",
247
+ type: "uint256",
248
+ },
249
+ ],
250
+ internalType: "struct Price.Props",
251
+ name: "longTokenPrice",
252
+ type: "tuple",
253
+ },
254
+ {
255
+ components: [
256
+ {
257
+ internalType: "uint256",
258
+ name: "min",
259
+ type: "uint256",
260
+ },
261
+ {
262
+ internalType: "uint256",
263
+ name: "max",
264
+ type: "uint256",
265
+ },
266
+ ],
267
+ internalType: "struct Price.Props",
268
+ name: "shortTokenPrice",
269
+ type: "tuple",
270
+ },
271
+ ],
272
+ internalType: "struct MarketUtils.MarketPrices[]",
273
+ name: "marketPrices",
274
+ type: "tuple[]",
275
+ },
276
+ {
277
+ internalType: "address",
278
+ name: "uiFeeReceiver",
279
+ type: "address",
280
+ },
281
+ {
282
+ internalType: "uint256",
283
+ name: "start",
284
+ type: "uint256",
285
+ },
286
+ {
287
+ internalType: "uint256",
288
+ name: "end",
289
+ type: "uint256",
290
+ },
291
+ ],
292
+ name: "getAccountPositionInfoList",
293
+ outputs: [
294
+ {
295
+ components: [
296
+ {
297
+ internalType: "bytes32",
298
+ name: "positionKey",
299
+ type: "bytes32",
300
+ },
301
+ {
302
+ components: [
303
+ {
304
+ components: [
305
+ {
306
+ internalType: "address",
307
+ name: "account",
308
+ type: "address",
309
+ },
310
+ {
311
+ internalType: "address",
312
+ name: "market",
313
+ type: "address",
314
+ },
315
+ {
316
+ internalType: "address",
317
+ name: "collateralToken",
318
+ type: "address",
319
+ },
320
+ ],
321
+ internalType: "struct Position.Addresses",
322
+ name: "addresses",
323
+ type: "tuple",
324
+ },
325
+ {
326
+ components: [
327
+ {
328
+ internalType: "uint256",
329
+ name: "sizeInUsd",
330
+ type: "uint256",
331
+ },
332
+ {
333
+ internalType: "uint256",
334
+ name: "sizeInTokens",
335
+ type: "uint256",
336
+ },
337
+ {
338
+ internalType: "uint256",
339
+ name: "collateralAmount",
340
+ type: "uint256",
341
+ },
342
+ {
343
+ internalType: "int256",
344
+ name: "pendingImpactAmount",
345
+ type: "int256",
346
+ },
347
+ {
348
+ internalType: "uint256",
349
+ name: "borrowingFactor",
350
+ type: "uint256",
351
+ },
352
+ {
353
+ internalType: "uint256",
354
+ name: "fundingFeeAmountPerSize",
355
+ type: "uint256",
356
+ },
357
+ {
358
+ internalType: "uint256",
359
+ name: "longTokenClaimableFundingAmountPerSize",
360
+ type: "uint256",
361
+ },
362
+ {
363
+ internalType: "uint256",
364
+ name: "shortTokenClaimableFundingAmountPerSize",
365
+ type: "uint256",
366
+ },
367
+ {
368
+ internalType: "uint256",
369
+ name: "increasedAtTime",
370
+ type: "uint256",
371
+ },
372
+ {
373
+ internalType: "uint256",
374
+ name: "decreasedAtTime",
375
+ type: "uint256",
376
+ },
377
+ ],
378
+ internalType: "struct Position.Numbers",
379
+ name: "numbers",
380
+ type: "tuple",
381
+ },
382
+ {
383
+ components: [
384
+ {
385
+ internalType: "bool",
386
+ name: "isLong",
387
+ type: "bool",
388
+ },
389
+ ],
390
+ internalType: "struct Position.Flags",
391
+ name: "flags",
392
+ type: "tuple",
393
+ },
394
+ ],
395
+ internalType: "struct Position.Props",
396
+ name: "position",
397
+ type: "tuple",
398
+ },
399
+ {
400
+ components: [
401
+ {
402
+ components: [
403
+ {
404
+ internalType: "bytes32",
405
+ name: "referralCode",
406
+ type: "bytes32",
407
+ },
408
+ {
409
+ internalType: "address",
410
+ name: "affiliate",
411
+ type: "address",
412
+ },
413
+ {
414
+ internalType: "address",
415
+ name: "trader",
416
+ type: "address",
417
+ },
418
+ {
419
+ internalType: "uint256",
420
+ name: "totalRebateFactor",
421
+ type: "uint256",
422
+ },
423
+ {
424
+ internalType: "uint256",
425
+ name: "affiliateRewardFactor",
426
+ type: "uint256",
427
+ },
428
+ {
429
+ internalType: "uint256",
430
+ name: "adjustedAffiliateRewardFactor",
431
+ type: "uint256",
432
+ },
433
+ {
434
+ internalType: "uint256",
435
+ name: "traderDiscountFactor",
436
+ type: "uint256",
437
+ },
438
+ {
439
+ internalType: "uint256",
440
+ name: "totalRebateAmount",
441
+ type: "uint256",
442
+ },
443
+ {
444
+ internalType: "uint256",
445
+ name: "traderDiscountAmount",
446
+ type: "uint256",
447
+ },
448
+ {
449
+ internalType: "uint256",
450
+ name: "affiliateRewardAmount",
451
+ type: "uint256",
452
+ },
453
+ ],
454
+ internalType: "struct PositionPricingUtils.PositionReferralFees",
455
+ name: "referral",
456
+ type: "tuple",
457
+ },
458
+ {
459
+ components: [
460
+ {
461
+ internalType: "uint256",
462
+ name: "traderTier",
463
+ type: "uint256",
464
+ },
465
+ {
466
+ internalType: "uint256",
467
+ name: "traderDiscountFactor",
468
+ type: "uint256",
469
+ },
470
+ {
471
+ internalType: "uint256",
472
+ name: "traderDiscountAmount",
473
+ type: "uint256",
474
+ },
475
+ ],
476
+ internalType: "struct PositionPricingUtils.PositionProFees",
477
+ name: "pro",
478
+ type: "tuple",
479
+ },
480
+ {
481
+ components: [
482
+ {
483
+ internalType: "uint256",
484
+ name: "fundingFeeAmount",
485
+ type: "uint256",
486
+ },
487
+ {
488
+ internalType: "uint256",
489
+ name: "claimableLongTokenAmount",
490
+ type: "uint256",
491
+ },
492
+ {
493
+ internalType: "uint256",
494
+ name: "claimableShortTokenAmount",
495
+ type: "uint256",
496
+ },
497
+ {
498
+ internalType: "uint256",
499
+ name: "latestFundingFeeAmountPerSize",
500
+ type: "uint256",
501
+ },
502
+ {
503
+ internalType: "uint256",
504
+ name: "latestLongTokenClaimableFundingAmountPerSize",
505
+ type: "uint256",
506
+ },
507
+ {
508
+ internalType: "uint256",
509
+ name: "latestShortTokenClaimableFundingAmountPerSize",
510
+ type: "uint256",
511
+ },
512
+ ],
513
+ internalType: "struct PositionPricingUtils.PositionFundingFees",
514
+ name: "funding",
515
+ type: "tuple",
516
+ },
517
+ {
518
+ components: [
519
+ {
520
+ internalType: "uint256",
521
+ name: "borrowingFeeUsd",
522
+ type: "uint256",
523
+ },
524
+ {
525
+ internalType: "uint256",
526
+ name: "borrowingFeeAmount",
527
+ type: "uint256",
528
+ },
529
+ {
530
+ internalType: "uint256",
531
+ name: "borrowingFeeReceiverFactor",
532
+ type: "uint256",
533
+ },
534
+ {
535
+ internalType: "uint256",
536
+ name: "borrowingFeeAmountForFeeReceiver",
537
+ type: "uint256",
538
+ },
539
+ ],
540
+ internalType: "struct PositionPricingUtils.PositionBorrowingFees",
541
+ name: "borrowing",
542
+ type: "tuple",
543
+ },
544
+ {
545
+ components: [
546
+ {
547
+ internalType: "address",
548
+ name: "uiFeeReceiver",
549
+ type: "address",
550
+ },
551
+ {
552
+ internalType: "uint256",
553
+ name: "uiFeeReceiverFactor",
554
+ type: "uint256",
555
+ },
556
+ {
557
+ internalType: "uint256",
558
+ name: "uiFeeAmount",
559
+ type: "uint256",
560
+ },
561
+ ],
562
+ internalType: "struct PositionPricingUtils.PositionUiFees",
563
+ name: "ui",
564
+ type: "tuple",
565
+ },
566
+ {
567
+ components: [
568
+ {
569
+ internalType: "uint256",
570
+ name: "liquidationFeeUsd",
571
+ type: "uint256",
572
+ },
573
+ {
574
+ internalType: "uint256",
575
+ name: "liquidationFeeAmount",
576
+ type: "uint256",
577
+ },
578
+ {
579
+ internalType: "uint256",
580
+ name: "liquidationFeeReceiverFactor",
581
+ type: "uint256",
582
+ },
583
+ {
584
+ internalType: "uint256",
585
+ name: "liquidationFeeAmountForFeeReceiver",
586
+ type: "uint256",
587
+ },
588
+ ],
589
+ internalType: "struct PositionPricingUtils.PositionLiquidationFees",
590
+ name: "liquidation",
591
+ type: "tuple",
592
+ },
593
+ {
594
+ components: [
595
+ {
596
+ internalType: "uint256",
597
+ name: "min",
598
+ type: "uint256",
599
+ },
600
+ {
601
+ internalType: "uint256",
602
+ name: "max",
603
+ type: "uint256",
604
+ },
605
+ ],
606
+ internalType: "struct Price.Props",
607
+ name: "collateralTokenPrice",
608
+ type: "tuple",
609
+ },
610
+ {
611
+ internalType: "uint256",
612
+ name: "positionFeeFactor",
613
+ type: "uint256",
614
+ },
615
+ {
616
+ internalType: "uint256",
617
+ name: "protocolFeeAmount",
618
+ type: "uint256",
619
+ },
620
+ {
621
+ internalType: "uint256",
622
+ name: "positionFeeReceiverFactor",
623
+ type: "uint256",
624
+ },
625
+ {
626
+ internalType: "uint256",
627
+ name: "feeReceiverAmount",
628
+ type: "uint256",
629
+ },
630
+ {
631
+ internalType: "uint256",
632
+ name: "feeAmountForPool",
633
+ type: "uint256",
634
+ },
635
+ {
636
+ internalType: "uint256",
637
+ name: "positionFeeAmountForPool",
638
+ type: "uint256",
639
+ },
640
+ {
641
+ internalType: "uint256",
642
+ name: "positionFeeAmount",
643
+ type: "uint256",
644
+ },
645
+ {
646
+ internalType: "uint256",
647
+ name: "totalCostAmountExcludingFunding",
648
+ type: "uint256",
649
+ },
650
+ {
651
+ internalType: "uint256",
652
+ name: "totalCostAmount",
653
+ type: "uint256",
654
+ },
655
+ {
656
+ internalType: "uint256",
657
+ name: "totalDiscountAmount",
658
+ type: "uint256",
659
+ },
660
+ ],
661
+ internalType: "struct PositionPricingUtils.PositionFees",
662
+ name: "fees",
663
+ type: "tuple",
664
+ },
665
+ {
666
+ components: [
667
+ {
668
+ internalType: "int256",
669
+ name: "priceImpactUsd",
670
+ type: "int256",
671
+ },
672
+ {
673
+ internalType: "uint256",
674
+ name: "executionPrice",
675
+ type: "uint256",
676
+ },
677
+ {
678
+ internalType: "bool",
679
+ name: "balanceWasImproved",
680
+ type: "bool",
681
+ },
682
+ {
683
+ internalType: "int256",
684
+ name: "proportionalPendingImpactUsd",
685
+ type: "int256",
686
+ },
687
+ {
688
+ internalType: "int256",
689
+ name: "totalImpactUsd",
690
+ type: "int256",
691
+ },
692
+ {
693
+ internalType: "uint256",
694
+ name: "priceImpactDiffUsd",
695
+ type: "uint256",
696
+ },
697
+ ],
698
+ internalType: "struct ReaderPricingUtils.ExecutionPriceResult",
699
+ name: "executionPriceResult",
700
+ type: "tuple",
701
+ },
702
+ {
703
+ internalType: "int256",
704
+ name: "basePnlUsd",
705
+ type: "int256",
706
+ },
707
+ {
708
+ internalType: "int256",
709
+ name: "uncappedBasePnlUsd",
710
+ type: "int256",
711
+ },
712
+ {
713
+ internalType: "int256",
714
+ name: "pnlAfterPriceImpactUsd",
715
+ type: "int256",
716
+ },
717
+ ],
718
+ internalType: "struct ReaderPositionUtils.PositionInfo[]",
719
+ name: "",
720
+ type: "tuple[]",
721
+ },
722
+ ],
723
+ stateMutability: "view",
724
+ type: "function",
725
+ },
726
+ {
727
+ inputs: [
728
+ {
729
+ internalType: "contract DataStore",
730
+ name: "dataStore",
731
+ type: "address",
732
+ },
733
+ {
734
+ internalType: "address",
735
+ name: "account",
736
+ type: "address",
737
+ },
738
+ {
739
+ internalType: "uint256",
740
+ name: "start",
741
+ type: "uint256",
742
+ },
743
+ {
744
+ internalType: "uint256",
745
+ name: "end",
746
+ type: "uint256",
747
+ },
748
+ ],
749
+ name: "getAccountPositions",
750
+ outputs: [
751
+ {
752
+ components: [
753
+ {
754
+ components: [
755
+ {
756
+ internalType: "address",
757
+ name: "account",
758
+ type: "address",
759
+ },
760
+ {
761
+ internalType: "address",
762
+ name: "market",
763
+ type: "address",
764
+ },
765
+ {
766
+ internalType: "address",
767
+ name: "collateralToken",
768
+ type: "address",
769
+ },
770
+ ],
771
+ internalType: "struct Position.Addresses",
772
+ name: "addresses",
773
+ type: "tuple",
774
+ },
775
+ {
776
+ components: [
777
+ {
778
+ internalType: "uint256",
779
+ name: "sizeInUsd",
780
+ type: "uint256",
781
+ },
782
+ {
783
+ internalType: "uint256",
784
+ name: "sizeInTokens",
785
+ type: "uint256",
786
+ },
787
+ {
788
+ internalType: "uint256",
789
+ name: "collateralAmount",
790
+ type: "uint256",
791
+ },
792
+ {
793
+ internalType: "int256",
794
+ name: "pendingImpactAmount",
795
+ type: "int256",
796
+ },
797
+ {
798
+ internalType: "uint256",
799
+ name: "borrowingFactor",
800
+ type: "uint256",
801
+ },
802
+ {
803
+ internalType: "uint256",
804
+ name: "fundingFeeAmountPerSize",
805
+ type: "uint256",
806
+ },
807
+ {
808
+ internalType: "uint256",
809
+ name: "longTokenClaimableFundingAmountPerSize",
810
+ type: "uint256",
811
+ },
812
+ {
813
+ internalType: "uint256",
814
+ name: "shortTokenClaimableFundingAmountPerSize",
815
+ type: "uint256",
816
+ },
817
+ {
818
+ internalType: "uint256",
819
+ name: "increasedAtTime",
820
+ type: "uint256",
821
+ },
822
+ {
823
+ internalType: "uint256",
824
+ name: "decreasedAtTime",
825
+ type: "uint256",
826
+ },
827
+ ],
828
+ internalType: "struct Position.Numbers",
829
+ name: "numbers",
830
+ type: "tuple",
831
+ },
832
+ {
833
+ components: [
834
+ {
835
+ internalType: "bool",
836
+ name: "isLong",
837
+ type: "bool",
838
+ },
839
+ ],
840
+ internalType: "struct Position.Flags",
841
+ name: "flags",
842
+ type: "tuple",
843
+ },
844
+ ],
845
+ internalType: "struct Position.Props[]",
846
+ name: "",
847
+ type: "tuple[]",
848
+ },
849
+ ],
850
+ stateMutability: "view",
851
+ type: "function",
852
+ },
853
+ {
854
+ inputs: [
855
+ {
856
+ internalType: "contract DataStore",
857
+ name: "dataStore",
858
+ type: "address",
859
+ },
860
+ {
861
+ internalType: "address",
862
+ name: "market",
863
+ type: "address",
864
+ },
865
+ {
866
+ internalType: "bool",
867
+ name: "isLong",
868
+ type: "bool",
869
+ },
870
+ {
871
+ components: [
872
+ {
873
+ components: [
874
+ {
875
+ internalType: "uint256",
876
+ name: "min",
877
+ type: "uint256",
878
+ },
879
+ {
880
+ internalType: "uint256",
881
+ name: "max",
882
+ type: "uint256",
883
+ },
884
+ ],
885
+ internalType: "struct Price.Props",
886
+ name: "indexTokenPrice",
887
+ type: "tuple",
888
+ },
889
+ {
890
+ components: [
891
+ {
892
+ internalType: "uint256",
893
+ name: "min",
894
+ type: "uint256",
895
+ },
896
+ {
897
+ internalType: "uint256",
898
+ name: "max",
899
+ type: "uint256",
900
+ },
901
+ ],
902
+ internalType: "struct Price.Props",
903
+ name: "longTokenPrice",
904
+ type: "tuple",
905
+ },
906
+ {
907
+ components: [
908
+ {
909
+ internalType: "uint256",
910
+ name: "min",
911
+ type: "uint256",
912
+ },
913
+ {
914
+ internalType: "uint256",
915
+ name: "max",
916
+ type: "uint256",
917
+ },
918
+ ],
919
+ internalType: "struct Price.Props",
920
+ name: "shortTokenPrice",
921
+ type: "tuple",
922
+ },
923
+ ],
924
+ internalType: "struct MarketUtils.MarketPrices",
925
+ name: "prices",
926
+ type: "tuple",
927
+ },
928
+ ],
929
+ name: "getAdlState",
930
+ outputs: [
931
+ {
932
+ internalType: "uint256",
933
+ name: "",
934
+ type: "uint256",
935
+ },
936
+ {
937
+ internalType: "bool",
938
+ name: "",
939
+ type: "bool",
940
+ },
941
+ {
942
+ internalType: "int256",
943
+ name: "",
944
+ type: "int256",
945
+ },
946
+ {
947
+ internalType: "uint256",
948
+ name: "",
949
+ type: "uint256",
950
+ },
951
+ ],
952
+ stateMutability: "view",
953
+ type: "function",
954
+ },
955
+ {
956
+ inputs: [
957
+ {
958
+ internalType: "contract DataStore",
959
+ name: "dataStore",
960
+ type: "address",
961
+ },
962
+ {
963
+ internalType: "bytes32",
964
+ name: "key",
965
+ type: "bytes32",
966
+ },
967
+ ],
968
+ name: "getDeposit",
969
+ outputs: [
970
+ {
971
+ components: [
972
+ {
973
+ components: [
974
+ {
975
+ internalType: "address",
976
+ name: "account",
977
+ type: "address",
978
+ },
979
+ {
980
+ internalType: "address",
981
+ name: "receiver",
982
+ type: "address",
983
+ },
984
+ {
985
+ internalType: "address",
986
+ name: "callbackContract",
987
+ type: "address",
988
+ },
989
+ {
990
+ internalType: "address",
991
+ name: "uiFeeReceiver",
992
+ type: "address",
993
+ },
994
+ {
995
+ internalType: "address",
996
+ name: "market",
997
+ type: "address",
998
+ },
999
+ {
1000
+ internalType: "address",
1001
+ name: "initialLongToken",
1002
+ type: "address",
1003
+ },
1004
+ {
1005
+ internalType: "address",
1006
+ name: "initialShortToken",
1007
+ type: "address",
1008
+ },
1009
+ {
1010
+ internalType: "address[]",
1011
+ name: "longTokenSwapPath",
1012
+ type: "address[]",
1013
+ },
1014
+ {
1015
+ internalType: "address[]",
1016
+ name: "shortTokenSwapPath",
1017
+ type: "address[]",
1018
+ },
1019
+ ],
1020
+ internalType: "struct Deposit.Addresses",
1021
+ name: "addresses",
1022
+ type: "tuple",
1023
+ },
1024
+ {
1025
+ components: [
1026
+ {
1027
+ internalType: "uint256",
1028
+ name: "initialLongTokenAmount",
1029
+ type: "uint256",
1030
+ },
1031
+ {
1032
+ internalType: "uint256",
1033
+ name: "initialShortTokenAmount",
1034
+ type: "uint256",
1035
+ },
1036
+ {
1037
+ internalType: "uint256",
1038
+ name: "minMarketTokens",
1039
+ type: "uint256",
1040
+ },
1041
+ {
1042
+ internalType: "uint256",
1043
+ name: "updatedAtTime",
1044
+ type: "uint256",
1045
+ },
1046
+ {
1047
+ internalType: "uint256",
1048
+ name: "executionFee",
1049
+ type: "uint256",
1050
+ },
1051
+ {
1052
+ internalType: "uint256",
1053
+ name: "callbackGasLimit",
1054
+ type: "uint256",
1055
+ },
1056
+ {
1057
+ internalType: "uint256",
1058
+ name: "srcChainId",
1059
+ type: "uint256",
1060
+ },
1061
+ ],
1062
+ internalType: "struct Deposit.Numbers",
1063
+ name: "numbers",
1064
+ type: "tuple",
1065
+ },
1066
+ {
1067
+ components: [
1068
+ {
1069
+ internalType: "bool",
1070
+ name: "shouldUnwrapNativeToken",
1071
+ type: "bool",
1072
+ },
1073
+ ],
1074
+ internalType: "struct Deposit.Flags",
1075
+ name: "flags",
1076
+ type: "tuple",
1077
+ },
1078
+ {
1079
+ internalType: "bytes32[]",
1080
+ name: "_dataList",
1081
+ type: "bytes32[]",
1082
+ },
1083
+ ],
1084
+ internalType: "struct Deposit.Props",
1085
+ name: "",
1086
+ type: "tuple",
1087
+ },
1088
+ ],
1089
+ stateMutability: "view",
1090
+ type: "function",
1091
+ },
1092
+ {
1093
+ inputs: [
1094
+ {
1095
+ internalType: "contract DataStore",
1096
+ name: "dataStore",
1097
+ type: "address",
1098
+ },
1099
+ {
1100
+ components: [
1101
+ {
1102
+ internalType: "address",
1103
+ name: "marketToken",
1104
+ type: "address",
1105
+ },
1106
+ {
1107
+ internalType: "address",
1108
+ name: "indexToken",
1109
+ type: "address",
1110
+ },
1111
+ {
1112
+ internalType: "address",
1113
+ name: "longToken",
1114
+ type: "address",
1115
+ },
1116
+ {
1117
+ internalType: "address",
1118
+ name: "shortToken",
1119
+ type: "address",
1120
+ },
1121
+ ],
1122
+ internalType: "struct Market.Props",
1123
+ name: "market",
1124
+ type: "tuple",
1125
+ },
1126
+ {
1127
+ components: [
1128
+ {
1129
+ components: [
1130
+ {
1131
+ internalType: "uint256",
1132
+ name: "min",
1133
+ type: "uint256",
1134
+ },
1135
+ {
1136
+ internalType: "uint256",
1137
+ name: "max",
1138
+ type: "uint256",
1139
+ },
1140
+ ],
1141
+ internalType: "struct Price.Props",
1142
+ name: "indexTokenPrice",
1143
+ type: "tuple",
1144
+ },
1145
+ {
1146
+ components: [
1147
+ {
1148
+ internalType: "uint256",
1149
+ name: "min",
1150
+ type: "uint256",
1151
+ },
1152
+ {
1153
+ internalType: "uint256",
1154
+ name: "max",
1155
+ type: "uint256",
1156
+ },
1157
+ ],
1158
+ internalType: "struct Price.Props",
1159
+ name: "longTokenPrice",
1160
+ type: "tuple",
1161
+ },
1162
+ {
1163
+ components: [
1164
+ {
1165
+ internalType: "uint256",
1166
+ name: "min",
1167
+ type: "uint256",
1168
+ },
1169
+ {
1170
+ internalType: "uint256",
1171
+ name: "max",
1172
+ type: "uint256",
1173
+ },
1174
+ ],
1175
+ internalType: "struct Price.Props",
1176
+ name: "shortTokenPrice",
1177
+ type: "tuple",
1178
+ },
1179
+ ],
1180
+ internalType: "struct MarketUtils.MarketPrices",
1181
+ name: "prices",
1182
+ type: "tuple",
1183
+ },
1184
+ {
1185
+ internalType: "uint256",
1186
+ name: "longTokenAmount",
1187
+ type: "uint256",
1188
+ },
1189
+ {
1190
+ internalType: "uint256",
1191
+ name: "shortTokenAmount",
1192
+ type: "uint256",
1193
+ },
1194
+ {
1195
+ internalType: "address",
1196
+ name: "uiFeeReceiver",
1197
+ type: "address",
1198
+ },
1199
+ {
1200
+ internalType: "enum ISwapPricingUtils.SwapPricingType",
1201
+ name: "swapPricingType",
1202
+ type: "uint8",
1203
+ },
1204
+ {
1205
+ internalType: "bool",
1206
+ name: "includeVirtualInventoryImpact",
1207
+ type: "bool",
1208
+ },
1209
+ ],
1210
+ name: "getDepositAmountOut",
1211
+ outputs: [
1212
+ {
1213
+ internalType: "uint256",
1214
+ name: "",
1215
+ type: "uint256",
1216
+ },
1217
+ ],
1218
+ stateMutability: "view",
1219
+ type: "function",
1220
+ },
1221
+ {
1222
+ inputs: [
1223
+ {
1224
+ internalType: "contract DataStore",
1225
+ name: "dataStore",
1226
+ type: "address",
1227
+ },
1228
+ {
1229
+ internalType: "address",
1230
+ name: "marketKey",
1231
+ type: "address",
1232
+ },
1233
+ {
1234
+ components: [
1235
+ {
1236
+ components: [
1237
+ {
1238
+ internalType: "uint256",
1239
+ name: "min",
1240
+ type: "uint256",
1241
+ },
1242
+ {
1243
+ internalType: "uint256",
1244
+ name: "max",
1245
+ type: "uint256",
1246
+ },
1247
+ ],
1248
+ internalType: "struct Price.Props",
1249
+ name: "indexTokenPrice",
1250
+ type: "tuple",
1251
+ },
1252
+ {
1253
+ components: [
1254
+ {
1255
+ internalType: "uint256",
1256
+ name: "min",
1257
+ type: "uint256",
1258
+ },
1259
+ {
1260
+ internalType: "uint256",
1261
+ name: "max",
1262
+ type: "uint256",
1263
+ },
1264
+ ],
1265
+ internalType: "struct Price.Props",
1266
+ name: "longTokenPrice",
1267
+ type: "tuple",
1268
+ },
1269
+ {
1270
+ components: [
1271
+ {
1272
+ internalType: "uint256",
1273
+ name: "min",
1274
+ type: "uint256",
1275
+ },
1276
+ {
1277
+ internalType: "uint256",
1278
+ name: "max",
1279
+ type: "uint256",
1280
+ },
1281
+ ],
1282
+ internalType: "struct Price.Props",
1283
+ name: "shortTokenPrice",
1284
+ type: "tuple",
1285
+ },
1286
+ ],
1287
+ internalType: "struct MarketUtils.MarketPrices",
1288
+ name: "prices",
1289
+ type: "tuple",
1290
+ },
1291
+ {
1292
+ internalType: "uint256",
1293
+ name: "positionSizeInUsd",
1294
+ type: "uint256",
1295
+ },
1296
+ {
1297
+ internalType: "uint256",
1298
+ name: "positionSizeInTokens",
1299
+ type: "uint256",
1300
+ },
1301
+ {
1302
+ internalType: "int256",
1303
+ name: "sizeDeltaUsd",
1304
+ type: "int256",
1305
+ },
1306
+ {
1307
+ internalType: "int256",
1308
+ name: "pendingImpactAmount",
1309
+ type: "int256",
1310
+ },
1311
+ {
1312
+ internalType: "bool",
1313
+ name: "isLong",
1314
+ type: "bool",
1315
+ },
1316
+ ],
1317
+ name: "getExecutionPrice",
1318
+ outputs: [
1319
+ {
1320
+ components: [
1321
+ {
1322
+ internalType: "int256",
1323
+ name: "priceImpactUsd",
1324
+ type: "int256",
1325
+ },
1326
+ {
1327
+ internalType: "uint256",
1328
+ name: "executionPrice",
1329
+ type: "uint256",
1330
+ },
1331
+ {
1332
+ internalType: "bool",
1333
+ name: "balanceWasImproved",
1334
+ type: "bool",
1335
+ },
1336
+ {
1337
+ internalType: "int256",
1338
+ name: "proportionalPendingImpactUsd",
1339
+ type: "int256",
1340
+ },
1341
+ {
1342
+ internalType: "int256",
1343
+ name: "totalImpactUsd",
1344
+ type: "int256",
1345
+ },
1346
+ {
1347
+ internalType: "uint256",
1348
+ name: "priceImpactDiffUsd",
1349
+ type: "uint256",
1350
+ },
1351
+ ],
1352
+ internalType: "struct ReaderPricingUtils.ExecutionPriceResult",
1353
+ name: "",
1354
+ type: "tuple",
1355
+ },
1356
+ ],
1357
+ stateMutability: "view",
1358
+ type: "function",
1359
+ },
1360
+ {
1361
+ inputs: [
1362
+ {
1363
+ internalType: "contract DataStore",
1364
+ name: "dataStore",
1365
+ type: "address",
1366
+ },
1367
+ {
1368
+ internalType: "address",
1369
+ name: "key",
1370
+ type: "address",
1371
+ },
1372
+ ],
1373
+ name: "getMarket",
1374
+ outputs: [
1375
+ {
1376
+ components: [
1377
+ {
1378
+ internalType: "address",
1379
+ name: "marketToken",
1380
+ type: "address",
1381
+ },
1382
+ {
1383
+ internalType: "address",
1384
+ name: "indexToken",
1385
+ type: "address",
1386
+ },
1387
+ {
1388
+ internalType: "address",
1389
+ name: "longToken",
1390
+ type: "address",
1391
+ },
1392
+ {
1393
+ internalType: "address",
1394
+ name: "shortToken",
1395
+ type: "address",
1396
+ },
1397
+ ],
1398
+ internalType: "struct Market.Props",
1399
+ name: "",
1400
+ type: "tuple",
1401
+ },
1402
+ ],
1403
+ stateMutability: "view",
1404
+ type: "function",
1405
+ },
1406
+ {
1407
+ inputs: [
1408
+ {
1409
+ internalType: "contract DataStore",
1410
+ name: "dataStore",
1411
+ type: "address",
1412
+ },
1413
+ {
1414
+ internalType: "bytes32",
1415
+ name: "salt",
1416
+ type: "bytes32",
1417
+ },
1418
+ ],
1419
+ name: "getMarketBySalt",
1420
+ outputs: [
1421
+ {
1422
+ components: [
1423
+ {
1424
+ internalType: "address",
1425
+ name: "marketToken",
1426
+ type: "address",
1427
+ },
1428
+ {
1429
+ internalType: "address",
1430
+ name: "indexToken",
1431
+ type: "address",
1432
+ },
1433
+ {
1434
+ internalType: "address",
1435
+ name: "longToken",
1436
+ type: "address",
1437
+ },
1438
+ {
1439
+ internalType: "address",
1440
+ name: "shortToken",
1441
+ type: "address",
1442
+ },
1443
+ ],
1444
+ internalType: "struct Market.Props",
1445
+ name: "",
1446
+ type: "tuple",
1447
+ },
1448
+ ],
1449
+ stateMutability: "view",
1450
+ type: "function",
1451
+ },
1452
+ {
1453
+ inputs: [
1454
+ {
1455
+ internalType: "contract DataStore",
1456
+ name: "dataStore",
1457
+ type: "address",
1458
+ },
1459
+ {
1460
+ components: [
1461
+ {
1462
+ components: [
1463
+ {
1464
+ internalType: "uint256",
1465
+ name: "min",
1466
+ type: "uint256",
1467
+ },
1468
+ {
1469
+ internalType: "uint256",
1470
+ name: "max",
1471
+ type: "uint256",
1472
+ },
1473
+ ],
1474
+ internalType: "struct Price.Props",
1475
+ name: "indexTokenPrice",
1476
+ type: "tuple",
1477
+ },
1478
+ {
1479
+ components: [
1480
+ {
1481
+ internalType: "uint256",
1482
+ name: "min",
1483
+ type: "uint256",
1484
+ },
1485
+ {
1486
+ internalType: "uint256",
1487
+ name: "max",
1488
+ type: "uint256",
1489
+ },
1490
+ ],
1491
+ internalType: "struct Price.Props",
1492
+ name: "longTokenPrice",
1493
+ type: "tuple",
1494
+ },
1495
+ {
1496
+ components: [
1497
+ {
1498
+ internalType: "uint256",
1499
+ name: "min",
1500
+ type: "uint256",
1501
+ },
1502
+ {
1503
+ internalType: "uint256",
1504
+ name: "max",
1505
+ type: "uint256",
1506
+ },
1507
+ ],
1508
+ internalType: "struct Price.Props",
1509
+ name: "shortTokenPrice",
1510
+ type: "tuple",
1511
+ },
1512
+ ],
1513
+ internalType: "struct MarketUtils.MarketPrices",
1514
+ name: "prices",
1515
+ type: "tuple",
1516
+ },
1517
+ {
1518
+ internalType: "address",
1519
+ name: "marketKey",
1520
+ type: "address",
1521
+ },
1522
+ ],
1523
+ name: "getMarketInfo",
1524
+ outputs: [
1525
+ {
1526
+ components: [
1527
+ {
1528
+ components: [
1529
+ {
1530
+ internalType: "address",
1531
+ name: "marketToken",
1532
+ type: "address",
1533
+ },
1534
+ {
1535
+ internalType: "address",
1536
+ name: "indexToken",
1537
+ type: "address",
1538
+ },
1539
+ {
1540
+ internalType: "address",
1541
+ name: "longToken",
1542
+ type: "address",
1543
+ },
1544
+ {
1545
+ internalType: "address",
1546
+ name: "shortToken",
1547
+ type: "address",
1548
+ },
1549
+ ],
1550
+ internalType: "struct Market.Props",
1551
+ name: "market",
1552
+ type: "tuple",
1553
+ },
1554
+ {
1555
+ internalType: "uint256",
1556
+ name: "borrowingFactorPerSecondForLongs",
1557
+ type: "uint256",
1558
+ },
1559
+ {
1560
+ internalType: "uint256",
1561
+ name: "borrowingFactorPerSecondForShorts",
1562
+ type: "uint256",
1563
+ },
1564
+ {
1565
+ components: [
1566
+ {
1567
+ components: [
1568
+ {
1569
+ components: [
1570
+ {
1571
+ internalType: "uint256",
1572
+ name: "longToken",
1573
+ type: "uint256",
1574
+ },
1575
+ {
1576
+ internalType: "uint256",
1577
+ name: "shortToken",
1578
+ type: "uint256",
1579
+ },
1580
+ ],
1581
+ internalType: "struct MarketUtils.CollateralType",
1582
+ name: "long",
1583
+ type: "tuple",
1584
+ },
1585
+ {
1586
+ components: [
1587
+ {
1588
+ internalType: "uint256",
1589
+ name: "longToken",
1590
+ type: "uint256",
1591
+ },
1592
+ {
1593
+ internalType: "uint256",
1594
+ name: "shortToken",
1595
+ type: "uint256",
1596
+ },
1597
+ ],
1598
+ internalType: "struct MarketUtils.CollateralType",
1599
+ name: "short",
1600
+ type: "tuple",
1601
+ },
1602
+ ],
1603
+ internalType: "struct MarketUtils.PositionType",
1604
+ name: "fundingFeeAmountPerSize",
1605
+ type: "tuple",
1606
+ },
1607
+ {
1608
+ components: [
1609
+ {
1610
+ components: [
1611
+ {
1612
+ internalType: "uint256",
1613
+ name: "longToken",
1614
+ type: "uint256",
1615
+ },
1616
+ {
1617
+ internalType: "uint256",
1618
+ name: "shortToken",
1619
+ type: "uint256",
1620
+ },
1621
+ ],
1622
+ internalType: "struct MarketUtils.CollateralType",
1623
+ name: "long",
1624
+ type: "tuple",
1625
+ },
1626
+ {
1627
+ components: [
1628
+ {
1629
+ internalType: "uint256",
1630
+ name: "longToken",
1631
+ type: "uint256",
1632
+ },
1633
+ {
1634
+ internalType: "uint256",
1635
+ name: "shortToken",
1636
+ type: "uint256",
1637
+ },
1638
+ ],
1639
+ internalType: "struct MarketUtils.CollateralType",
1640
+ name: "short",
1641
+ type: "tuple",
1642
+ },
1643
+ ],
1644
+ internalType: "struct MarketUtils.PositionType",
1645
+ name: "claimableFundingAmountPerSize",
1646
+ type: "tuple",
1647
+ },
1648
+ ],
1649
+ internalType: "struct ReaderUtils.BaseFundingValues",
1650
+ name: "baseFunding",
1651
+ type: "tuple",
1652
+ },
1653
+ {
1654
+ components: [
1655
+ {
1656
+ internalType: "bool",
1657
+ name: "longsPayShorts",
1658
+ type: "bool",
1659
+ },
1660
+ {
1661
+ internalType: "uint256",
1662
+ name: "fundingFactorPerSecond",
1663
+ type: "uint256",
1664
+ },
1665
+ {
1666
+ internalType: "int256",
1667
+ name: "nextSavedFundingFactorPerSecond",
1668
+ type: "int256",
1669
+ },
1670
+ {
1671
+ components: [
1672
+ {
1673
+ components: [
1674
+ {
1675
+ internalType: "uint256",
1676
+ name: "longToken",
1677
+ type: "uint256",
1678
+ },
1679
+ {
1680
+ internalType: "uint256",
1681
+ name: "shortToken",
1682
+ type: "uint256",
1683
+ },
1684
+ ],
1685
+ internalType: "struct MarketUtils.CollateralType",
1686
+ name: "long",
1687
+ type: "tuple",
1688
+ },
1689
+ {
1690
+ components: [
1691
+ {
1692
+ internalType: "uint256",
1693
+ name: "longToken",
1694
+ type: "uint256",
1695
+ },
1696
+ {
1697
+ internalType: "uint256",
1698
+ name: "shortToken",
1699
+ type: "uint256",
1700
+ },
1701
+ ],
1702
+ internalType: "struct MarketUtils.CollateralType",
1703
+ name: "short",
1704
+ type: "tuple",
1705
+ },
1706
+ ],
1707
+ internalType: "struct MarketUtils.PositionType",
1708
+ name: "fundingFeeAmountPerSizeDelta",
1709
+ type: "tuple",
1710
+ },
1711
+ {
1712
+ components: [
1713
+ {
1714
+ components: [
1715
+ {
1716
+ internalType: "uint256",
1717
+ name: "longToken",
1718
+ type: "uint256",
1719
+ },
1720
+ {
1721
+ internalType: "uint256",
1722
+ name: "shortToken",
1723
+ type: "uint256",
1724
+ },
1725
+ ],
1726
+ internalType: "struct MarketUtils.CollateralType",
1727
+ name: "long",
1728
+ type: "tuple",
1729
+ },
1730
+ {
1731
+ components: [
1732
+ {
1733
+ internalType: "uint256",
1734
+ name: "longToken",
1735
+ type: "uint256",
1736
+ },
1737
+ {
1738
+ internalType: "uint256",
1739
+ name: "shortToken",
1740
+ type: "uint256",
1741
+ },
1742
+ ],
1743
+ internalType: "struct MarketUtils.CollateralType",
1744
+ name: "short",
1745
+ type: "tuple",
1746
+ },
1747
+ ],
1748
+ internalType: "struct MarketUtils.PositionType",
1749
+ name: "claimableFundingAmountPerSizeDelta",
1750
+ type: "tuple",
1751
+ },
1752
+ ],
1753
+ internalType: "struct MarketUtils.GetNextFundingAmountPerSizeResult",
1754
+ name: "nextFunding",
1755
+ type: "tuple",
1756
+ },
1757
+ {
1758
+ components: [
1759
+ {
1760
+ internalType: "uint256",
1761
+ name: "virtualPoolAmountForLongToken",
1762
+ type: "uint256",
1763
+ },
1764
+ {
1765
+ internalType: "uint256",
1766
+ name: "virtualPoolAmountForShortToken",
1767
+ type: "uint256",
1768
+ },
1769
+ {
1770
+ internalType: "int256",
1771
+ name: "virtualInventoryForPositions",
1772
+ type: "int256",
1773
+ },
1774
+ ],
1775
+ internalType: "struct ReaderUtils.VirtualInventory",
1776
+ name: "virtualInventory",
1777
+ type: "tuple",
1778
+ },
1779
+ {
1780
+ internalType: "bool",
1781
+ name: "isDisabled",
1782
+ type: "bool",
1783
+ },
1784
+ ],
1785
+ internalType: "struct ReaderUtils.MarketInfo",
1786
+ name: "",
1787
+ type: "tuple",
1788
+ },
1789
+ ],
1790
+ stateMutability: "view",
1791
+ type: "function",
1792
+ },
1793
+ {
1794
+ inputs: [
1795
+ {
1796
+ internalType: "contract DataStore",
1797
+ name: "dataStore",
1798
+ type: "address",
1799
+ },
1800
+ {
1801
+ components: [
1802
+ {
1803
+ components: [
1804
+ {
1805
+ internalType: "uint256",
1806
+ name: "min",
1807
+ type: "uint256",
1808
+ },
1809
+ {
1810
+ internalType: "uint256",
1811
+ name: "max",
1812
+ type: "uint256",
1813
+ },
1814
+ ],
1815
+ internalType: "struct Price.Props",
1816
+ name: "indexTokenPrice",
1817
+ type: "tuple",
1818
+ },
1819
+ {
1820
+ components: [
1821
+ {
1822
+ internalType: "uint256",
1823
+ name: "min",
1824
+ type: "uint256",
1825
+ },
1826
+ {
1827
+ internalType: "uint256",
1828
+ name: "max",
1829
+ type: "uint256",
1830
+ },
1831
+ ],
1832
+ internalType: "struct Price.Props",
1833
+ name: "longTokenPrice",
1834
+ type: "tuple",
1835
+ },
1836
+ {
1837
+ components: [
1838
+ {
1839
+ internalType: "uint256",
1840
+ name: "min",
1841
+ type: "uint256",
1842
+ },
1843
+ {
1844
+ internalType: "uint256",
1845
+ name: "max",
1846
+ type: "uint256",
1847
+ },
1848
+ ],
1849
+ internalType: "struct Price.Props",
1850
+ name: "shortTokenPrice",
1851
+ type: "tuple",
1852
+ },
1853
+ ],
1854
+ internalType: "struct MarketUtils.MarketPrices[]",
1855
+ name: "marketPricesList",
1856
+ type: "tuple[]",
1857
+ },
1858
+ {
1859
+ internalType: "uint256",
1860
+ name: "start",
1861
+ type: "uint256",
1862
+ },
1863
+ {
1864
+ internalType: "uint256",
1865
+ name: "end",
1866
+ type: "uint256",
1867
+ },
1868
+ ],
1869
+ name: "getMarketInfoList",
1870
+ outputs: [
1871
+ {
1872
+ components: [
1873
+ {
1874
+ components: [
1875
+ {
1876
+ internalType: "address",
1877
+ name: "marketToken",
1878
+ type: "address",
1879
+ },
1880
+ {
1881
+ internalType: "address",
1882
+ name: "indexToken",
1883
+ type: "address",
1884
+ },
1885
+ {
1886
+ internalType: "address",
1887
+ name: "longToken",
1888
+ type: "address",
1889
+ },
1890
+ {
1891
+ internalType: "address",
1892
+ name: "shortToken",
1893
+ type: "address",
1894
+ },
1895
+ ],
1896
+ internalType: "struct Market.Props",
1897
+ name: "market",
1898
+ type: "tuple",
1899
+ },
1900
+ {
1901
+ internalType: "uint256",
1902
+ name: "borrowingFactorPerSecondForLongs",
1903
+ type: "uint256",
1904
+ },
1905
+ {
1906
+ internalType: "uint256",
1907
+ name: "borrowingFactorPerSecondForShorts",
1908
+ type: "uint256",
1909
+ },
1910
+ {
1911
+ components: [
1912
+ {
1913
+ components: [
1914
+ {
1915
+ components: [
1916
+ {
1917
+ internalType: "uint256",
1918
+ name: "longToken",
1919
+ type: "uint256",
1920
+ },
1921
+ {
1922
+ internalType: "uint256",
1923
+ name: "shortToken",
1924
+ type: "uint256",
1925
+ },
1926
+ ],
1927
+ internalType: "struct MarketUtils.CollateralType",
1928
+ name: "long",
1929
+ type: "tuple",
1930
+ },
1931
+ {
1932
+ components: [
1933
+ {
1934
+ internalType: "uint256",
1935
+ name: "longToken",
1936
+ type: "uint256",
1937
+ },
1938
+ {
1939
+ internalType: "uint256",
1940
+ name: "shortToken",
1941
+ type: "uint256",
1942
+ },
1943
+ ],
1944
+ internalType: "struct MarketUtils.CollateralType",
1945
+ name: "short",
1946
+ type: "tuple",
1947
+ },
1948
+ ],
1949
+ internalType: "struct MarketUtils.PositionType",
1950
+ name: "fundingFeeAmountPerSize",
1951
+ type: "tuple",
1952
+ },
1953
+ {
1954
+ components: [
1955
+ {
1956
+ components: [
1957
+ {
1958
+ internalType: "uint256",
1959
+ name: "longToken",
1960
+ type: "uint256",
1961
+ },
1962
+ {
1963
+ internalType: "uint256",
1964
+ name: "shortToken",
1965
+ type: "uint256",
1966
+ },
1967
+ ],
1968
+ internalType: "struct MarketUtils.CollateralType",
1969
+ name: "long",
1970
+ type: "tuple",
1971
+ },
1972
+ {
1973
+ components: [
1974
+ {
1975
+ internalType: "uint256",
1976
+ name: "longToken",
1977
+ type: "uint256",
1978
+ },
1979
+ {
1980
+ internalType: "uint256",
1981
+ name: "shortToken",
1982
+ type: "uint256",
1983
+ },
1984
+ ],
1985
+ internalType: "struct MarketUtils.CollateralType",
1986
+ name: "short",
1987
+ type: "tuple",
1988
+ },
1989
+ ],
1990
+ internalType: "struct MarketUtils.PositionType",
1991
+ name: "claimableFundingAmountPerSize",
1992
+ type: "tuple",
1993
+ },
1994
+ ],
1995
+ internalType: "struct ReaderUtils.BaseFundingValues",
1996
+ name: "baseFunding",
1997
+ type: "tuple",
1998
+ },
1999
+ {
2000
+ components: [
2001
+ {
2002
+ internalType: "bool",
2003
+ name: "longsPayShorts",
2004
+ type: "bool",
2005
+ },
2006
+ {
2007
+ internalType: "uint256",
2008
+ name: "fundingFactorPerSecond",
2009
+ type: "uint256",
2010
+ },
2011
+ {
2012
+ internalType: "int256",
2013
+ name: "nextSavedFundingFactorPerSecond",
2014
+ type: "int256",
2015
+ },
2016
+ {
2017
+ components: [
2018
+ {
2019
+ components: [
2020
+ {
2021
+ internalType: "uint256",
2022
+ name: "longToken",
2023
+ type: "uint256",
2024
+ },
2025
+ {
2026
+ internalType: "uint256",
2027
+ name: "shortToken",
2028
+ type: "uint256",
2029
+ },
2030
+ ],
2031
+ internalType: "struct MarketUtils.CollateralType",
2032
+ name: "long",
2033
+ type: "tuple",
2034
+ },
2035
+ {
2036
+ components: [
2037
+ {
2038
+ internalType: "uint256",
2039
+ name: "longToken",
2040
+ type: "uint256",
2041
+ },
2042
+ {
2043
+ internalType: "uint256",
2044
+ name: "shortToken",
2045
+ type: "uint256",
2046
+ },
2047
+ ],
2048
+ internalType: "struct MarketUtils.CollateralType",
2049
+ name: "short",
2050
+ type: "tuple",
2051
+ },
2052
+ ],
2053
+ internalType: "struct MarketUtils.PositionType",
2054
+ name: "fundingFeeAmountPerSizeDelta",
2055
+ type: "tuple",
2056
+ },
2057
+ {
2058
+ components: [
2059
+ {
2060
+ components: [
2061
+ {
2062
+ internalType: "uint256",
2063
+ name: "longToken",
2064
+ type: "uint256",
2065
+ },
2066
+ {
2067
+ internalType: "uint256",
2068
+ name: "shortToken",
2069
+ type: "uint256",
2070
+ },
2071
+ ],
2072
+ internalType: "struct MarketUtils.CollateralType",
2073
+ name: "long",
2074
+ type: "tuple",
2075
+ },
2076
+ {
2077
+ components: [
2078
+ {
2079
+ internalType: "uint256",
2080
+ name: "longToken",
2081
+ type: "uint256",
2082
+ },
2083
+ {
2084
+ internalType: "uint256",
2085
+ name: "shortToken",
2086
+ type: "uint256",
2087
+ },
2088
+ ],
2089
+ internalType: "struct MarketUtils.CollateralType",
2090
+ name: "short",
2091
+ type: "tuple",
2092
+ },
2093
+ ],
2094
+ internalType: "struct MarketUtils.PositionType",
2095
+ name: "claimableFundingAmountPerSizeDelta",
2096
+ type: "tuple",
2097
+ },
2098
+ ],
2099
+ internalType: "struct MarketUtils.GetNextFundingAmountPerSizeResult",
2100
+ name: "nextFunding",
2101
+ type: "tuple",
2102
+ },
2103
+ {
2104
+ components: [
2105
+ {
2106
+ internalType: "uint256",
2107
+ name: "virtualPoolAmountForLongToken",
2108
+ type: "uint256",
2109
+ },
2110
+ {
2111
+ internalType: "uint256",
2112
+ name: "virtualPoolAmountForShortToken",
2113
+ type: "uint256",
2114
+ },
2115
+ {
2116
+ internalType: "int256",
2117
+ name: "virtualInventoryForPositions",
2118
+ type: "int256",
2119
+ },
2120
+ ],
2121
+ internalType: "struct ReaderUtils.VirtualInventory",
2122
+ name: "virtualInventory",
2123
+ type: "tuple",
2124
+ },
2125
+ {
2126
+ internalType: "bool",
2127
+ name: "isDisabled",
2128
+ type: "bool",
2129
+ },
2130
+ ],
2131
+ internalType: "struct ReaderUtils.MarketInfo[]",
2132
+ name: "",
2133
+ type: "tuple[]",
2134
+ },
2135
+ ],
2136
+ stateMutability: "view",
2137
+ type: "function",
2138
+ },
2139
+ {
2140
+ inputs: [
2141
+ {
2142
+ internalType: "contract DataStore",
2143
+ name: "dataStore",
2144
+ type: "address",
2145
+ },
2146
+ {
2147
+ components: [
2148
+ {
2149
+ internalType: "address",
2150
+ name: "marketToken",
2151
+ type: "address",
2152
+ },
2153
+ {
2154
+ internalType: "address",
2155
+ name: "indexToken",
2156
+ type: "address",
2157
+ },
2158
+ {
2159
+ internalType: "address",
2160
+ name: "longToken",
2161
+ type: "address",
2162
+ },
2163
+ {
2164
+ internalType: "address",
2165
+ name: "shortToken",
2166
+ type: "address",
2167
+ },
2168
+ ],
2169
+ internalType: "struct Market.Props",
2170
+ name: "market",
2171
+ type: "tuple",
2172
+ },
2173
+ {
2174
+ components: [
2175
+ {
2176
+ internalType: "uint256",
2177
+ name: "min",
2178
+ type: "uint256",
2179
+ },
2180
+ {
2181
+ internalType: "uint256",
2182
+ name: "max",
2183
+ type: "uint256",
2184
+ },
2185
+ ],
2186
+ internalType: "struct Price.Props",
2187
+ name: "indexTokenPrice",
2188
+ type: "tuple",
2189
+ },
2190
+ {
2191
+ components: [
2192
+ {
2193
+ internalType: "uint256",
2194
+ name: "min",
2195
+ type: "uint256",
2196
+ },
2197
+ {
2198
+ internalType: "uint256",
2199
+ name: "max",
2200
+ type: "uint256",
2201
+ },
2202
+ ],
2203
+ internalType: "struct Price.Props",
2204
+ name: "longTokenPrice",
2205
+ type: "tuple",
2206
+ },
2207
+ {
2208
+ components: [
2209
+ {
2210
+ internalType: "uint256",
2211
+ name: "min",
2212
+ type: "uint256",
2213
+ },
2214
+ {
2215
+ internalType: "uint256",
2216
+ name: "max",
2217
+ type: "uint256",
2218
+ },
2219
+ ],
2220
+ internalType: "struct Price.Props",
2221
+ name: "shortTokenPrice",
2222
+ type: "tuple",
2223
+ },
2224
+ {
2225
+ internalType: "bytes32",
2226
+ name: "pnlFactorType",
2227
+ type: "bytes32",
2228
+ },
2229
+ {
2230
+ internalType: "bool",
2231
+ name: "maximize",
2232
+ type: "bool",
2233
+ },
2234
+ ],
2235
+ name: "getMarketTokenPrice",
2236
+ outputs: [
2237
+ {
2238
+ internalType: "int256",
2239
+ name: "",
2240
+ type: "int256",
2241
+ },
2242
+ {
2243
+ components: [
2244
+ {
2245
+ internalType: "int256",
2246
+ name: "poolValue",
2247
+ type: "int256",
2248
+ },
2249
+ {
2250
+ internalType: "int256",
2251
+ name: "longPnl",
2252
+ type: "int256",
2253
+ },
2254
+ {
2255
+ internalType: "int256",
2256
+ name: "shortPnl",
2257
+ type: "int256",
2258
+ },
2259
+ {
2260
+ internalType: "int256",
2261
+ name: "netPnl",
2262
+ type: "int256",
2263
+ },
2264
+ {
2265
+ internalType: "uint256",
2266
+ name: "longTokenAmount",
2267
+ type: "uint256",
2268
+ },
2269
+ {
2270
+ internalType: "uint256",
2271
+ name: "shortTokenAmount",
2272
+ type: "uint256",
2273
+ },
2274
+ {
2275
+ internalType: "uint256",
2276
+ name: "longTokenUsd",
2277
+ type: "uint256",
2278
+ },
2279
+ {
2280
+ internalType: "uint256",
2281
+ name: "shortTokenUsd",
2282
+ type: "uint256",
2283
+ },
2284
+ {
2285
+ internalType: "uint256",
2286
+ name: "totalBorrowingFees",
2287
+ type: "uint256",
2288
+ },
2289
+ {
2290
+ internalType: "uint256",
2291
+ name: "borrowingFeePoolFactor",
2292
+ type: "uint256",
2293
+ },
2294
+ {
2295
+ internalType: "uint256",
2296
+ name: "impactPoolAmount",
2297
+ type: "uint256",
2298
+ },
2299
+ {
2300
+ internalType: "uint256",
2301
+ name: "lentImpactPoolAmount",
2302
+ type: "uint256",
2303
+ },
2304
+ ],
2305
+ internalType: "struct MarketPoolValueInfo.Props",
2306
+ name: "",
2307
+ type: "tuple",
2308
+ },
2309
+ ],
2310
+ stateMutability: "view",
2311
+ type: "function",
2312
+ },
2313
+ {
2314
+ inputs: [
2315
+ {
2316
+ internalType: "contract DataStore",
2317
+ name: "dataStore",
2318
+ type: "address",
2319
+ },
2320
+ {
2321
+ internalType: "uint256",
2322
+ name: "start",
2323
+ type: "uint256",
2324
+ },
2325
+ {
2326
+ internalType: "uint256",
2327
+ name: "end",
2328
+ type: "uint256",
2329
+ },
2330
+ ],
2331
+ name: "getMarkets",
2332
+ outputs: [
2333
+ {
2334
+ components: [
2335
+ {
2336
+ internalType: "address",
2337
+ name: "marketToken",
2338
+ type: "address",
2339
+ },
2340
+ {
2341
+ internalType: "address",
2342
+ name: "indexToken",
2343
+ type: "address",
2344
+ },
2345
+ {
2346
+ internalType: "address",
2347
+ name: "longToken",
2348
+ type: "address",
2349
+ },
2350
+ {
2351
+ internalType: "address",
2352
+ name: "shortToken",
2353
+ type: "address",
2354
+ },
2355
+ ],
2356
+ internalType: "struct Market.Props[]",
2357
+ name: "",
2358
+ type: "tuple[]",
2359
+ },
2360
+ ],
2361
+ stateMutability: "view",
2362
+ type: "function",
2363
+ },
2364
+ {
2365
+ inputs: [
2366
+ {
2367
+ internalType: "contract DataStore",
2368
+ name: "dataStore",
2369
+ type: "address",
2370
+ },
2371
+ {
2372
+ components: [
2373
+ {
2374
+ internalType: "address",
2375
+ name: "marketToken",
2376
+ type: "address",
2377
+ },
2378
+ {
2379
+ internalType: "address",
2380
+ name: "indexToken",
2381
+ type: "address",
2382
+ },
2383
+ {
2384
+ internalType: "address",
2385
+ name: "longToken",
2386
+ type: "address",
2387
+ },
2388
+ {
2389
+ internalType: "address",
2390
+ name: "shortToken",
2391
+ type: "address",
2392
+ },
2393
+ ],
2394
+ internalType: "struct Market.Props",
2395
+ name: "market",
2396
+ type: "tuple",
2397
+ },
2398
+ {
2399
+ components: [
2400
+ {
2401
+ internalType: "uint256",
2402
+ name: "min",
2403
+ type: "uint256",
2404
+ },
2405
+ {
2406
+ internalType: "uint256",
2407
+ name: "max",
2408
+ type: "uint256",
2409
+ },
2410
+ ],
2411
+ internalType: "struct Price.Props",
2412
+ name: "indexTokenPrice",
2413
+ type: "tuple",
2414
+ },
2415
+ {
2416
+ internalType: "bool",
2417
+ name: "maximize",
2418
+ type: "bool",
2419
+ },
2420
+ ],
2421
+ name: "getNetPnl",
2422
+ outputs: [
2423
+ {
2424
+ internalType: "int256",
2425
+ name: "",
2426
+ type: "int256",
2427
+ },
2428
+ ],
2429
+ stateMutability: "view",
2430
+ type: "function",
2431
+ },
2432
+ {
2433
+ inputs: [
2434
+ {
2435
+ internalType: "contract DataStore",
2436
+ name: "dataStore",
2437
+ type: "address",
2438
+ },
2439
+ {
2440
+ components: [
2441
+ {
2442
+ internalType: "address",
2443
+ name: "marketToken",
2444
+ type: "address",
2445
+ },
2446
+ {
2447
+ internalType: "address",
2448
+ name: "indexToken",
2449
+ type: "address",
2450
+ },
2451
+ {
2452
+ internalType: "address",
2453
+ name: "longToken",
2454
+ type: "address",
2455
+ },
2456
+ {
2457
+ internalType: "address",
2458
+ name: "shortToken",
2459
+ type: "address",
2460
+ },
2461
+ ],
2462
+ internalType: "struct Market.Props",
2463
+ name: "market",
2464
+ type: "tuple",
2465
+ },
2466
+ {
2467
+ components: [
2468
+ {
2469
+ internalType: "uint256",
2470
+ name: "min",
2471
+ type: "uint256",
2472
+ },
2473
+ {
2474
+ internalType: "uint256",
2475
+ name: "max",
2476
+ type: "uint256",
2477
+ },
2478
+ ],
2479
+ internalType: "struct Price.Props",
2480
+ name: "indexTokenPrice",
2481
+ type: "tuple",
2482
+ },
2483
+ {
2484
+ internalType: "bool",
2485
+ name: "isLong",
2486
+ type: "bool",
2487
+ },
2488
+ {
2489
+ internalType: "bool",
2490
+ name: "maximize",
2491
+ type: "bool",
2492
+ },
2493
+ ],
2494
+ name: "getOpenInterestWithPnl",
2495
+ outputs: [
2496
+ {
2497
+ internalType: "int256",
2498
+ name: "",
2499
+ type: "int256",
2500
+ },
2501
+ ],
2502
+ stateMutability: "view",
2503
+ type: "function",
2504
+ },
2505
+ {
2506
+ inputs: [
2507
+ {
2508
+ internalType: "contract DataStore",
2509
+ name: "dataStore",
2510
+ type: "address",
2511
+ },
2512
+ {
2513
+ internalType: "bytes32",
2514
+ name: "key",
2515
+ type: "bytes32",
2516
+ },
2517
+ ],
2518
+ name: "getOrder",
2519
+ outputs: [
2520
+ {
2521
+ components: [
2522
+ {
2523
+ components: [
2524
+ {
2525
+ internalType: "address",
2526
+ name: "account",
2527
+ type: "address",
2528
+ },
2529
+ {
2530
+ internalType: "address",
2531
+ name: "receiver",
2532
+ type: "address",
2533
+ },
2534
+ {
2535
+ internalType: "address",
2536
+ name: "cancellationReceiver",
2537
+ type: "address",
2538
+ },
2539
+ {
2540
+ internalType: "address",
2541
+ name: "callbackContract",
2542
+ type: "address",
2543
+ },
2544
+ {
2545
+ internalType: "address",
2546
+ name: "uiFeeReceiver",
2547
+ type: "address",
2548
+ },
2549
+ {
2550
+ internalType: "address",
2551
+ name: "market",
2552
+ type: "address",
2553
+ },
2554
+ {
2555
+ internalType: "address",
2556
+ name: "initialCollateralToken",
2557
+ type: "address",
2558
+ },
2559
+ {
2560
+ internalType: "address[]",
2561
+ name: "swapPath",
2562
+ type: "address[]",
2563
+ },
2564
+ ],
2565
+ internalType: "struct Order.Addresses",
2566
+ name: "addresses",
2567
+ type: "tuple",
2568
+ },
2569
+ {
2570
+ components: [
2571
+ {
2572
+ internalType: "enum Order.OrderType",
2573
+ name: "orderType",
2574
+ type: "uint8",
2575
+ },
2576
+ {
2577
+ internalType: "enum Order.DecreasePositionSwapType",
2578
+ name: "decreasePositionSwapType",
2579
+ type: "uint8",
2580
+ },
2581
+ {
2582
+ internalType: "uint256",
2583
+ name: "sizeDeltaUsd",
2584
+ type: "uint256",
2585
+ },
2586
+ {
2587
+ internalType: "uint256",
2588
+ name: "initialCollateralDeltaAmount",
2589
+ type: "uint256",
2590
+ },
2591
+ {
2592
+ internalType: "uint256",
2593
+ name: "triggerPrice",
2594
+ type: "uint256",
2595
+ },
2596
+ {
2597
+ internalType: "uint256",
2598
+ name: "acceptablePrice",
2599
+ type: "uint256",
2600
+ },
2601
+ {
2602
+ internalType: "uint256",
2603
+ name: "executionFee",
2604
+ type: "uint256",
2605
+ },
2606
+ {
2607
+ internalType: "uint256",
2608
+ name: "callbackGasLimit",
2609
+ type: "uint256",
2610
+ },
2611
+ {
2612
+ internalType: "uint256",
2613
+ name: "minOutputAmount",
2614
+ type: "uint256",
2615
+ },
2616
+ {
2617
+ internalType: "uint256",
2618
+ name: "updatedAtTime",
2619
+ type: "uint256",
2620
+ },
2621
+ {
2622
+ internalType: "uint256",
2623
+ name: "validFromTime",
2624
+ type: "uint256",
2625
+ },
2626
+ {
2627
+ internalType: "uint256",
2628
+ name: "srcChainId",
2629
+ type: "uint256",
2630
+ },
2631
+ ],
2632
+ internalType: "struct Order.Numbers",
2633
+ name: "numbers",
2634
+ type: "tuple",
2635
+ },
2636
+ {
2637
+ components: [
2638
+ {
2639
+ internalType: "bool",
2640
+ name: "isLong",
2641
+ type: "bool",
2642
+ },
2643
+ {
2644
+ internalType: "bool",
2645
+ name: "shouldUnwrapNativeToken",
2646
+ type: "bool",
2647
+ },
2648
+ {
2649
+ internalType: "bool",
2650
+ name: "isFrozen",
2651
+ type: "bool",
2652
+ },
2653
+ {
2654
+ internalType: "bool",
2655
+ name: "autoCancel",
2656
+ type: "bool",
2657
+ },
2658
+ ],
2659
+ internalType: "struct Order.Flags",
2660
+ name: "flags",
2661
+ type: "tuple",
2662
+ },
2663
+ {
2664
+ internalType: "bytes32[]",
2665
+ name: "_dataList",
2666
+ type: "bytes32[]",
2667
+ },
2668
+ ],
2669
+ internalType: "struct Order.Props",
2670
+ name: "",
2671
+ type: "tuple",
2672
+ },
2673
+ ],
2674
+ stateMutability: "view",
2675
+ type: "function",
2676
+ },
2677
+ {
2678
+ inputs: [
2679
+ {
2680
+ internalType: "contract DataStore",
2681
+ name: "dataStore",
2682
+ type: "address",
2683
+ },
2684
+ {
2685
+ internalType: "address",
2686
+ name: "market",
2687
+ type: "address",
2688
+ },
2689
+ ],
2690
+ name: "getPendingPositionImpactPoolDistributionAmount",
2691
+ outputs: [
2692
+ {
2693
+ internalType: "uint256",
2694
+ name: "",
2695
+ type: "uint256",
2696
+ },
2697
+ {
2698
+ internalType: "uint256",
2699
+ name: "",
2700
+ type: "uint256",
2701
+ },
2702
+ ],
2703
+ stateMutability: "view",
2704
+ type: "function",
2705
+ },
2706
+ {
2707
+ inputs: [
2708
+ {
2709
+ internalType: "contract DataStore",
2710
+ name: "dataStore",
2711
+ type: "address",
2712
+ },
2713
+ {
2714
+ components: [
2715
+ {
2716
+ internalType: "address",
2717
+ name: "marketToken",
2718
+ type: "address",
2719
+ },
2720
+ {
2721
+ internalType: "address",
2722
+ name: "indexToken",
2723
+ type: "address",
2724
+ },
2725
+ {
2726
+ internalType: "address",
2727
+ name: "longToken",
2728
+ type: "address",
2729
+ },
2730
+ {
2731
+ internalType: "address",
2732
+ name: "shortToken",
2733
+ type: "address",
2734
+ },
2735
+ ],
2736
+ internalType: "struct Market.Props",
2737
+ name: "market",
2738
+ type: "tuple",
2739
+ },
2740
+ {
2741
+ components: [
2742
+ {
2743
+ internalType: "uint256",
2744
+ name: "min",
2745
+ type: "uint256",
2746
+ },
2747
+ {
2748
+ internalType: "uint256",
2749
+ name: "max",
2750
+ type: "uint256",
2751
+ },
2752
+ ],
2753
+ internalType: "struct Price.Props",
2754
+ name: "indexTokenPrice",
2755
+ type: "tuple",
2756
+ },
2757
+ {
2758
+ internalType: "bool",
2759
+ name: "isLong",
2760
+ type: "bool",
2761
+ },
2762
+ {
2763
+ internalType: "bool",
2764
+ name: "maximize",
2765
+ type: "bool",
2766
+ },
2767
+ ],
2768
+ name: "getPnl",
2769
+ outputs: [
2770
+ {
2771
+ internalType: "int256",
2772
+ name: "",
2773
+ type: "int256",
2774
+ },
2775
+ ],
2776
+ stateMutability: "view",
2777
+ type: "function",
2778
+ },
2779
+ {
2780
+ inputs: [
2781
+ {
2782
+ internalType: "contract DataStore",
2783
+ name: "dataStore",
2784
+ type: "address",
2785
+ },
2786
+ {
2787
+ internalType: "address",
2788
+ name: "marketAddress",
2789
+ type: "address",
2790
+ },
2791
+ {
2792
+ components: [
2793
+ {
2794
+ components: [
2795
+ {
2796
+ internalType: "uint256",
2797
+ name: "min",
2798
+ type: "uint256",
2799
+ },
2800
+ {
2801
+ internalType: "uint256",
2802
+ name: "max",
2803
+ type: "uint256",
2804
+ },
2805
+ ],
2806
+ internalType: "struct Price.Props",
2807
+ name: "indexTokenPrice",
2808
+ type: "tuple",
2809
+ },
2810
+ {
2811
+ components: [
2812
+ {
2813
+ internalType: "uint256",
2814
+ name: "min",
2815
+ type: "uint256",
2816
+ },
2817
+ {
2818
+ internalType: "uint256",
2819
+ name: "max",
2820
+ type: "uint256",
2821
+ },
2822
+ ],
2823
+ internalType: "struct Price.Props",
2824
+ name: "longTokenPrice",
2825
+ type: "tuple",
2826
+ },
2827
+ {
2828
+ components: [
2829
+ {
2830
+ internalType: "uint256",
2831
+ name: "min",
2832
+ type: "uint256",
2833
+ },
2834
+ {
2835
+ internalType: "uint256",
2836
+ name: "max",
2837
+ type: "uint256",
2838
+ },
2839
+ ],
2840
+ internalType: "struct Price.Props",
2841
+ name: "shortTokenPrice",
2842
+ type: "tuple",
2843
+ },
2844
+ ],
2845
+ internalType: "struct MarketUtils.MarketPrices",
2846
+ name: "prices",
2847
+ type: "tuple",
2848
+ },
2849
+ {
2850
+ internalType: "bool",
2851
+ name: "isLong",
2852
+ type: "bool",
2853
+ },
2854
+ {
2855
+ internalType: "bool",
2856
+ name: "maximize",
2857
+ type: "bool",
2858
+ },
2859
+ ],
2860
+ name: "getPnlToPoolFactor",
2861
+ outputs: [
2862
+ {
2863
+ internalType: "int256",
2864
+ name: "",
2865
+ type: "int256",
2866
+ },
2867
+ ],
2868
+ stateMutability: "view",
2869
+ type: "function",
2870
+ },
2871
+ {
2872
+ inputs: [
2873
+ {
2874
+ internalType: "contract DataStore",
2875
+ name: "dataStore",
2876
+ type: "address",
2877
+ },
2878
+ {
2879
+ internalType: "bytes32",
2880
+ name: "key",
2881
+ type: "bytes32",
2882
+ },
2883
+ ],
2884
+ name: "getPosition",
2885
+ outputs: [
2886
+ {
2887
+ components: [
2888
+ {
2889
+ components: [
2890
+ {
2891
+ internalType: "address",
2892
+ name: "account",
2893
+ type: "address",
2894
+ },
2895
+ {
2896
+ internalType: "address",
2897
+ name: "market",
2898
+ type: "address",
2899
+ },
2900
+ {
2901
+ internalType: "address",
2902
+ name: "collateralToken",
2903
+ type: "address",
2904
+ },
2905
+ ],
2906
+ internalType: "struct Position.Addresses",
2907
+ name: "addresses",
2908
+ type: "tuple",
2909
+ },
2910
+ {
2911
+ components: [
2912
+ {
2913
+ internalType: "uint256",
2914
+ name: "sizeInUsd",
2915
+ type: "uint256",
2916
+ },
2917
+ {
2918
+ internalType: "uint256",
2919
+ name: "sizeInTokens",
2920
+ type: "uint256",
2921
+ },
2922
+ {
2923
+ internalType: "uint256",
2924
+ name: "collateralAmount",
2925
+ type: "uint256",
2926
+ },
2927
+ {
2928
+ internalType: "int256",
2929
+ name: "pendingImpactAmount",
2930
+ type: "int256",
2931
+ },
2932
+ {
2933
+ internalType: "uint256",
2934
+ name: "borrowingFactor",
2935
+ type: "uint256",
2936
+ },
2937
+ {
2938
+ internalType: "uint256",
2939
+ name: "fundingFeeAmountPerSize",
2940
+ type: "uint256",
2941
+ },
2942
+ {
2943
+ internalType: "uint256",
2944
+ name: "longTokenClaimableFundingAmountPerSize",
2945
+ type: "uint256",
2946
+ },
2947
+ {
2948
+ internalType: "uint256",
2949
+ name: "shortTokenClaimableFundingAmountPerSize",
2950
+ type: "uint256",
2951
+ },
2952
+ {
2953
+ internalType: "uint256",
2954
+ name: "increasedAtTime",
2955
+ type: "uint256",
2956
+ },
2957
+ {
2958
+ internalType: "uint256",
2959
+ name: "decreasedAtTime",
2960
+ type: "uint256",
2961
+ },
2962
+ ],
2963
+ internalType: "struct Position.Numbers",
2964
+ name: "numbers",
2965
+ type: "tuple",
2966
+ },
2967
+ {
2968
+ components: [
2969
+ {
2970
+ internalType: "bool",
2971
+ name: "isLong",
2972
+ type: "bool",
2973
+ },
2974
+ ],
2975
+ internalType: "struct Position.Flags",
2976
+ name: "flags",
2977
+ type: "tuple",
2978
+ },
2979
+ ],
2980
+ internalType: "struct Position.Props",
2981
+ name: "",
2982
+ type: "tuple",
2983
+ },
2984
+ ],
2985
+ stateMutability: "view",
2986
+ type: "function",
2987
+ },
2988
+ {
2989
+ inputs: [
2990
+ {
2991
+ internalType: "contract DataStore",
2992
+ name: "dataStore",
2993
+ type: "address",
2994
+ },
2995
+ {
2996
+ internalType: "contract IReferralStorage",
2997
+ name: "referralStorage",
2998
+ type: "address",
2999
+ },
3000
+ {
3001
+ internalType: "bytes32",
3002
+ name: "positionKey",
3003
+ type: "bytes32",
3004
+ },
3005
+ {
3006
+ components: [
3007
+ {
3008
+ components: [
3009
+ {
3010
+ internalType: "uint256",
3011
+ name: "min",
3012
+ type: "uint256",
3013
+ },
3014
+ {
3015
+ internalType: "uint256",
3016
+ name: "max",
3017
+ type: "uint256",
3018
+ },
3019
+ ],
3020
+ internalType: "struct Price.Props",
3021
+ name: "indexTokenPrice",
3022
+ type: "tuple",
3023
+ },
3024
+ {
3025
+ components: [
3026
+ {
3027
+ internalType: "uint256",
3028
+ name: "min",
3029
+ type: "uint256",
3030
+ },
3031
+ {
3032
+ internalType: "uint256",
3033
+ name: "max",
3034
+ type: "uint256",
3035
+ },
3036
+ ],
3037
+ internalType: "struct Price.Props",
3038
+ name: "longTokenPrice",
3039
+ type: "tuple",
3040
+ },
3041
+ {
3042
+ components: [
3043
+ {
3044
+ internalType: "uint256",
3045
+ name: "min",
3046
+ type: "uint256",
3047
+ },
3048
+ {
3049
+ internalType: "uint256",
3050
+ name: "max",
3051
+ type: "uint256",
3052
+ },
3053
+ ],
3054
+ internalType: "struct Price.Props",
3055
+ name: "shortTokenPrice",
3056
+ type: "tuple",
3057
+ },
3058
+ ],
3059
+ internalType: "struct MarketUtils.MarketPrices",
3060
+ name: "prices",
3061
+ type: "tuple",
3062
+ },
3063
+ {
3064
+ internalType: "uint256",
3065
+ name: "sizeDeltaUsd",
3066
+ type: "uint256",
3067
+ },
3068
+ {
3069
+ internalType: "address",
3070
+ name: "uiFeeReceiver",
3071
+ type: "address",
3072
+ },
3073
+ {
3074
+ internalType: "bool",
3075
+ name: "usePositionSizeAsSizeDeltaUsd",
3076
+ type: "bool",
3077
+ },
3078
+ ],
3079
+ name: "getPositionInfo",
3080
+ outputs: [
3081
+ {
3082
+ components: [
3083
+ {
3084
+ internalType: "bytes32",
3085
+ name: "positionKey",
3086
+ type: "bytes32",
3087
+ },
3088
+ {
3089
+ components: [
3090
+ {
3091
+ components: [
3092
+ {
3093
+ internalType: "address",
3094
+ name: "account",
3095
+ type: "address",
3096
+ },
3097
+ {
3098
+ internalType: "address",
3099
+ name: "market",
3100
+ type: "address",
3101
+ },
3102
+ {
3103
+ internalType: "address",
3104
+ name: "collateralToken",
3105
+ type: "address",
3106
+ },
3107
+ ],
3108
+ internalType: "struct Position.Addresses",
3109
+ name: "addresses",
3110
+ type: "tuple",
3111
+ },
3112
+ {
3113
+ components: [
3114
+ {
3115
+ internalType: "uint256",
3116
+ name: "sizeInUsd",
3117
+ type: "uint256",
3118
+ },
3119
+ {
3120
+ internalType: "uint256",
3121
+ name: "sizeInTokens",
3122
+ type: "uint256",
3123
+ },
3124
+ {
3125
+ internalType: "uint256",
3126
+ name: "collateralAmount",
3127
+ type: "uint256",
3128
+ },
3129
+ {
3130
+ internalType: "int256",
3131
+ name: "pendingImpactAmount",
3132
+ type: "int256",
3133
+ },
3134
+ {
3135
+ internalType: "uint256",
3136
+ name: "borrowingFactor",
3137
+ type: "uint256",
3138
+ },
3139
+ {
3140
+ internalType: "uint256",
3141
+ name: "fundingFeeAmountPerSize",
3142
+ type: "uint256",
3143
+ },
3144
+ {
3145
+ internalType: "uint256",
3146
+ name: "longTokenClaimableFundingAmountPerSize",
3147
+ type: "uint256",
3148
+ },
3149
+ {
3150
+ internalType: "uint256",
3151
+ name: "shortTokenClaimableFundingAmountPerSize",
3152
+ type: "uint256",
3153
+ },
3154
+ {
3155
+ internalType: "uint256",
3156
+ name: "increasedAtTime",
3157
+ type: "uint256",
3158
+ },
3159
+ {
3160
+ internalType: "uint256",
3161
+ name: "decreasedAtTime",
3162
+ type: "uint256",
3163
+ },
3164
+ ],
3165
+ internalType: "struct Position.Numbers",
3166
+ name: "numbers",
3167
+ type: "tuple",
3168
+ },
3169
+ {
3170
+ components: [
3171
+ {
3172
+ internalType: "bool",
3173
+ name: "isLong",
3174
+ type: "bool",
3175
+ },
3176
+ ],
3177
+ internalType: "struct Position.Flags",
3178
+ name: "flags",
3179
+ type: "tuple",
3180
+ },
3181
+ ],
3182
+ internalType: "struct Position.Props",
3183
+ name: "position",
3184
+ type: "tuple",
3185
+ },
3186
+ {
3187
+ components: [
3188
+ {
3189
+ components: [
3190
+ {
3191
+ internalType: "bytes32",
3192
+ name: "referralCode",
3193
+ type: "bytes32",
3194
+ },
3195
+ {
3196
+ internalType: "address",
3197
+ name: "affiliate",
3198
+ type: "address",
3199
+ },
3200
+ {
3201
+ internalType: "address",
3202
+ name: "trader",
3203
+ type: "address",
3204
+ },
3205
+ {
3206
+ internalType: "uint256",
3207
+ name: "totalRebateFactor",
3208
+ type: "uint256",
3209
+ },
3210
+ {
3211
+ internalType: "uint256",
3212
+ name: "affiliateRewardFactor",
3213
+ type: "uint256",
3214
+ },
3215
+ {
3216
+ internalType: "uint256",
3217
+ name: "adjustedAffiliateRewardFactor",
3218
+ type: "uint256",
3219
+ },
3220
+ {
3221
+ internalType: "uint256",
3222
+ name: "traderDiscountFactor",
3223
+ type: "uint256",
3224
+ },
3225
+ {
3226
+ internalType: "uint256",
3227
+ name: "totalRebateAmount",
3228
+ type: "uint256",
3229
+ },
3230
+ {
3231
+ internalType: "uint256",
3232
+ name: "traderDiscountAmount",
3233
+ type: "uint256",
3234
+ },
3235
+ {
3236
+ internalType: "uint256",
3237
+ name: "affiliateRewardAmount",
3238
+ type: "uint256",
3239
+ },
3240
+ ],
3241
+ internalType: "struct PositionPricingUtils.PositionReferralFees",
3242
+ name: "referral",
3243
+ type: "tuple",
3244
+ },
3245
+ {
3246
+ components: [
3247
+ {
3248
+ internalType: "uint256",
3249
+ name: "traderTier",
3250
+ type: "uint256",
3251
+ },
3252
+ {
3253
+ internalType: "uint256",
3254
+ name: "traderDiscountFactor",
3255
+ type: "uint256",
3256
+ },
3257
+ {
3258
+ internalType: "uint256",
3259
+ name: "traderDiscountAmount",
3260
+ type: "uint256",
3261
+ },
3262
+ ],
3263
+ internalType: "struct PositionPricingUtils.PositionProFees",
3264
+ name: "pro",
3265
+ type: "tuple",
3266
+ },
3267
+ {
3268
+ components: [
3269
+ {
3270
+ internalType: "uint256",
3271
+ name: "fundingFeeAmount",
3272
+ type: "uint256",
3273
+ },
3274
+ {
3275
+ internalType: "uint256",
3276
+ name: "claimableLongTokenAmount",
3277
+ type: "uint256",
3278
+ },
3279
+ {
3280
+ internalType: "uint256",
3281
+ name: "claimableShortTokenAmount",
3282
+ type: "uint256",
3283
+ },
3284
+ {
3285
+ internalType: "uint256",
3286
+ name: "latestFundingFeeAmountPerSize",
3287
+ type: "uint256",
3288
+ },
3289
+ {
3290
+ internalType: "uint256",
3291
+ name: "latestLongTokenClaimableFundingAmountPerSize",
3292
+ type: "uint256",
3293
+ },
3294
+ {
3295
+ internalType: "uint256",
3296
+ name: "latestShortTokenClaimableFundingAmountPerSize",
3297
+ type: "uint256",
3298
+ },
3299
+ ],
3300
+ internalType: "struct PositionPricingUtils.PositionFundingFees",
3301
+ name: "funding",
3302
+ type: "tuple",
3303
+ },
3304
+ {
3305
+ components: [
3306
+ {
3307
+ internalType: "uint256",
3308
+ name: "borrowingFeeUsd",
3309
+ type: "uint256",
3310
+ },
3311
+ {
3312
+ internalType: "uint256",
3313
+ name: "borrowingFeeAmount",
3314
+ type: "uint256",
3315
+ },
3316
+ {
3317
+ internalType: "uint256",
3318
+ name: "borrowingFeeReceiverFactor",
3319
+ type: "uint256",
3320
+ },
3321
+ {
3322
+ internalType: "uint256",
3323
+ name: "borrowingFeeAmountForFeeReceiver",
3324
+ type: "uint256",
3325
+ },
3326
+ ],
3327
+ internalType: "struct PositionPricingUtils.PositionBorrowingFees",
3328
+ name: "borrowing",
3329
+ type: "tuple",
3330
+ },
3331
+ {
3332
+ components: [
3333
+ {
3334
+ internalType: "address",
3335
+ name: "uiFeeReceiver",
3336
+ type: "address",
3337
+ },
3338
+ {
3339
+ internalType: "uint256",
3340
+ name: "uiFeeReceiverFactor",
3341
+ type: "uint256",
3342
+ },
3343
+ {
3344
+ internalType: "uint256",
3345
+ name: "uiFeeAmount",
3346
+ type: "uint256",
3347
+ },
3348
+ ],
3349
+ internalType: "struct PositionPricingUtils.PositionUiFees",
3350
+ name: "ui",
3351
+ type: "tuple",
3352
+ },
3353
+ {
3354
+ components: [
3355
+ {
3356
+ internalType: "uint256",
3357
+ name: "liquidationFeeUsd",
3358
+ type: "uint256",
3359
+ },
3360
+ {
3361
+ internalType: "uint256",
3362
+ name: "liquidationFeeAmount",
3363
+ type: "uint256",
3364
+ },
3365
+ {
3366
+ internalType: "uint256",
3367
+ name: "liquidationFeeReceiverFactor",
3368
+ type: "uint256",
3369
+ },
3370
+ {
3371
+ internalType: "uint256",
3372
+ name: "liquidationFeeAmountForFeeReceiver",
3373
+ type: "uint256",
3374
+ },
3375
+ ],
3376
+ internalType: "struct PositionPricingUtils.PositionLiquidationFees",
3377
+ name: "liquidation",
3378
+ type: "tuple",
3379
+ },
3380
+ {
3381
+ components: [
3382
+ {
3383
+ internalType: "uint256",
3384
+ name: "min",
3385
+ type: "uint256",
3386
+ },
3387
+ {
3388
+ internalType: "uint256",
3389
+ name: "max",
3390
+ type: "uint256",
3391
+ },
3392
+ ],
3393
+ internalType: "struct Price.Props",
3394
+ name: "collateralTokenPrice",
3395
+ type: "tuple",
3396
+ },
3397
+ {
3398
+ internalType: "uint256",
3399
+ name: "positionFeeFactor",
3400
+ type: "uint256",
3401
+ },
3402
+ {
3403
+ internalType: "uint256",
3404
+ name: "protocolFeeAmount",
3405
+ type: "uint256",
3406
+ },
3407
+ {
3408
+ internalType: "uint256",
3409
+ name: "positionFeeReceiverFactor",
3410
+ type: "uint256",
3411
+ },
3412
+ {
3413
+ internalType: "uint256",
3414
+ name: "feeReceiverAmount",
3415
+ type: "uint256",
3416
+ },
3417
+ {
3418
+ internalType: "uint256",
3419
+ name: "feeAmountForPool",
3420
+ type: "uint256",
3421
+ },
3422
+ {
3423
+ internalType: "uint256",
3424
+ name: "positionFeeAmountForPool",
3425
+ type: "uint256",
3426
+ },
3427
+ {
3428
+ internalType: "uint256",
3429
+ name: "positionFeeAmount",
3430
+ type: "uint256",
3431
+ },
3432
+ {
3433
+ internalType: "uint256",
3434
+ name: "totalCostAmountExcludingFunding",
3435
+ type: "uint256",
3436
+ },
3437
+ {
3438
+ internalType: "uint256",
3439
+ name: "totalCostAmount",
3440
+ type: "uint256",
3441
+ },
3442
+ {
3443
+ internalType: "uint256",
3444
+ name: "totalDiscountAmount",
3445
+ type: "uint256",
3446
+ },
3447
+ ],
3448
+ internalType: "struct PositionPricingUtils.PositionFees",
3449
+ name: "fees",
3450
+ type: "tuple",
3451
+ },
3452
+ {
3453
+ components: [
3454
+ {
3455
+ internalType: "int256",
3456
+ name: "priceImpactUsd",
3457
+ type: "int256",
3458
+ },
3459
+ {
3460
+ internalType: "uint256",
3461
+ name: "executionPrice",
3462
+ type: "uint256",
3463
+ },
3464
+ {
3465
+ internalType: "bool",
3466
+ name: "balanceWasImproved",
3467
+ type: "bool",
3468
+ },
3469
+ {
3470
+ internalType: "int256",
3471
+ name: "proportionalPendingImpactUsd",
3472
+ type: "int256",
3473
+ },
3474
+ {
3475
+ internalType: "int256",
3476
+ name: "totalImpactUsd",
3477
+ type: "int256",
3478
+ },
3479
+ {
3480
+ internalType: "uint256",
3481
+ name: "priceImpactDiffUsd",
3482
+ type: "uint256",
3483
+ },
3484
+ ],
3485
+ internalType: "struct ReaderPricingUtils.ExecutionPriceResult",
3486
+ name: "executionPriceResult",
3487
+ type: "tuple",
3488
+ },
3489
+ {
3490
+ internalType: "int256",
3491
+ name: "basePnlUsd",
3492
+ type: "int256",
3493
+ },
3494
+ {
3495
+ internalType: "int256",
3496
+ name: "uncappedBasePnlUsd",
3497
+ type: "int256",
3498
+ },
3499
+ {
3500
+ internalType: "int256",
3501
+ name: "pnlAfterPriceImpactUsd",
3502
+ type: "int256",
3503
+ },
3504
+ ],
3505
+ internalType: "struct ReaderPositionUtils.PositionInfo",
3506
+ name: "",
3507
+ type: "tuple",
3508
+ },
3509
+ ],
3510
+ stateMutability: "view",
3511
+ type: "function",
3512
+ },
3513
+ {
3514
+ inputs: [
3515
+ {
3516
+ internalType: "contract DataStore",
3517
+ name: "dataStore",
3518
+ type: "address",
3519
+ },
3520
+ {
3521
+ internalType: "contract IReferralStorage",
3522
+ name: "referralStorage",
3523
+ type: "address",
3524
+ },
3525
+ {
3526
+ internalType: "bytes32[]",
3527
+ name: "positionKeys",
3528
+ type: "bytes32[]",
3529
+ },
3530
+ {
3531
+ components: [
3532
+ {
3533
+ components: [
3534
+ {
3535
+ internalType: "uint256",
3536
+ name: "min",
3537
+ type: "uint256",
3538
+ },
3539
+ {
3540
+ internalType: "uint256",
3541
+ name: "max",
3542
+ type: "uint256",
3543
+ },
3544
+ ],
3545
+ internalType: "struct Price.Props",
3546
+ name: "indexTokenPrice",
3547
+ type: "tuple",
3548
+ },
3549
+ {
3550
+ components: [
3551
+ {
3552
+ internalType: "uint256",
3553
+ name: "min",
3554
+ type: "uint256",
3555
+ },
3556
+ {
3557
+ internalType: "uint256",
3558
+ name: "max",
3559
+ type: "uint256",
3560
+ },
3561
+ ],
3562
+ internalType: "struct Price.Props",
3563
+ name: "longTokenPrice",
3564
+ type: "tuple",
3565
+ },
3566
+ {
3567
+ components: [
3568
+ {
3569
+ internalType: "uint256",
3570
+ name: "min",
3571
+ type: "uint256",
3572
+ },
3573
+ {
3574
+ internalType: "uint256",
3575
+ name: "max",
3576
+ type: "uint256",
3577
+ },
3578
+ ],
3579
+ internalType: "struct Price.Props",
3580
+ name: "shortTokenPrice",
3581
+ type: "tuple",
3582
+ },
3583
+ ],
3584
+ internalType: "struct MarketUtils.MarketPrices[]",
3585
+ name: "prices",
3586
+ type: "tuple[]",
3587
+ },
3588
+ {
3589
+ internalType: "address",
3590
+ name: "uiFeeReceiver",
3591
+ type: "address",
3592
+ },
3593
+ ],
3594
+ name: "getPositionInfoList",
3595
+ outputs: [
3596
+ {
3597
+ components: [
3598
+ {
3599
+ internalType: "bytes32",
3600
+ name: "positionKey",
3601
+ type: "bytes32",
3602
+ },
3603
+ {
3604
+ components: [
3605
+ {
3606
+ components: [
3607
+ {
3608
+ internalType: "address",
3609
+ name: "account",
3610
+ type: "address",
3611
+ },
3612
+ {
3613
+ internalType: "address",
3614
+ name: "market",
3615
+ type: "address",
3616
+ },
3617
+ {
3618
+ internalType: "address",
3619
+ name: "collateralToken",
3620
+ type: "address",
3621
+ },
3622
+ ],
3623
+ internalType: "struct Position.Addresses",
3624
+ name: "addresses",
3625
+ type: "tuple",
3626
+ },
3627
+ {
3628
+ components: [
3629
+ {
3630
+ internalType: "uint256",
3631
+ name: "sizeInUsd",
3632
+ type: "uint256",
3633
+ },
3634
+ {
3635
+ internalType: "uint256",
3636
+ name: "sizeInTokens",
3637
+ type: "uint256",
3638
+ },
3639
+ {
3640
+ internalType: "uint256",
3641
+ name: "collateralAmount",
3642
+ type: "uint256",
3643
+ },
3644
+ {
3645
+ internalType: "int256",
3646
+ name: "pendingImpactAmount",
3647
+ type: "int256",
3648
+ },
3649
+ {
3650
+ internalType: "uint256",
3651
+ name: "borrowingFactor",
3652
+ type: "uint256",
3653
+ },
3654
+ {
3655
+ internalType: "uint256",
3656
+ name: "fundingFeeAmountPerSize",
3657
+ type: "uint256",
3658
+ },
3659
+ {
3660
+ internalType: "uint256",
3661
+ name: "longTokenClaimableFundingAmountPerSize",
3662
+ type: "uint256",
3663
+ },
3664
+ {
3665
+ internalType: "uint256",
3666
+ name: "shortTokenClaimableFundingAmountPerSize",
3667
+ type: "uint256",
3668
+ },
3669
+ {
3670
+ internalType: "uint256",
3671
+ name: "increasedAtTime",
3672
+ type: "uint256",
3673
+ },
3674
+ {
3675
+ internalType: "uint256",
3676
+ name: "decreasedAtTime",
3677
+ type: "uint256",
3678
+ },
3679
+ ],
3680
+ internalType: "struct Position.Numbers",
3681
+ name: "numbers",
3682
+ type: "tuple",
3683
+ },
3684
+ {
3685
+ components: [
3686
+ {
3687
+ internalType: "bool",
3688
+ name: "isLong",
3689
+ type: "bool",
3690
+ },
3691
+ ],
3692
+ internalType: "struct Position.Flags",
3693
+ name: "flags",
3694
+ type: "tuple",
3695
+ },
3696
+ ],
3697
+ internalType: "struct Position.Props",
3698
+ name: "position",
3699
+ type: "tuple",
3700
+ },
3701
+ {
3702
+ components: [
3703
+ {
3704
+ components: [
3705
+ {
3706
+ internalType: "bytes32",
3707
+ name: "referralCode",
3708
+ type: "bytes32",
3709
+ },
3710
+ {
3711
+ internalType: "address",
3712
+ name: "affiliate",
3713
+ type: "address",
3714
+ },
3715
+ {
3716
+ internalType: "address",
3717
+ name: "trader",
3718
+ type: "address",
3719
+ },
3720
+ {
3721
+ internalType: "uint256",
3722
+ name: "totalRebateFactor",
3723
+ type: "uint256",
3724
+ },
3725
+ {
3726
+ internalType: "uint256",
3727
+ name: "affiliateRewardFactor",
3728
+ type: "uint256",
3729
+ },
3730
+ {
3731
+ internalType: "uint256",
3732
+ name: "adjustedAffiliateRewardFactor",
3733
+ type: "uint256",
3734
+ },
3735
+ {
3736
+ internalType: "uint256",
3737
+ name: "traderDiscountFactor",
3738
+ type: "uint256",
3739
+ },
3740
+ {
3741
+ internalType: "uint256",
3742
+ name: "totalRebateAmount",
3743
+ type: "uint256",
3744
+ },
3745
+ {
3746
+ internalType: "uint256",
3747
+ name: "traderDiscountAmount",
3748
+ type: "uint256",
3749
+ },
3750
+ {
3751
+ internalType: "uint256",
3752
+ name: "affiliateRewardAmount",
3753
+ type: "uint256",
3754
+ },
3755
+ ],
3756
+ internalType: "struct PositionPricingUtils.PositionReferralFees",
3757
+ name: "referral",
3758
+ type: "tuple",
3759
+ },
3760
+ {
3761
+ components: [
3762
+ {
3763
+ internalType: "uint256",
3764
+ name: "traderTier",
3765
+ type: "uint256",
3766
+ },
3767
+ {
3768
+ internalType: "uint256",
3769
+ name: "traderDiscountFactor",
3770
+ type: "uint256",
3771
+ },
3772
+ {
3773
+ internalType: "uint256",
3774
+ name: "traderDiscountAmount",
3775
+ type: "uint256",
3776
+ },
3777
+ ],
3778
+ internalType: "struct PositionPricingUtils.PositionProFees",
3779
+ name: "pro",
3780
+ type: "tuple",
3781
+ },
3782
+ {
3783
+ components: [
3784
+ {
3785
+ internalType: "uint256",
3786
+ name: "fundingFeeAmount",
3787
+ type: "uint256",
3788
+ },
3789
+ {
3790
+ internalType: "uint256",
3791
+ name: "claimableLongTokenAmount",
3792
+ type: "uint256",
3793
+ },
3794
+ {
3795
+ internalType: "uint256",
3796
+ name: "claimableShortTokenAmount",
3797
+ type: "uint256",
3798
+ },
3799
+ {
3800
+ internalType: "uint256",
3801
+ name: "latestFundingFeeAmountPerSize",
3802
+ type: "uint256",
3803
+ },
3804
+ {
3805
+ internalType: "uint256",
3806
+ name: "latestLongTokenClaimableFundingAmountPerSize",
3807
+ type: "uint256",
3808
+ },
3809
+ {
3810
+ internalType: "uint256",
3811
+ name: "latestShortTokenClaimableFundingAmountPerSize",
3812
+ type: "uint256",
3813
+ },
3814
+ ],
3815
+ internalType: "struct PositionPricingUtils.PositionFundingFees",
3816
+ name: "funding",
3817
+ type: "tuple",
3818
+ },
3819
+ {
3820
+ components: [
3821
+ {
3822
+ internalType: "uint256",
3823
+ name: "borrowingFeeUsd",
3824
+ type: "uint256",
3825
+ },
3826
+ {
3827
+ internalType: "uint256",
3828
+ name: "borrowingFeeAmount",
3829
+ type: "uint256",
3830
+ },
3831
+ {
3832
+ internalType: "uint256",
3833
+ name: "borrowingFeeReceiverFactor",
3834
+ type: "uint256",
3835
+ },
3836
+ {
3837
+ internalType: "uint256",
3838
+ name: "borrowingFeeAmountForFeeReceiver",
3839
+ type: "uint256",
3840
+ },
3841
+ ],
3842
+ internalType: "struct PositionPricingUtils.PositionBorrowingFees",
3843
+ name: "borrowing",
3844
+ type: "tuple",
3845
+ },
3846
+ {
3847
+ components: [
3848
+ {
3849
+ internalType: "address",
3850
+ name: "uiFeeReceiver",
3851
+ type: "address",
3852
+ },
3853
+ {
3854
+ internalType: "uint256",
3855
+ name: "uiFeeReceiverFactor",
3856
+ type: "uint256",
3857
+ },
3858
+ {
3859
+ internalType: "uint256",
3860
+ name: "uiFeeAmount",
3861
+ type: "uint256",
3862
+ },
3863
+ ],
3864
+ internalType: "struct PositionPricingUtils.PositionUiFees",
3865
+ name: "ui",
3866
+ type: "tuple",
3867
+ },
3868
+ {
3869
+ components: [
3870
+ {
3871
+ internalType: "uint256",
3872
+ name: "liquidationFeeUsd",
3873
+ type: "uint256",
3874
+ },
3875
+ {
3876
+ internalType: "uint256",
3877
+ name: "liquidationFeeAmount",
3878
+ type: "uint256",
3879
+ },
3880
+ {
3881
+ internalType: "uint256",
3882
+ name: "liquidationFeeReceiverFactor",
3883
+ type: "uint256",
3884
+ },
3885
+ {
3886
+ internalType: "uint256",
3887
+ name: "liquidationFeeAmountForFeeReceiver",
3888
+ type: "uint256",
3889
+ },
3890
+ ],
3891
+ internalType: "struct PositionPricingUtils.PositionLiquidationFees",
3892
+ name: "liquidation",
3893
+ type: "tuple",
3894
+ },
3895
+ {
3896
+ components: [
3897
+ {
3898
+ internalType: "uint256",
3899
+ name: "min",
3900
+ type: "uint256",
3901
+ },
3902
+ {
3903
+ internalType: "uint256",
3904
+ name: "max",
3905
+ type: "uint256",
3906
+ },
3907
+ ],
3908
+ internalType: "struct Price.Props",
3909
+ name: "collateralTokenPrice",
3910
+ type: "tuple",
3911
+ },
3912
+ {
3913
+ internalType: "uint256",
3914
+ name: "positionFeeFactor",
3915
+ type: "uint256",
3916
+ },
3917
+ {
3918
+ internalType: "uint256",
3919
+ name: "protocolFeeAmount",
3920
+ type: "uint256",
3921
+ },
3922
+ {
3923
+ internalType: "uint256",
3924
+ name: "positionFeeReceiverFactor",
3925
+ type: "uint256",
3926
+ },
3927
+ {
3928
+ internalType: "uint256",
3929
+ name: "feeReceiverAmount",
3930
+ type: "uint256",
3931
+ },
3932
+ {
3933
+ internalType: "uint256",
3934
+ name: "feeAmountForPool",
3935
+ type: "uint256",
3936
+ },
3937
+ {
3938
+ internalType: "uint256",
3939
+ name: "positionFeeAmountForPool",
3940
+ type: "uint256",
3941
+ },
3942
+ {
3943
+ internalType: "uint256",
3944
+ name: "positionFeeAmount",
3945
+ type: "uint256",
3946
+ },
3947
+ {
3948
+ internalType: "uint256",
3949
+ name: "totalCostAmountExcludingFunding",
3950
+ type: "uint256",
3951
+ },
3952
+ {
3953
+ internalType: "uint256",
3954
+ name: "totalCostAmount",
3955
+ type: "uint256",
3956
+ },
3957
+ {
3958
+ internalType: "uint256",
3959
+ name: "totalDiscountAmount",
3960
+ type: "uint256",
3961
+ },
3962
+ ],
3963
+ internalType: "struct PositionPricingUtils.PositionFees",
3964
+ name: "fees",
3965
+ type: "tuple",
3966
+ },
3967
+ {
3968
+ components: [
3969
+ {
3970
+ internalType: "int256",
3971
+ name: "priceImpactUsd",
3972
+ type: "int256",
3973
+ },
3974
+ {
3975
+ internalType: "uint256",
3976
+ name: "executionPrice",
3977
+ type: "uint256",
3978
+ },
3979
+ {
3980
+ internalType: "bool",
3981
+ name: "balanceWasImproved",
3982
+ type: "bool",
3983
+ },
3984
+ {
3985
+ internalType: "int256",
3986
+ name: "proportionalPendingImpactUsd",
3987
+ type: "int256",
3988
+ },
3989
+ {
3990
+ internalType: "int256",
3991
+ name: "totalImpactUsd",
3992
+ type: "int256",
3993
+ },
3994
+ {
3995
+ internalType: "uint256",
3996
+ name: "priceImpactDiffUsd",
3997
+ type: "uint256",
3998
+ },
3999
+ ],
4000
+ internalType: "struct ReaderPricingUtils.ExecutionPriceResult",
4001
+ name: "executionPriceResult",
4002
+ type: "tuple",
4003
+ },
4004
+ {
4005
+ internalType: "int256",
4006
+ name: "basePnlUsd",
4007
+ type: "int256",
4008
+ },
4009
+ {
4010
+ internalType: "int256",
4011
+ name: "uncappedBasePnlUsd",
4012
+ type: "int256",
4013
+ },
4014
+ {
4015
+ internalType: "int256",
4016
+ name: "pnlAfterPriceImpactUsd",
4017
+ type: "int256",
4018
+ },
4019
+ ],
4020
+ internalType: "struct ReaderPositionUtils.PositionInfo[]",
4021
+ name: "",
4022
+ type: "tuple[]",
4023
+ },
4024
+ ],
4025
+ stateMutability: "view",
4026
+ type: "function",
4027
+ },
4028
+ {
4029
+ inputs: [
4030
+ {
4031
+ internalType: "contract DataStore",
4032
+ name: "dataStore",
4033
+ type: "address",
4034
+ },
4035
+ {
4036
+ components: [
4037
+ {
4038
+ internalType: "address",
4039
+ name: "marketToken",
4040
+ type: "address",
4041
+ },
4042
+ {
4043
+ internalType: "address",
4044
+ name: "indexToken",
4045
+ type: "address",
4046
+ },
4047
+ {
4048
+ internalType: "address",
4049
+ name: "longToken",
4050
+ type: "address",
4051
+ },
4052
+ {
4053
+ internalType: "address",
4054
+ name: "shortToken",
4055
+ type: "address",
4056
+ },
4057
+ ],
4058
+ internalType: "struct Market.Props",
4059
+ name: "market",
4060
+ type: "tuple",
4061
+ },
4062
+ {
4063
+ components: [
4064
+ {
4065
+ components: [
4066
+ {
4067
+ internalType: "uint256",
4068
+ name: "min",
4069
+ type: "uint256",
4070
+ },
4071
+ {
4072
+ internalType: "uint256",
4073
+ name: "max",
4074
+ type: "uint256",
4075
+ },
4076
+ ],
4077
+ internalType: "struct Price.Props",
4078
+ name: "indexTokenPrice",
4079
+ type: "tuple",
4080
+ },
4081
+ {
4082
+ components: [
4083
+ {
4084
+ internalType: "uint256",
4085
+ name: "min",
4086
+ type: "uint256",
4087
+ },
4088
+ {
4089
+ internalType: "uint256",
4090
+ name: "max",
4091
+ type: "uint256",
4092
+ },
4093
+ ],
4094
+ internalType: "struct Price.Props",
4095
+ name: "longTokenPrice",
4096
+ type: "tuple",
4097
+ },
4098
+ {
4099
+ components: [
4100
+ {
4101
+ internalType: "uint256",
4102
+ name: "min",
4103
+ type: "uint256",
4104
+ },
4105
+ {
4106
+ internalType: "uint256",
4107
+ name: "max",
4108
+ type: "uint256",
4109
+ },
4110
+ ],
4111
+ internalType: "struct Price.Props",
4112
+ name: "shortTokenPrice",
4113
+ type: "tuple",
4114
+ },
4115
+ ],
4116
+ internalType: "struct MarketUtils.MarketPrices",
4117
+ name: "prices",
4118
+ type: "tuple",
4119
+ },
4120
+ {
4121
+ internalType: "bytes32",
4122
+ name: "positionKey",
4123
+ type: "bytes32",
4124
+ },
4125
+ {
4126
+ internalType: "uint256",
4127
+ name: "sizeDeltaUsd",
4128
+ type: "uint256",
4129
+ },
4130
+ ],
4131
+ name: "getPositionPnlUsd",
4132
+ outputs: [
4133
+ {
4134
+ internalType: "int256",
4135
+ name: "",
4136
+ type: "int256",
4137
+ },
4138
+ {
4139
+ internalType: "int256",
4140
+ name: "",
4141
+ type: "int256",
4142
+ },
4143
+ {
4144
+ internalType: "uint256",
4145
+ name: "",
4146
+ type: "uint256",
4147
+ },
4148
+ ],
4149
+ stateMutability: "view",
4150
+ type: "function",
4151
+ },
4152
+ {
4153
+ inputs: [
4154
+ {
4155
+ internalType: "contract DataStore",
4156
+ name: "dataStore",
4157
+ type: "address",
4158
+ },
4159
+ {
4160
+ internalType: "bytes32",
4161
+ name: "key",
4162
+ type: "bytes32",
4163
+ },
4164
+ ],
4165
+ name: "getShift",
4166
+ outputs: [
4167
+ {
4168
+ components: [
4169
+ {
4170
+ components: [
4171
+ {
4172
+ internalType: "address",
4173
+ name: "account",
4174
+ type: "address",
4175
+ },
4176
+ {
4177
+ internalType: "address",
4178
+ name: "receiver",
4179
+ type: "address",
4180
+ },
4181
+ {
4182
+ internalType: "address",
4183
+ name: "callbackContract",
4184
+ type: "address",
4185
+ },
4186
+ {
4187
+ internalType: "address",
4188
+ name: "uiFeeReceiver",
4189
+ type: "address",
4190
+ },
4191
+ {
4192
+ internalType: "address",
4193
+ name: "fromMarket",
4194
+ type: "address",
4195
+ },
4196
+ {
4197
+ internalType: "address",
4198
+ name: "toMarket",
4199
+ type: "address",
4200
+ },
4201
+ ],
4202
+ internalType: "struct Shift.Addresses",
4203
+ name: "addresses",
4204
+ type: "tuple",
4205
+ },
4206
+ {
4207
+ components: [
4208
+ {
4209
+ internalType: "uint256",
4210
+ name: "marketTokenAmount",
4211
+ type: "uint256",
4212
+ },
4213
+ {
4214
+ internalType: "uint256",
4215
+ name: "minMarketTokens",
4216
+ type: "uint256",
4217
+ },
4218
+ {
4219
+ internalType: "uint256",
4220
+ name: "updatedAtTime",
4221
+ type: "uint256",
4222
+ },
4223
+ {
4224
+ internalType: "uint256",
4225
+ name: "executionFee",
4226
+ type: "uint256",
4227
+ },
4228
+ {
4229
+ internalType: "uint256",
4230
+ name: "callbackGasLimit",
4231
+ type: "uint256",
4232
+ },
4233
+ {
4234
+ internalType: "uint256",
4235
+ name: "srcChainId",
4236
+ type: "uint256",
4237
+ },
4238
+ ],
4239
+ internalType: "struct Shift.Numbers",
4240
+ name: "numbers",
4241
+ type: "tuple",
4242
+ },
4243
+ {
4244
+ internalType: "bytes32[]",
4245
+ name: "_dataList",
4246
+ type: "bytes32[]",
4247
+ },
4248
+ ],
4249
+ internalType: "struct Shift.Props",
4250
+ name: "",
4251
+ type: "tuple",
4252
+ },
4253
+ ],
4254
+ stateMutability: "view",
4255
+ type: "function",
4256
+ },
4257
+ {
4258
+ inputs: [
4259
+ {
4260
+ internalType: "contract DataStore",
4261
+ name: "dataStore",
4262
+ type: "address",
4263
+ },
4264
+ {
4265
+ components: [
4266
+ {
4267
+ internalType: "address",
4268
+ name: "marketToken",
4269
+ type: "address",
4270
+ },
4271
+ {
4272
+ internalType: "address",
4273
+ name: "indexToken",
4274
+ type: "address",
4275
+ },
4276
+ {
4277
+ internalType: "address",
4278
+ name: "longToken",
4279
+ type: "address",
4280
+ },
4281
+ {
4282
+ internalType: "address",
4283
+ name: "shortToken",
4284
+ type: "address",
4285
+ },
4286
+ ],
4287
+ internalType: "struct Market.Props",
4288
+ name: "market",
4289
+ type: "tuple",
4290
+ },
4291
+ {
4292
+ components: [
4293
+ {
4294
+ components: [
4295
+ {
4296
+ internalType: "uint256",
4297
+ name: "min",
4298
+ type: "uint256",
4299
+ },
4300
+ {
4301
+ internalType: "uint256",
4302
+ name: "max",
4303
+ type: "uint256",
4304
+ },
4305
+ ],
4306
+ internalType: "struct Price.Props",
4307
+ name: "indexTokenPrice",
4308
+ type: "tuple",
4309
+ },
4310
+ {
4311
+ components: [
4312
+ {
4313
+ internalType: "uint256",
4314
+ name: "min",
4315
+ type: "uint256",
4316
+ },
4317
+ {
4318
+ internalType: "uint256",
4319
+ name: "max",
4320
+ type: "uint256",
4321
+ },
4322
+ ],
4323
+ internalType: "struct Price.Props",
4324
+ name: "longTokenPrice",
4325
+ type: "tuple",
4326
+ },
4327
+ {
4328
+ components: [
4329
+ {
4330
+ internalType: "uint256",
4331
+ name: "min",
4332
+ type: "uint256",
4333
+ },
4334
+ {
4335
+ internalType: "uint256",
4336
+ name: "max",
4337
+ type: "uint256",
4338
+ },
4339
+ ],
4340
+ internalType: "struct Price.Props",
4341
+ name: "shortTokenPrice",
4342
+ type: "tuple",
4343
+ },
4344
+ ],
4345
+ internalType: "struct MarketUtils.MarketPrices",
4346
+ name: "prices",
4347
+ type: "tuple",
4348
+ },
4349
+ {
4350
+ internalType: "address",
4351
+ name: "tokenIn",
4352
+ type: "address",
4353
+ },
4354
+ {
4355
+ internalType: "uint256",
4356
+ name: "amountIn",
4357
+ type: "uint256",
4358
+ },
4359
+ {
4360
+ internalType: "address",
4361
+ name: "uiFeeReceiver",
4362
+ type: "address",
4363
+ },
4364
+ ],
4365
+ name: "getSwapAmountOut",
4366
+ outputs: [
4367
+ {
4368
+ internalType: "uint256",
4369
+ name: "",
4370
+ type: "uint256",
4371
+ },
4372
+ {
4373
+ internalType: "int256",
4374
+ name: "",
4375
+ type: "int256",
4376
+ },
4377
+ {
4378
+ components: [
4379
+ {
4380
+ internalType: "uint256",
4381
+ name: "feeReceiverAmount",
4382
+ type: "uint256",
4383
+ },
4384
+ {
4385
+ internalType: "uint256",
4386
+ name: "feeAmountForPool",
4387
+ type: "uint256",
4388
+ },
4389
+ {
4390
+ internalType: "uint256",
4391
+ name: "amountAfterFees",
4392
+ type: "uint256",
4393
+ },
4394
+ {
4395
+ internalType: "address",
4396
+ name: "uiFeeReceiver",
4397
+ type: "address",
4398
+ },
4399
+ {
4400
+ internalType: "uint256",
4401
+ name: "uiFeeReceiverFactor",
4402
+ type: "uint256",
4403
+ },
4404
+ {
4405
+ internalType: "uint256",
4406
+ name: "uiFeeAmount",
4407
+ type: "uint256",
4408
+ },
4409
+ ],
4410
+ internalType: "struct SwapPricingUtils.SwapFees",
4411
+ name: "fees",
4412
+ type: "tuple",
4413
+ },
4414
+ ],
4415
+ stateMutability: "view",
4416
+ type: "function",
4417
+ },
4418
+ {
4419
+ inputs: [
4420
+ {
4421
+ internalType: "contract DataStore",
4422
+ name: "dataStore",
4423
+ type: "address",
4424
+ },
4425
+ {
4426
+ internalType: "address",
4427
+ name: "marketKey",
4428
+ type: "address",
4429
+ },
4430
+ {
4431
+ internalType: "address",
4432
+ name: "tokenIn",
4433
+ type: "address",
4434
+ },
4435
+ {
4436
+ internalType: "address",
4437
+ name: "tokenOut",
4438
+ type: "address",
4439
+ },
4440
+ {
4441
+ internalType: "uint256",
4442
+ name: "amountIn",
4443
+ type: "uint256",
4444
+ },
4445
+ {
4446
+ components: [
4447
+ {
4448
+ internalType: "uint256",
4449
+ name: "min",
4450
+ type: "uint256",
4451
+ },
4452
+ {
4453
+ internalType: "uint256",
4454
+ name: "max",
4455
+ type: "uint256",
4456
+ },
4457
+ ],
4458
+ internalType: "struct Price.Props",
4459
+ name: "tokenInPrice",
4460
+ type: "tuple",
4461
+ },
4462
+ {
4463
+ components: [
4464
+ {
4465
+ internalType: "uint256",
4466
+ name: "min",
4467
+ type: "uint256",
4468
+ },
4469
+ {
4470
+ internalType: "uint256",
4471
+ name: "max",
4472
+ type: "uint256",
4473
+ },
4474
+ ],
4475
+ internalType: "struct Price.Props",
4476
+ name: "tokenOutPrice",
4477
+ type: "tuple",
4478
+ },
4479
+ ],
4480
+ name: "getSwapPriceImpact",
4481
+ outputs: [
4482
+ {
4483
+ internalType: "int256",
4484
+ name: "",
4485
+ type: "int256",
4486
+ },
4487
+ {
4488
+ internalType: "int256",
4489
+ name: "",
4490
+ type: "int256",
4491
+ },
4492
+ {
4493
+ internalType: "int256",
4494
+ name: "",
4495
+ type: "int256",
4496
+ },
4497
+ ],
4498
+ stateMutability: "view",
4499
+ type: "function",
4500
+ },
4501
+ {
4502
+ inputs: [
4503
+ {
4504
+ internalType: "contract DataStore",
4505
+ name: "dataStore",
4506
+ type: "address",
4507
+ },
4508
+ {
4509
+ internalType: "bytes32",
4510
+ name: "key",
4511
+ type: "bytes32",
4512
+ },
4513
+ ],
4514
+ name: "getWithdrawal",
4515
+ outputs: [
4516
+ {
4517
+ components: [
4518
+ {
4519
+ components: [
4520
+ {
4521
+ internalType: "address",
4522
+ name: "account",
4523
+ type: "address",
4524
+ },
4525
+ {
4526
+ internalType: "address",
4527
+ name: "receiver",
4528
+ type: "address",
4529
+ },
4530
+ {
4531
+ internalType: "address",
4532
+ name: "callbackContract",
4533
+ type: "address",
4534
+ },
4535
+ {
4536
+ internalType: "address",
4537
+ name: "uiFeeReceiver",
4538
+ type: "address",
4539
+ },
4540
+ {
4541
+ internalType: "address",
4542
+ name: "market",
4543
+ type: "address",
4544
+ },
4545
+ {
4546
+ internalType: "address[]",
4547
+ name: "longTokenSwapPath",
4548
+ type: "address[]",
4549
+ },
4550
+ {
4551
+ internalType: "address[]",
4552
+ name: "shortTokenSwapPath",
4553
+ type: "address[]",
4554
+ },
4555
+ ],
4556
+ internalType: "struct Withdrawal.Addresses",
4557
+ name: "addresses",
4558
+ type: "tuple",
4559
+ },
4560
+ {
4561
+ components: [
4562
+ {
4563
+ internalType: "uint256",
4564
+ name: "marketTokenAmount",
4565
+ type: "uint256",
4566
+ },
4567
+ {
4568
+ internalType: "uint256",
4569
+ name: "minLongTokenAmount",
4570
+ type: "uint256",
4571
+ },
4572
+ {
4573
+ internalType: "uint256",
4574
+ name: "minShortTokenAmount",
4575
+ type: "uint256",
4576
+ },
4577
+ {
4578
+ internalType: "uint256",
4579
+ name: "updatedAtTime",
4580
+ type: "uint256",
4581
+ },
4582
+ {
4583
+ internalType: "uint256",
4584
+ name: "executionFee",
4585
+ type: "uint256",
4586
+ },
4587
+ {
4588
+ internalType: "uint256",
4589
+ name: "callbackGasLimit",
4590
+ type: "uint256",
4591
+ },
4592
+ {
4593
+ internalType: "uint256",
4594
+ name: "srcChainId",
4595
+ type: "uint256",
4596
+ },
4597
+ ],
4598
+ internalType: "struct Withdrawal.Numbers",
4599
+ name: "numbers",
4600
+ type: "tuple",
4601
+ },
4602
+ {
4603
+ components: [
4604
+ {
4605
+ internalType: "bool",
4606
+ name: "shouldUnwrapNativeToken",
4607
+ type: "bool",
4608
+ },
4609
+ ],
4610
+ internalType: "struct Withdrawal.Flags",
4611
+ name: "flags",
4612
+ type: "tuple",
4613
+ },
4614
+ {
4615
+ internalType: "bytes32[]",
4616
+ name: "_dataList",
4617
+ type: "bytes32[]",
4618
+ },
4619
+ ],
4620
+ internalType: "struct Withdrawal.Props",
4621
+ name: "",
4622
+ type: "tuple",
4623
+ },
4624
+ ],
4625
+ stateMutability: "view",
4626
+ type: "function",
4627
+ },
4628
+ {
4629
+ inputs: [
4630
+ {
4631
+ internalType: "contract DataStore",
4632
+ name: "dataStore",
4633
+ type: "address",
4634
+ },
4635
+ {
4636
+ components: [
4637
+ {
4638
+ internalType: "address",
4639
+ name: "marketToken",
4640
+ type: "address",
4641
+ },
4642
+ {
4643
+ internalType: "address",
4644
+ name: "indexToken",
4645
+ type: "address",
4646
+ },
4647
+ {
4648
+ internalType: "address",
4649
+ name: "longToken",
4650
+ type: "address",
4651
+ },
4652
+ {
4653
+ internalType: "address",
4654
+ name: "shortToken",
4655
+ type: "address",
4656
+ },
4657
+ ],
4658
+ internalType: "struct Market.Props",
4659
+ name: "market",
4660
+ type: "tuple",
4661
+ },
4662
+ {
4663
+ components: [
4664
+ {
4665
+ components: [
4666
+ {
4667
+ internalType: "uint256",
4668
+ name: "min",
4669
+ type: "uint256",
4670
+ },
4671
+ {
4672
+ internalType: "uint256",
4673
+ name: "max",
4674
+ type: "uint256",
4675
+ },
4676
+ ],
4677
+ internalType: "struct Price.Props",
4678
+ name: "indexTokenPrice",
4679
+ type: "tuple",
4680
+ },
4681
+ {
4682
+ components: [
4683
+ {
4684
+ internalType: "uint256",
4685
+ name: "min",
4686
+ type: "uint256",
4687
+ },
4688
+ {
4689
+ internalType: "uint256",
4690
+ name: "max",
4691
+ type: "uint256",
4692
+ },
4693
+ ],
4694
+ internalType: "struct Price.Props",
4695
+ name: "longTokenPrice",
4696
+ type: "tuple",
4697
+ },
4698
+ {
4699
+ components: [
4700
+ {
4701
+ internalType: "uint256",
4702
+ name: "min",
4703
+ type: "uint256",
4704
+ },
4705
+ {
4706
+ internalType: "uint256",
4707
+ name: "max",
4708
+ type: "uint256",
4709
+ },
4710
+ ],
4711
+ internalType: "struct Price.Props",
4712
+ name: "shortTokenPrice",
4713
+ type: "tuple",
4714
+ },
4715
+ ],
4716
+ internalType: "struct MarketUtils.MarketPrices",
4717
+ name: "prices",
4718
+ type: "tuple",
4719
+ },
4720
+ {
4721
+ internalType: "uint256",
4722
+ name: "marketTokenAmount",
4723
+ type: "uint256",
4724
+ },
4725
+ {
4726
+ internalType: "address",
4727
+ name: "uiFeeReceiver",
4728
+ type: "address",
4729
+ },
4730
+ {
4731
+ internalType: "enum ISwapPricingUtils.SwapPricingType",
4732
+ name: "swapPricingType",
4733
+ type: "uint8",
4734
+ },
4735
+ ],
4736
+ name: "getWithdrawalAmountOut",
4737
+ outputs: [
4738
+ {
4739
+ internalType: "uint256",
4740
+ name: "",
4741
+ type: "uint256",
4742
+ },
4743
+ {
4744
+ internalType: "uint256",
4745
+ name: "",
4746
+ type: "uint256",
4747
+ },
4748
+ ],
4749
+ stateMutability: "view",
4750
+ type: "function",
4751
+ },
4752
+ {
4753
+ inputs: [
4754
+ {
4755
+ internalType: "contract DataStore",
4756
+ name: "dataStore",
4757
+ type: "address",
4758
+ },
4759
+ {
4760
+ internalType: "contract IReferralStorage",
4761
+ name: "referralStorage",
4762
+ type: "address",
4763
+ },
4764
+ {
4765
+ internalType: "bytes32",
4766
+ name: "positionKey",
4767
+ type: "bytes32",
4768
+ },
4769
+ {
4770
+ components: [
4771
+ {
4772
+ internalType: "address",
4773
+ name: "marketToken",
4774
+ type: "address",
4775
+ },
4776
+ {
4777
+ internalType: "address",
4778
+ name: "indexToken",
4779
+ type: "address",
4780
+ },
4781
+ {
4782
+ internalType: "address",
4783
+ name: "longToken",
4784
+ type: "address",
4785
+ },
4786
+ {
4787
+ internalType: "address",
4788
+ name: "shortToken",
4789
+ type: "address",
4790
+ },
4791
+ ],
4792
+ internalType: "struct Market.Props",
4793
+ name: "market",
4794
+ type: "tuple",
4795
+ },
4796
+ {
4797
+ components: [
4798
+ {
4799
+ components: [
4800
+ {
4801
+ internalType: "uint256",
4802
+ name: "min",
4803
+ type: "uint256",
4804
+ },
4805
+ {
4806
+ internalType: "uint256",
4807
+ name: "max",
4808
+ type: "uint256",
4809
+ },
4810
+ ],
4811
+ internalType: "struct Price.Props",
4812
+ name: "indexTokenPrice",
4813
+ type: "tuple",
4814
+ },
4815
+ {
4816
+ components: [
4817
+ {
4818
+ internalType: "uint256",
4819
+ name: "min",
4820
+ type: "uint256",
4821
+ },
4822
+ {
4823
+ internalType: "uint256",
4824
+ name: "max",
4825
+ type: "uint256",
4826
+ },
4827
+ ],
4828
+ internalType: "struct Price.Props",
4829
+ name: "longTokenPrice",
4830
+ type: "tuple",
4831
+ },
4832
+ {
4833
+ components: [
4834
+ {
4835
+ internalType: "uint256",
4836
+ name: "min",
4837
+ type: "uint256",
4838
+ },
4839
+ {
4840
+ internalType: "uint256",
4841
+ name: "max",
4842
+ type: "uint256",
4843
+ },
4844
+ ],
4845
+ internalType: "struct Price.Props",
4846
+ name: "shortTokenPrice",
4847
+ type: "tuple",
4848
+ },
4849
+ ],
4850
+ internalType: "struct MarketUtils.MarketPrices",
4851
+ name: "prices",
4852
+ type: "tuple",
4853
+ },
4854
+ {
4855
+ internalType: "bool",
4856
+ name: "shouldValidateMinCollateralUsd",
4857
+ type: "bool",
4858
+ },
4859
+ {
4860
+ internalType: "bool",
4861
+ name: "forLiquidation",
4862
+ type: "bool",
4863
+ },
4864
+ ],
4865
+ name: "isPositionLiquidatable",
4866
+ outputs: [
4867
+ {
4868
+ internalType: "bool",
4869
+ name: "",
4870
+ type: "bool",
4871
+ },
4872
+ {
4873
+ internalType: "string",
4874
+ name: "",
4875
+ type: "string",
4876
+ },
4877
+ {
4878
+ components: [
4879
+ {
4880
+ internalType: "int256",
4881
+ name: "remainingCollateralUsd",
4882
+ type: "int256",
4883
+ },
4884
+ {
4885
+ internalType: "int256",
4886
+ name: "minCollateralUsd",
4887
+ type: "int256",
4888
+ },
4889
+ {
4890
+ internalType: "int256",
4891
+ name: "minCollateralUsdForLeverage",
4892
+ type: "int256",
4893
+ },
4894
+ ],
4895
+ internalType: "struct PositionUtils.IsPositionLiquidatableInfo",
4896
+ name: "",
4897
+ type: "tuple",
4898
+ },
4899
+ ],
4900
+ stateMutability: "view",
4901
+ type: "function",
4902
+ },
4903
+ ];