lynx-client 0.0.4 → 0.0.6

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 (155) hide show
  1. package/dist/cjs/index.js +10 -2
  2. package/dist/cjs/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/AcceptableImplementationClaimableAdminService.js +53 -0
  3. package/dist/cjs/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/IAcceptableImplementationClaimableAdminService.js +2 -0
  4. package/dist/cjs/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/index.js +5 -0
  5. package/dist/cjs/lib/contractsIntegration/LexPoolV1Service/ILexPoolV1Service.js +2 -0
  6. package/dist/cjs/lib/contractsIntegration/LexPoolV1Service/LexPoolV1Service.js +210 -0
  7. package/dist/cjs/lib/contractsIntegration/LexPoolV1Service/index.js +5 -0
  8. package/dist/cjs/lib/contractsIntegration/PNLRService/IPNLRService.js +2 -0
  9. package/dist/cjs/lib/contractsIntegration/PNLRService/PNLRService.js +124 -0
  10. package/dist/cjs/lib/contractsIntegration/PNLRService/index.js +5 -0
  11. package/dist/cjs/lib/contractsIntegration/PoolAccountantV1Service/IPoolAccountantV1Service.js +2 -0
  12. package/dist/cjs/lib/contractsIntegration/PoolAccountantV1Service/PoolAccountantV1Service.js +254 -0
  13. package/dist/cjs/lib/contractsIntegration/PoolAccountantV1Service/index.js +5 -0
  14. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +9 -9
  15. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +9 -9
  16. package/dist/cjs/lib/typechain/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin.js +2 -0
  17. package/dist/cjs/lib/typechain/contracts/Lynx/Lex/PNLR/PNLR.js +2 -0
  18. package/dist/cjs/lib/typechain/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1.js +2 -0
  19. package/dist/cjs/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.js +2 -0
  20. package/dist/cjs/lib/typechain/factories/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin__factory.js +232 -0
  21. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.js +585 -0
  22. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +3762 -0
  23. package/dist/cjs/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.js +116 -0
  24. package/dist/cjs/lib/typechain/lynxSystem/intentsVerifiers/chipsIntentsVerifier/chipsIntentsVerifierPayloadTypes.js +37 -0
  25. package/dist/cjs/lib/typechain/lynxSystem/intentsVerifiers/liquidityIntentsVerifier/liquidityIntentsVerifierPayloadTypes.js +39 -0
  26. package/dist/cjs/lib/typechain/lynxSystem/intentsVerifiers/tradeIntentsVerifier/tradeIntentsVerifierPayloadTypes.js +152 -0
  27. package/dist/esm/index.d.ts +14 -0
  28. package/dist/esm/index.d.ts.map +1 -1
  29. package/dist/esm/index.js +10 -2
  30. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/AcceptableImplementationClaimableAdminService.d.ts +10 -0
  31. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/AcceptableImplementationClaimableAdminService.d.ts.map +1 -0
  32. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/AcceptableImplementationClaimableAdminService.js +53 -0
  33. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/IAcceptableImplementationClaimableAdminService.d.ts +21 -0
  34. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/IAcceptableImplementationClaimableAdminService.d.ts.map +1 -0
  35. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/IAcceptableImplementationClaimableAdminService.js +2 -0
  36. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/index.d.ts +3 -0
  37. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/index.d.ts.map +1 -0
  38. package/dist/esm/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/index.js +5 -0
  39. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/ILexPoolV1Service.d.ts +124 -0
  40. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/ILexPoolV1Service.d.ts.map +1 -0
  41. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/ILexPoolV1Service.js +2 -0
  42. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/LexPoolV1Service.d.ts +24 -0
  43. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/LexPoolV1Service.d.ts.map +1 -0
  44. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/LexPoolV1Service.js +210 -0
  45. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/index.d.ts +3 -0
  46. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/index.d.ts.map +1 -0
  47. package/dist/esm/lib/contractsIntegration/LexPoolV1Service/index.js +5 -0
  48. package/dist/esm/lib/contractsIntegration/PNLRService/IPNLRService.d.ts +49 -0
  49. package/dist/esm/lib/contractsIntegration/PNLRService/IPNLRService.d.ts.map +1 -0
  50. package/dist/esm/lib/contractsIntegration/PNLRService/IPNLRService.js +2 -0
  51. package/dist/esm/lib/contractsIntegration/PNLRService/PNLRService.d.ts +14 -0
  52. package/dist/esm/lib/contractsIntegration/PNLRService/PNLRService.d.ts.map +1 -0
  53. package/dist/esm/lib/contractsIntegration/PNLRService/PNLRService.js +124 -0
  54. package/dist/esm/lib/contractsIntegration/PNLRService/index.d.ts +3 -0
  55. package/dist/esm/lib/contractsIntegration/PNLRService/index.d.ts.map +1 -0
  56. package/dist/esm/lib/contractsIntegration/PNLRService/index.js +5 -0
  57. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/IPoolAccountantV1Service.d.ts +160 -0
  58. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/IPoolAccountantV1Service.d.ts.map +1 -0
  59. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/IPoolAccountantV1Service.js +2 -0
  60. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/PoolAccountantV1Service.d.ts +31 -0
  61. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/PoolAccountantV1Service.d.ts.map +1 -0
  62. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/PoolAccountantV1Service.js +254 -0
  63. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/index.d.ts +3 -0
  64. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/index.d.ts.map +1 -0
  65. package/dist/esm/lib/contractsIntegration/PoolAccountantV1Service/index.js +5 -0
  66. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +2 -11
  67. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  68. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +9 -9
  69. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  70. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +9 -9
  71. package/dist/esm/lib/typechain/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin.d.ts +143 -0
  72. package/dist/esm/lib/typechain/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin.d.ts.map +1 -0
  73. package/dist/esm/lib/typechain/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin.js +2 -0
  74. package/dist/esm/lib/typechain/contracts/Lynx/Lex/PNLR/PNLR.d.ts +266 -0
  75. package/dist/esm/lib/typechain/contracts/Lynx/Lex/PNLR/PNLR.d.ts.map +1 -0
  76. package/dist/esm/lib/typechain/contracts/Lynx/Lex/PNLR/PNLR.js +2 -0
  77. package/dist/esm/lib/typechain/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1.d.ts +2085 -0
  78. package/dist/esm/lib/typechain/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1.d.ts.map +1 -0
  79. package/dist/esm/lib/typechain/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1.js +2 -0
  80. package/dist/esm/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts +72 -0
  81. package/dist/esm/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts.map +1 -0
  82. package/dist/esm/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.js +2 -0
  83. package/dist/esm/lib/typechain/factories/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin__factory.d.ts +173 -0
  84. package/dist/esm/lib/typechain/factories/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin__factory.d.ts.map +1 -0
  85. package/dist/esm/lib/typechain/factories/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin__factory.js +232 -0
  86. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts +439 -0
  87. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts.map +1 -0
  88. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.js +585 -0
  89. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +2899 -0
  90. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts.map +1 -0
  91. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +3762 -0
  92. package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts +81 -0
  93. package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts.map +1 -0
  94. package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.js +116 -0
  95. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/chipsIntentsVerifier/chipsIntentsVerifierPayloadTypes.d.ts +9 -0
  96. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/chipsIntentsVerifier/chipsIntentsVerifierPayloadTypes.d.ts.map +1 -0
  97. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/chipsIntentsVerifier/chipsIntentsVerifierPayloadTypes.js +37 -0
  98. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/liquidityIntentsVerifier/liquidityIntentsVerifierPayloadTypes.d.ts +9 -0
  99. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/liquidityIntentsVerifier/liquidityIntentsVerifierPayloadTypes.d.ts.map +1 -0
  100. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/liquidityIntentsVerifier/liquidityIntentsVerifierPayloadTypes.js +39 -0
  101. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/tradeIntentsVerifier/tradeIntentsVerifierPayloadTypes.d.ts +13 -0
  102. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/tradeIntentsVerifier/tradeIntentsVerifierPayloadTypes.d.ts.map +1 -0
  103. package/dist/esm/lib/typechain/lynxSystem/intentsVerifiers/tradeIntentsVerifier/tradeIntentsVerifierPayloadTypes.js +152 -0
  104. package/dist/types/index.d.ts +14 -0
  105. package/dist/types/index.d.ts.map +1 -1
  106. package/dist/types/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/AcceptableImplementationClaimableAdminService.d.ts +10 -0
  107. package/dist/types/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/AcceptableImplementationClaimableAdminService.d.ts.map +1 -0
  108. package/dist/types/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/IAcceptableImplementationClaimableAdminService.d.ts +21 -0
  109. package/dist/types/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/IAcceptableImplementationClaimableAdminService.d.ts.map +1 -0
  110. package/dist/types/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/index.d.ts +3 -0
  111. package/dist/types/lib/contractsIntegration/AcceptableImplementationClaimableAdminService/index.d.ts.map +1 -0
  112. package/dist/types/lib/contractsIntegration/LexPoolV1Service/ILexPoolV1Service.d.ts +124 -0
  113. package/dist/types/lib/contractsIntegration/LexPoolV1Service/ILexPoolV1Service.d.ts.map +1 -0
  114. package/dist/types/lib/contractsIntegration/LexPoolV1Service/LexPoolV1Service.d.ts +24 -0
  115. package/dist/types/lib/contractsIntegration/LexPoolV1Service/LexPoolV1Service.d.ts.map +1 -0
  116. package/dist/types/lib/contractsIntegration/LexPoolV1Service/index.d.ts +3 -0
  117. package/dist/types/lib/contractsIntegration/LexPoolV1Service/index.d.ts.map +1 -0
  118. package/dist/types/lib/contractsIntegration/PNLRService/IPNLRService.d.ts +49 -0
  119. package/dist/types/lib/contractsIntegration/PNLRService/IPNLRService.d.ts.map +1 -0
  120. package/dist/types/lib/contractsIntegration/PNLRService/PNLRService.d.ts +14 -0
  121. package/dist/types/lib/contractsIntegration/PNLRService/PNLRService.d.ts.map +1 -0
  122. package/dist/types/lib/contractsIntegration/PNLRService/index.d.ts +3 -0
  123. package/dist/types/lib/contractsIntegration/PNLRService/index.d.ts.map +1 -0
  124. package/dist/types/lib/contractsIntegration/PoolAccountantV1Service/IPoolAccountantV1Service.d.ts +160 -0
  125. package/dist/types/lib/contractsIntegration/PoolAccountantV1Service/IPoolAccountantV1Service.d.ts.map +1 -0
  126. package/dist/types/lib/contractsIntegration/PoolAccountantV1Service/PoolAccountantV1Service.d.ts +31 -0
  127. package/dist/types/lib/contractsIntegration/PoolAccountantV1Service/PoolAccountantV1Service.d.ts.map +1 -0
  128. package/dist/types/lib/contractsIntegration/PoolAccountantV1Service/index.d.ts +3 -0
  129. package/dist/types/lib/contractsIntegration/PoolAccountantV1Service/index.d.ts.map +1 -0
  130. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +2 -11
  131. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  132. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  133. package/dist/types/lib/typechain/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin.d.ts +143 -0
  134. package/dist/types/lib/typechain/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin.d.ts.map +1 -0
  135. package/dist/types/lib/typechain/contracts/Lynx/Lex/PNLR/PNLR.d.ts +266 -0
  136. package/dist/types/lib/typechain/contracts/Lynx/Lex/PNLR/PNLR.d.ts.map +1 -0
  137. package/dist/types/lib/typechain/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1.d.ts +2085 -0
  138. package/dist/types/lib/typechain/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1.d.ts.map +1 -0
  139. package/dist/types/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts +72 -0
  140. package/dist/types/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts.map +1 -0
  141. package/dist/types/lib/typechain/factories/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin__factory.d.ts +173 -0
  142. package/dist/types/lib/typechain/factories/contracts/AdministrationContracts/AcceptableImplementationClaimableAdmin__factory.d.ts.map +1 -0
  143. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts +439 -0
  144. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts.map +1 -0
  145. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +2899 -0
  146. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts.map +1 -0
  147. package/dist/types/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts +81 -0
  148. package/dist/types/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts.map +1 -0
  149. package/dist/types/lib/typechain/lynxSystem/intentsVerifiers/chipsIntentsVerifier/chipsIntentsVerifierPayloadTypes.d.ts +9 -0
  150. package/dist/types/lib/typechain/lynxSystem/intentsVerifiers/chipsIntentsVerifier/chipsIntentsVerifierPayloadTypes.d.ts.map +1 -0
  151. package/dist/types/lib/typechain/lynxSystem/intentsVerifiers/liquidityIntentsVerifier/liquidityIntentsVerifierPayloadTypes.d.ts +9 -0
  152. package/dist/types/lib/typechain/lynxSystem/intentsVerifiers/liquidityIntentsVerifier/liquidityIntentsVerifierPayloadTypes.d.ts.map +1 -0
  153. package/dist/types/lib/typechain/lynxSystem/intentsVerifiers/tradeIntentsVerifier/tradeIntentsVerifierPayloadTypes.d.ts +13 -0
  154. package/dist/types/lib/typechain/lynxSystem/intentsVerifiers/tradeIntentsVerifier/tradeIntentsVerifierPayloadTypes.d.ts.map +1 -0
  155. package/package.json +1 -1
@@ -0,0 +1,160 @@
1
+ import { BytesLike, ContractTransactionResponse } from "ethers";
2
+ export type TAccrueFundingValuesOutput = {
3
+ freshened: boolean;
4
+ valueLong: bigint;
5
+ valueShort: bigint;
6
+ protocolFundingShare: bigint;
7
+ };
8
+ export type TFundingIndicesCalculationOutput = {
9
+ indexLongChange: bigint;
10
+ indexShortChange: bigint;
11
+ protocolFundingShare: bigint;
12
+ };
13
+ export type TTradeClosingValuesOutput = {
14
+ tradeValue: bigint;
15
+ safeClosingFee: bigint;
16
+ profitPrecision: bigint;
17
+ interest: bigint;
18
+ funding: bigint;
19
+ };
20
+ export type TDynamicFeesOutput = {
21
+ interest: bigint;
22
+ funding: bigint;
23
+ };
24
+ export interface IPoolAccountantV1FunctionsGroup_TradeUtilities {
25
+ adjustClosePrice(closePrice: bigint, tp: bigint, long: boolean): Promise<bigint>;
26
+ generatePositionHashId(settlementAsset: string, trader: string, pairId: bigint, index: bigint): Promise<string>;
27
+ }
28
+ export interface IPoolAccountantV1FunctionsGroup_Verification {
29
+ verifyLeveragedPosition(pairIndex: bigint, collateral: bigint, leverage: bigint): Promise<bigint>;
30
+ verifyOpenFee(pairIndex: bigint, leveragedPosition: bigint): Promise<{
31
+ openFee: bigint;
32
+ lexPartFee: bigint;
33
+ }>;
34
+ verifyPerformanceFee(pairIndex: bigint, collateral: bigint): Promise<void>;
35
+ verifyMaxPercentProfit(openPrice: bigint, targetPrice: bigint, leverage: bigint, long: boolean): Promise<void>;
36
+ verifyUtilizationForTraders(totalBorrows: bigint, totalReserves: bigint, unrealizedFunding: bigint): Promise<void>;
37
+ }
38
+ export interface IPoolAccountantV1FunctionsGroup_FeeCalculations {
39
+ calcClosingFee(pairId: bigint, collateral: bigint, leverage: bigint): Promise<bigint>;
40
+ calcPerformanceFee(pairId: bigint, collateral: bigint, profitPrecision: bigint): Promise<bigint>;
41
+ calcBorrowAmount(collateral: bigint, leverage: bigint, long: boolean, openPrice: bigint, tp: bigint): Promise<bigint>;
42
+ calcTradeDynamicFees(positionId: BytesLike, pairId: bigint, long: boolean, collateral: bigint, leverage: bigint, openPrice: bigint, tp: bigint): Promise<TDynamicFeesOutput>;
43
+ }
44
+ export interface IPoolAccountantV1FunctionsGroup_Funding {
45
+ accrueFunding(pairId: bigint): Promise<{
46
+ valueLong: bigint;
47
+ valueShort: bigint;
48
+ protocolFundingShare: bigint;
49
+ }>;
50
+ calcAccrueFundingValues(pairId: bigint): Promise<TAccrueFundingValuesOutput>;
51
+ fundingIndicesCalculation(oiLong: bigint, oiShort: bigint, fundingRate: bigint, timeDiff: bigint): Promise<TFundingIndicesCalculationOutput>;
52
+ getTradeFunding(positionId: BytesLike, pairId: bigint, long: boolean, collateral: bigint, leverage: bigint): Promise<bigint>;
53
+ getTradeFundingPure(accFundingPerOi: bigint, endAccFundingPerOi: bigint, collateral: bigint, leverage: bigint): Promise<bigint>;
54
+ getAccFundingLong(pairIndex: bigint): Promise<bigint>;
55
+ getAccFundingShort(pairIndex: bigint): Promise<bigint>;
56
+ getAccFundingUpdateBlock(pairIndex: bigint): Promise<bigint>;
57
+ getTradeInitialAccFundingPerOi(positionId: BytesLike): Promise<bigint>;
58
+ }
59
+ export interface IPoolAccountantV1FunctionsGroup_Interest {
60
+ getTradeInterest(positionId: BytesLike, borrowAmount: bigint): Promise<bigint>;
61
+ getTradeInterestPure(tradeBorrowIndex: bigint, currentBorrowIndex: bigint, borrowAmount: bigint, alreadyAccumulated: bigint): Promise<bigint>;
62
+ getTradeInitialAccBorrowIndex(positionId: BytesLike): Promise<bigint>;
63
+ accrueInterest(availableCash: bigint): Promise<{
64
+ totalInterestNew: bigint;
65
+ interestShareNew: bigint;
66
+ borrowIndexNew: bigint;
67
+ }>;
68
+ }
69
+ export interface IPoolAccountantV1FunctionsGroup_Liquidation {
70
+ getTradeLiquidationPrice(positionId: BytesLike, pairId: bigint, openPrice: bigint, tp: bigint, long: boolean, collateral: bigint, leverage: bigint): Promise<bigint>;
71
+ getTradeLiquidationPriceView(openPrice: bigint, long: boolean, collateral: bigint, leverage: bigint, interest: bigint, funding: bigint, closingFee: bigint): Promise<bigint>;
72
+ }
73
+ export interface IPoolAccountantV1FunctionsGroup_TradeValues {
74
+ getTradeValueView(collateral: bigint, profitPrecision: bigint, interest: bigint, funding: bigint, closingFee: bigint, liquidation: boolean): Promise<bigint>;
75
+ getTradeClosingValues(positionId: BytesLike, pairId: bigint, collateral: bigint, leverage: bigint, long: boolean, openPrice: bigint, tp: bigint, closePrice: bigint, isLiquidation: boolean): Promise<TTradeClosingValuesOutput>;
76
+ }
77
+ export interface IPoolAccountantV1FunctionsGroup_PairManagement {
78
+ pairTotalOpenInterest(pairIndex: bigint): Promise<bigint>;
79
+ calcAbsoluteSkew(openInterestLong: bigint, openInterestShort: bigint, additionIsLong: boolean, additionOpenInterest: bigint): Promise<bigint>;
80
+ pricePnL(pairId: bigint, price: bigint): Promise<bigint>;
81
+ }
82
+ export interface IPoolAccountantV1FunctionsGroup_AdminConfiguration {
83
+ setTradeIncentivizer(incentivizer: string): Promise<ContractTransactionResponse>;
84
+ setMaxGainF(maxGainF: bigint): Promise<ContractTransactionResponse>;
85
+ setFrm(frm: string): Promise<ContractTransactionResponse>;
86
+ setMinOpenFee(min: bigint): Promise<ContractTransactionResponse>;
87
+ setLexPartF(partF: bigint): Promise<ContractTransactionResponse>;
88
+ setFundingRateMax(maxValue: bigint): Promise<ContractTransactionResponse>;
89
+ setLiquidationThresholdF(threshold: bigint): Promise<ContractTransactionResponse>;
90
+ setLiquidationFeeF(fee: bigint): Promise<ContractTransactionResponse>;
91
+ setIrm(irm: string): Promise<ContractTransactionResponse>;
92
+ setIrmHard(irm: string): Promise<ContractTransactionResponse>;
93
+ setInterestShareFactor(factor: bigint): Promise<ContractTransactionResponse>;
94
+ setFundingShareFactor(factor: bigint): Promise<ContractTransactionResponse>;
95
+ setBorrowRateMax(rate: bigint): Promise<ContractTransactionResponse>;
96
+ setMaxTotalBorrows(maxBorrows: bigint): Promise<ContractTransactionResponse>;
97
+ setMaxVirtualUtilization(maxUtilization: bigint): Promise<ContractTransactionResponse>;
98
+ }
99
+ export interface IPoolAccountantV1FunctionsGroup_PoolInteraction {
100
+ readAndZeroReserves(): Promise<{
101
+ accumulatedInterestShare: bigint;
102
+ accFundingShare: bigint;
103
+ }>;
104
+ }
105
+ export interface IPoolAccountantV1FunctionsGroup_StateVariables {
106
+ borrowIndex(): Promise<bigint>;
107
+ borrowRateMax(): Promise<bigint>;
108
+ totalBorrows(): Promise<bigint>;
109
+ totalInterest(): Promise<bigint>;
110
+ interestShare(): Promise<bigint>;
111
+ interestShareFactor(): Promise<bigint>;
112
+ fundingRateMax(): Promise<bigint>;
113
+ fundingShare(): Promise<bigint>;
114
+ fundingShareFactor(): Promise<bigint>;
115
+ unrealizedFunding(): Promise<bigint>;
116
+ realizedFundingSurplusDeficit(): Promise<bigint>;
117
+ maxGainF(): Promise<bigint>;
118
+ liquidationFeeF(): Promise<bigint>;
119
+ liquidationThresholdF(): Promise<bigint>;
120
+ maxTotalBorrows(): Promise<bigint>;
121
+ maxVirtualUtilization(): Promise<bigint>;
122
+ minOpenFee(): Promise<bigint>;
123
+ lexPartF(): Promise<bigint>;
124
+ lexPool(): Promise<string>;
125
+ tradingFloor(): Promise<string>;
126
+ tradeIncentivizer(): Promise<string>;
127
+ frm(): Promise<string>;
128
+ irm(): Promise<string>;
129
+ underlying(): Promise<string>;
130
+ accrualBlockTimestamp(): Promise<bigint>;
131
+ }
132
+ export interface IPoolAccountantV1FunctionsGroup_ContractInfo {
133
+ admin(): Promise<string>;
134
+ pendingAdmin(): Promise<string>;
135
+ implementation(): Promise<string>;
136
+ pendingImplementation(): Promise<string>;
137
+ registry(): Promise<string>;
138
+ }
139
+ export interface IPoolAccountantV1FunctionsGroup_Constants {
140
+ ACCURACY_IMPROVEMENT_SCALE(): Promise<bigint>;
141
+ FRACTION_SCALE(): Promise<bigint>;
142
+ LEVERAGE_SCALE(): Promise<bigint>;
143
+ PRECISION(): Promise<bigint>;
144
+ }
145
+ export interface IPoolAccountantV1Service {
146
+ tradeUtilities: IPoolAccountantV1FunctionsGroup_TradeUtilities;
147
+ verification: IPoolAccountantV1FunctionsGroup_Verification;
148
+ feeCalculations: IPoolAccountantV1FunctionsGroup_FeeCalculations;
149
+ funding: IPoolAccountantV1FunctionsGroup_Funding;
150
+ interest: IPoolAccountantV1FunctionsGroup_Interest;
151
+ liquidation: IPoolAccountantV1FunctionsGroup_Liquidation;
152
+ tradeValues: IPoolAccountantV1FunctionsGroup_TradeValues;
153
+ pairManagement: IPoolAccountantV1FunctionsGroup_PairManagement;
154
+ adminConfiguration: IPoolAccountantV1FunctionsGroup_AdminConfiguration;
155
+ poolInteraction: IPoolAccountantV1FunctionsGroup_PoolInteraction;
156
+ stateVariables: IPoolAccountantV1FunctionsGroup_StateVariables;
157
+ contractInfo: IPoolAccountantV1FunctionsGroup_ContractInfo;
158
+ constants: IPoolAccountantV1FunctionsGroup_Constants;
159
+ }
160
+ //# sourceMappingURL=IPoolAccountantV1Service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPoolAccountantV1Service.d.ts","source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CAAA;IACxD,WAAW,EAAE,2CAA2C,CAAA;IACxD,cAAc,EAAE,8CAA8C,CAAA;IAC9D,kBAAkB,EAAE,kDAAkD,CAAA;IACtE,eAAe,EAAE,+CAA+C,CAAA;IAChE,cAAc,EAAE,8CAA8C,CAAA;IAC9D,YAAY,EAAE,4CAA4C,CAAA;IAC1D,SAAS,EAAE,yCAAyC,CAAA;CACrD"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import { Signer, Provider } from "ethers";
2
+ import { IPoolAccountantV1Service, IPoolAccountantV1FunctionsGroup_TradeUtilities, IPoolAccountantV1FunctionsGroup_Verification, IPoolAccountantV1FunctionsGroup_FeeCalculations, IPoolAccountantV1FunctionsGroup_Funding, IPoolAccountantV1FunctionsGroup_Interest, IPoolAccountantV1FunctionsGroup_Liquidation, IPoolAccountantV1FunctionsGroup_TradeValues, IPoolAccountantV1FunctionsGroup_PairManagement, IPoolAccountantV1FunctionsGroup_AdminConfiguration, IPoolAccountantV1FunctionsGroup_PoolInteraction, IPoolAccountantV1FunctionsGroup_StateVariables, IPoolAccountantV1FunctionsGroup_ContractInfo, IPoolAccountantV1FunctionsGroup_Constants } from "./IPoolAccountantV1Service";
3
+ export declare class PoolAccountantV1Service implements IPoolAccountantV1Service {
4
+ private poolAccountantContract;
5
+ tradeUtilities: IPoolAccountantV1FunctionsGroup_TradeUtilities;
6
+ verification: IPoolAccountantV1FunctionsGroup_Verification;
7
+ feeCalculations: IPoolAccountantV1FunctionsGroup_FeeCalculations;
8
+ funding: IPoolAccountantV1FunctionsGroup_Funding;
9
+ interest: IPoolAccountantV1FunctionsGroup_Interest;
10
+ liquidation: IPoolAccountantV1FunctionsGroup_Liquidation;
11
+ tradeValues: IPoolAccountantV1FunctionsGroup_TradeValues;
12
+ pairManagement: IPoolAccountantV1FunctionsGroup_PairManagement;
13
+ adminConfiguration: IPoolAccountantV1FunctionsGroup_AdminConfiguration;
14
+ poolInteraction: IPoolAccountantV1FunctionsGroup_PoolInteraction;
15
+ stateVariables: IPoolAccountantV1FunctionsGroup_StateVariables;
16
+ contractInfo: IPoolAccountantV1FunctionsGroup_ContractInfo;
17
+ constants: IPoolAccountantV1FunctionsGroup_Constants;
18
+ constructor(signerOrProvider: Signer | Provider, address: string);
19
+ private createVerificationGroup;
20
+ private createFundingGroup;
21
+ private createInterestGroup;
22
+ private createLiquidationGroup;
23
+ private createTradeValuesGroup;
24
+ private createPairManagementGroup;
25
+ private createAdminConfigurationGroup;
26
+ private createPoolInteractionGroup;
27
+ private createStateVariablesGroup;
28
+ private createContractInfoGroup;
29
+ private createConstantsGroup;
30
+ }
31
+ //# sourceMappingURL=PoolAccountantV1Service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoolAccountantV1Service.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/PoolAccountantV1Service/PoolAccountantV1Service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAGrD,OAAO,EACL,wBAAwB,EACxB,8CAA8C,EAC9C,4CAA4C,EAC5C,+CAA+C,EAC/C,uCAAuC,EACvC,wCAAwC,EACxC,2CAA2C,EAC3C,2CAA2C,EAC3C,8CAA8C,EAC9C,kDAAkD,EAClD,+CAA+C,EAC/C,8CAA8C,EAC9C,4CAA4C,EAC5C,yCAAyC,EAE1C,MAAM,4BAA4B,CAAC;AA+HpC,qBAAa,uBAAwB,YAAW,wBAAwB;IACtE,OAAO,CAAC,sBAAsB,CAAmB;IAE1C,cAAc,EAAE,8CAA8C,CAAC;IAC/D,YAAY,EAAE,4CAA4C,CAAC;IAC3D,eAAe,EAAE,+CAA+C,CAAC;IACjE,OAAO,EAAE,uCAAuC,CAAC;IACjD,QAAQ,EAAE,wCAAwC,CAAC;IACnD,WAAW,EAAE,2CAA2C,CAAC;IACzD,WAAW,EAAE,2CAA2C,CAAC;IACzD,cAAc,EAAE,8CAA8C,CAAC;IAC/D,kBAAkB,EAAE,kDAAkD,CAAC;IACvE,eAAe,EAAE,+CAA+C,CAAC;IACjE,cAAc,EAAE,8CAA8C,CAAC;IAC/D,YAAY,EAAE,4CAA4C,CAAC;IAC3D,SAAS,EAAE,yCAAyC,CAAC;gBAEhD,gBAAgB,EAAE,MAAM,GAAG,QAAQ,EAAE,OAAO,EAAE,MAAM;IA2BhE,OAAO,CAAC,uBAAuB;IA2C/B,OAAO,CAAC,kBAAkB;IA2D1B,OAAO,CAAC,mBAAmB;IAiC3B,OAAO,CAAC,sBAAsB;IAyC9B,OAAO,CAAC,sBAAsB;IAuD9B,OAAO,CAAC,yBAAyB;IAqBjC,OAAO,CAAC,6BAA6B;IA8BrC,OAAO,CAAC,0BAA0B;IAalC,OAAO,CAAC,yBAAyB;IA2CjC,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,oBAAoB;CAS7B"}
@@ -0,0 +1,254 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PoolAccountantV1Service = void 0;
4
+ const PoolAccountantV1__factory_1 = require("../../typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory");
5
+ // Note: registerOpenTrade, registerCloseTrade, and registerUpdateTp are internal protocol functions
6
+ // called only by other Lynx contracts and are not exposed for external use
7
+ class PoolAccountantV1FunctionsGroup_TradeUtilities {
8
+ constructor(contract) {
9
+ this.contract = contract;
10
+ }
11
+ async adjustClosePrice(closePrice, tp, long) {
12
+ return this.contract.adjustClosePrice(closePrice, tp, long);
13
+ }
14
+ async generatePositionHashId(settlementAsset, trader, pairId, index) {
15
+ return this.contract.generatePositionHashId(settlementAsset, trader, pairId, index);
16
+ }
17
+ }
18
+ class PoolAccountantV1FunctionsGroup_FeeCalculations {
19
+ constructor(contract) {
20
+ this.contract = contract;
21
+ }
22
+ async calcClosingFee(pairId, collateral, leverage) {
23
+ return this.contract.calcClosingFee(pairId, collateral, leverage);
24
+ }
25
+ async calcPerformanceFee(pairId, collateral, profitPrecision) {
26
+ return this.contract.calcPerformanceFee(pairId, collateral, profitPrecision);
27
+ }
28
+ async calcTradeDynamicFees(positionId, pairId, long, collateral, leverage, openPrice, tp) {
29
+ const result = await this.contract.calcTradeDynamicFees.staticCall(positionId, pairId, long, collateral, leverage, openPrice, tp);
30
+ return {
31
+ interest: result.interest,
32
+ funding: result.funding,
33
+ };
34
+ }
35
+ async calcBorrowAmount(collateral, leverage, long, openPrice, tp) {
36
+ return this.contract.calcBorrowAmount(collateral, leverage, long, openPrice, tp);
37
+ }
38
+ async calcAbsoluteSkew(openInterestLong, openInterestShort, additionIsLong, additionOpenInterest) {
39
+ return this.contract.calcAbsoluteSkew(openInterestLong, openInterestShort, additionIsLong, additionOpenInterest);
40
+ }
41
+ async calcAccrueFundingValues(pairId) {
42
+ const result = await this.contract.calcAccrueFundingValues(pairId);
43
+ return {
44
+ freshened: result.freshened,
45
+ valueLong: result.valueLong,
46
+ valueShort: result.valueShort,
47
+ protocolFundingShare: result.protocolFundingShare,
48
+ };
49
+ }
50
+ }
51
+ // Similarly implement other groups...
52
+ // For brevity, I'll create a simplified version with the main structure
53
+ class PoolAccountantV1Service {
54
+ constructor(signerOrProvider, address) {
55
+ this.poolAccountantContract = PoolAccountantV1__factory_1.PoolAccountantV1__factory.connect(address, signerOrProvider);
56
+ this.tradeUtilities = new PoolAccountantV1FunctionsGroup_TradeUtilities(this.poolAccountantContract);
57
+ this.feeCalculations = new PoolAccountantV1FunctionsGroup_FeeCalculations(this.poolAccountantContract);
58
+ this.verification = this.createVerificationGroup();
59
+ // Initialize other groups with direct method mappings
60
+ this.funding = this.createFundingGroup();
61
+ this.interest = this.createInterestGroup();
62
+ this.liquidation = this.createLiquidationGroup();
63
+ this.tradeValues = this.createTradeValuesGroup();
64
+ this.pairManagement = this.createPairManagementGroup();
65
+ this.adminConfiguration = this.createAdminConfigurationGroup();
66
+ this.poolInteraction = this.createPoolInteractionGroup();
67
+ this.stateVariables = this.createStateVariablesGroup();
68
+ this.contractInfo = this.createContractInfoGroup();
69
+ this.constants = this.createConstantsGroup();
70
+ }
71
+ createVerificationGroup() {
72
+ return {
73
+ verifyLeveragedPosition: async (pairIndex, collateral, leverage) => {
74
+ const result = await this.poolAccountantContract.verifyLeveragedPosition(pairIndex, collateral, leverage);
75
+ return result;
76
+ },
77
+ verifyOpenFee: async (pairIndex, leveragedPosition) => {
78
+ const result = await this.poolAccountantContract.verifyOpenFee(pairIndex, leveragedPosition);
79
+ return {
80
+ openFee: result[0],
81
+ lexPartFee: result[1],
82
+ };
83
+ },
84
+ verifyPerformanceFee: (pairIndex, collateral) => this.poolAccountantContract.verifyPerformanceFee(pairIndex, collateral),
85
+ verifyMaxPercentProfit: (openPrice, targetPrice, leverage, long) => this.poolAccountantContract.verifyMaxPercentProfit(openPrice, targetPrice, leverage, long),
86
+ verifyUtilizationForTraders: (totalBorrows, totalReserves, unrealizedFunding) => this.poolAccountantContract.verifyUtilizationForTraders(totalBorrows, totalReserves, unrealizedFunding),
87
+ };
88
+ }
89
+ createFundingGroup() {
90
+ return {
91
+ accrueFunding: async (pairId) => {
92
+ const result = await this.poolAccountantContract.accrueFunding.staticCall(pairId);
93
+ return {
94
+ valueLong: result[0],
95
+ valueShort: result[1],
96
+ protocolFundingShare: result[2],
97
+ };
98
+ },
99
+ calcAccrueFundingValues: (pairId) => this.poolAccountantContract
100
+ .calcAccrueFundingValues(pairId)
101
+ .then((r) => ({
102
+ freshened: r.freshened,
103
+ valueLong: r.valueLong,
104
+ valueShort: r.valueShort,
105
+ protocolFundingShare: r.protocolFundingShare,
106
+ })),
107
+ fundingIndicesCalculation: (oiLong, oiShort, fundingRate, timeDiff) => this.poolAccountantContract
108
+ .fundingIndicesCalculation(oiLong, oiShort, fundingRate, timeDiff)
109
+ .then((r) => ({
110
+ indexLongChange: r.indexLongChange,
111
+ indexShortChange: r.indexShortChange,
112
+ protocolFundingShare: r.protocolFundingShare,
113
+ })),
114
+ getTradeFunding: (positionId, pairId, long, collateral, leverage) => this.poolAccountantContract.getTradeFunding.staticCall(positionId, pairId, long, collateral, leverage),
115
+ getTradeFundingPure: (accFundingPerOi, endAccFundingPerOi, collateral, leverage) => this.poolAccountantContract.getTradeFundingPure(accFundingPerOi, endAccFundingPerOi, collateral, leverage),
116
+ getTradeInitialAccFundingPerOi: (positionId) => this.poolAccountantContract.getTradeInitialAccFundingPerOi(positionId),
117
+ getAccFundingLong: (pairIndex) => this.poolAccountantContract.getAccFundingLong(pairIndex),
118
+ getAccFundingShort: (pairIndex) => this.poolAccountantContract.getAccFundingShort(pairIndex),
119
+ getAccFundingUpdateBlock: (pairIndex) => this.poolAccountantContract.getAccFundingUpdateBlock(pairIndex),
120
+ };
121
+ }
122
+ createInterestGroup() {
123
+ return {
124
+ getTradeInterest: (positionId, borrowAmount) => this.poolAccountantContract.getTradeInterest.staticCall(positionId, borrowAmount),
125
+ getTradeInterestPure: (tradeAccInterest, borrowsAndInterestShare, borrowIndex, accBorrowIndex) => this.poolAccountantContract.getTradeInterestPure(tradeAccInterest, borrowsAndInterestShare, borrowIndex, accBorrowIndex),
126
+ getTradeInitialAccBorrowIndex: (positionId) => this.poolAccountantContract.getTradeInitialAccBorrowIndex(positionId),
127
+ accrueInterest: async (availableCash) => {
128
+ const result = await this.poolAccountantContract["accrueInterest(uint256)"].staticCall(availableCash);
129
+ return {
130
+ totalInterestNew: result[0],
131
+ interestShareNew: result[1],
132
+ borrowIndexNew: result[2],
133
+ };
134
+ },
135
+ };
136
+ }
137
+ createLiquidationGroup() {
138
+ return {
139
+ getTradeLiquidationPrice: (positionId, pairId, openPrice, tp, long, collateral, leverage) => this.poolAccountantContract.getTradeLiquidationPrice.staticCall(positionId, pairId, openPrice, tp, long, collateral, leverage),
140
+ getTradeLiquidationPriceView: (openPrice, long, collateral, leverage, interest, funding, closingFee) => this.poolAccountantContract.getTradeLiquidationPriceView(openPrice, long, collateral, leverage, interest, funding, closingFee),
141
+ };
142
+ }
143
+ createTradeValuesGroup() {
144
+ return {
145
+ getTradeValueView: (collateral, profitPrecision, interest, funding, closingFee, liquidation) => this.poolAccountantContract.getTradeValueView(collateral, profitPrecision, interest, funding, closingFee, liquidation),
146
+ getTradeClosingValues: async (positionId, pairId, collateral, leverage, long, openPrice, tp, closePrice, isLiquidation) => {
147
+ const params = {
148
+ collateral,
149
+ leverage,
150
+ long,
151
+ openPrice,
152
+ tp,
153
+ };
154
+ const result = await this.poolAccountantContract.getTradeClosingValues.staticCall(positionId, pairId, params, closePrice, isLiquidation);
155
+ return {
156
+ tradeValue: result[0],
157
+ safeClosingFee: result[1],
158
+ profitPrecision: result[2],
159
+ interest: result[3],
160
+ funding: result[4],
161
+ };
162
+ },
163
+ };
164
+ }
165
+ createPairManagementGroup() {
166
+ return {
167
+ pairTotalOpenInterest: (pairIndex) => this.poolAccountantContract.pairTotalOpenInterest(pairIndex),
168
+ calcAbsoluteSkew: (openInterestLong, openInterestShort, additionIsLong, additionOpenInterest) => this.poolAccountantContract.calcAbsoluteSkew(openInterestLong, openInterestShort, additionIsLong, additionOpenInterest),
169
+ pricePnL: (pairId, price) => this.poolAccountantContract.pricePnL(pairId, price),
170
+ };
171
+ }
172
+ createAdminConfigurationGroup() {
173
+ return {
174
+ setTradeIncentivizer: (incentivizer) => this.poolAccountantContract.setTradeIncentivizer(incentivizer),
175
+ setMaxGainF: (maxGainF) => this.poolAccountantContract.setMaxGainF(maxGainF),
176
+ setFrm: (frm) => this.poolAccountantContract.setFrm(frm),
177
+ setMinOpenFee: (min) => this.poolAccountantContract.setMinOpenFee(min),
178
+ setLexPartF: (partF) => this.poolAccountantContract.setLexPartF(partF),
179
+ setFundingRateMax: (maxValue) => this.poolAccountantContract.setFundingRateMax(maxValue),
180
+ setLiquidationThresholdF: (threshold) => this.poolAccountantContract.setLiquidationThresholdF(threshold),
181
+ setLiquidationFeeF: (fee) => this.poolAccountantContract.setLiquidationFeeF(fee),
182
+ setIrm: (irm) => this.poolAccountantContract.setIrm(irm),
183
+ setIrmHard: (irm) => this.poolAccountantContract.setIrmHard(irm),
184
+ setInterestShareFactor: (factor) => this.poolAccountantContract.setInterestShareFactor(factor),
185
+ setFundingShareFactor: (factor) => this.poolAccountantContract.setFundingShareFactor(factor),
186
+ setBorrowRateMax: (rate) => this.poolAccountantContract.setBorrowRateMax(rate),
187
+ setMaxTotalBorrows: (maxBorrows) => this.poolAccountantContract.setMaxTotalBorrows(maxBorrows),
188
+ setMaxVirtualUtilization: (maxUtilization) => this.poolAccountantContract.setMaxVirtualUtilization(maxUtilization),
189
+ };
190
+ }
191
+ createPoolInteractionGroup() {
192
+ return {
193
+ readAndZeroReserves: async () => {
194
+ const result = await this.poolAccountantContract.readAndZeroReserves.staticCall();
195
+ return {
196
+ accumulatedInterestShare: result[0],
197
+ accFundingShare: result[1],
198
+ };
199
+ },
200
+ };
201
+ }
202
+ createStateVariablesGroup() {
203
+ return {
204
+ // Interest and borrowing state
205
+ borrowIndex: () => this.poolAccountantContract.borrowIndex(),
206
+ borrowRateMax: () => this.poolAccountantContract.borrowRateMax(),
207
+ totalBorrows: () => this.poolAccountantContract.totalBorrows(),
208
+ totalInterest: () => this.poolAccountantContract.totalInterest(),
209
+ interestShare: () => this.poolAccountantContract.interestShare(),
210
+ interestShareFactor: () => this.poolAccountantContract.interestShareFactor(),
211
+ // Funding state
212
+ fundingRateMax: () => this.poolAccountantContract.fundingRateMax(),
213
+ fundingShare: () => this.poolAccountantContract.fundingShare(),
214
+ fundingShareFactor: () => this.poolAccountantContract.fundingShareFactor(),
215
+ unrealizedFunding: () => this.poolAccountantContract.unrealizedFunding(),
216
+ realizedFundingSurplusDeficit: () => this.poolAccountantContract.realizedFundingSurplusDeficit(),
217
+ // Configuration
218
+ maxGainF: () => this.poolAccountantContract.maxGainF(),
219
+ liquidationFeeF: () => this.poolAccountantContract.liquidationFeeF(),
220
+ liquidationThresholdF: () => this.poolAccountantContract.liquidationThresholdF(),
221
+ maxTotalBorrows: () => this.poolAccountantContract.maxTotalBorrows(),
222
+ maxVirtualUtilization: () => this.poolAccountantContract.maxVirtualUtilization(),
223
+ minOpenFee: () => this.poolAccountantContract.minOpenFee(),
224
+ lexPartF: () => this.poolAccountantContract.lexPartF(),
225
+ // Contract references
226
+ lexPool: () => this.poolAccountantContract.lexPool(),
227
+ tradingFloor: () => this.poolAccountantContract.tradingFloor(),
228
+ tradeIncentivizer: () => this.poolAccountantContract.tradeIncentivizer(),
229
+ frm: () => this.poolAccountantContract.frm(),
230
+ irm: () => this.poolAccountantContract.irm(),
231
+ underlying: () => this.poolAccountantContract.underlying(),
232
+ // Timestamps
233
+ accrualBlockTimestamp: () => this.poolAccountantContract.accrualBlockTimestamp(),
234
+ };
235
+ }
236
+ createContractInfoGroup() {
237
+ return {
238
+ admin: () => this.poolAccountantContract.admin(),
239
+ pendingAdmin: () => this.poolAccountantContract.pendingAdmin(),
240
+ implementation: () => this.poolAccountantContract.implementation(),
241
+ pendingImplementation: () => this.poolAccountantContract.pendingImplementation(),
242
+ registry: () => this.poolAccountantContract.registry(),
243
+ };
244
+ }
245
+ createConstantsGroup() {
246
+ return {
247
+ ACCURACY_IMPROVEMENT_SCALE: () => this.poolAccountantContract.ACCURACY_IMPROVEMENT_SCALE(),
248
+ FRACTION_SCALE: () => this.poolAccountantContract.FRACTION_SCALE(),
249
+ LEVERAGE_SCALE: () => this.poolAccountantContract.LEVERAGE_SCALE(),
250
+ PRECISION: () => this.poolAccountantContract.PRECISION(),
251
+ };
252
+ }
253
+ }
254
+ exports.PoolAccountantV1Service = PoolAccountantV1Service;
@@ -0,0 +1,3 @@
1
+ export type { IPoolAccountantV1Service, IPoolAccountantV1FunctionsGroup_TradeUtilities, IPoolAccountantV1FunctionsGroup_Verification, IPoolAccountantV1FunctionsGroup_FeeCalculations, IPoolAccountantV1FunctionsGroup_Funding, IPoolAccountantV1FunctionsGroup_Interest, IPoolAccountantV1FunctionsGroup_Liquidation, IPoolAccountantV1FunctionsGroup_TradeValues, IPoolAccountantV1FunctionsGroup_PairManagement, IPoolAccountantV1FunctionsGroup_AdminConfiguration, IPoolAccountantV1FunctionsGroup_PoolInteraction, IPoolAccountantV1FunctionsGroup_StateVariables, IPoolAccountantV1FunctionsGroup_ContractInfo, IPoolAccountantV1FunctionsGroup_Constants, TAccrueFundingValuesOutput, TFundingIndicesCalculationOutput, TTradeClosingValuesOutput, TDynamicFeesOutput } from "./IPoolAccountantV1Service";
2
+ export { PoolAccountantV1Service } from "./PoolAccountantV1Service";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/PoolAccountantV1Service/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,8CAA8C,EAC9C,4CAA4C,EAC5C,+CAA+C,EAC/C,uCAAuC,EACvC,wCAAwC,EACxC,2CAA2C,EAC3C,2CAA2C,EAC3C,8CAA8C,EAC9C,kDAAkD,EAClD,+CAA+C,EAC/C,8CAA8C,EAC9C,4CAA4C,EAC5C,yCAAyC,EACzC,0BAA0B,EAC1B,gCAAgC,EAChC,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PoolAccountantV1Service = void 0;
4
+ var PoolAccountantV1Service_1 = require("./PoolAccountantV1Service");
5
+ Object.defineProperty(exports, "PoolAccountantV1Service", { enumerable: true, get: function () { return PoolAccountantV1Service_1.PoolAccountantV1Service; } });
@@ -1,32 +1,23 @@
1
1
  import { BytesLike } from "ethers";
2
2
  import { TradingFloorLensStructs } from "../../typechain/contracts/Peripheral/Lens/TradingFloorLens";
3
3
  import { TSafeBigNumberStruct } from "../../utils/ethersTypes";
4
- export type TCompletePositionDataFromLensStruct = Omit<TSafeBigNumberStruct<TradingFloorLensStructs.CompletePositionDataFromLensStruct>, "pairId" | "positionIndex" | "phase" | "inPhaseSince" | "leverage" | "openPrice" | "spreadReductionF" | "minPrice" | "maxPrice" | "tpLastUpdated" | "slLastUpdated" | "tp" | "sl" | "pendingUpdateOrderType" | "pendingUpdateOrderTimestamp" | "liquidationPrice"> & {
4
+ export type TCompletePositionDataFromLensStruct = Omit<TSafeBigNumberStruct<TradingFloorLensStructs.CompletePositionDataFromLensStruct>, "pairId" | "positionIndex" | "phase" | "inPhaseSince" | "tpLastUpdated" | "slLastUpdated" | "pendingUpdateOrderType" | "pendingUpdateOrderTimestamp"> & {
5
5
  pairId: number;
6
6
  positionIndex: number;
7
7
  phase: number;
8
8
  inPhaseSince: number;
9
- leverage: number;
10
- openPrice: number;
11
- spreadReductionF: number;
12
- minPrice: number;
13
- maxPrice: number;
14
9
  tpLastUpdated: number;
15
10
  slLastUpdated: number;
16
- tp: number;
17
- sl: number;
18
11
  pendingUpdateOrderType: number;
19
12
  pendingUpdateOrderTimestamp: number;
20
- liquidationPrice: number;
21
13
  };
22
14
  export type TGetAllPositionsDataForAllTradersResultStruct = Omit<TSafeBigNumberStruct<TradingFloorLensStructs.GetAllPositionsDataForAllTradersResultStruct>, "positions" | "positionsCount" | "traderLastIndex"> & {
23
15
  positions: TCompletePositionDataFromLensStruct[];
24
16
  positionsCount: number;
25
17
  traderLastIndex: number;
26
18
  };
27
- export type TPositionLiquidationInfoStruct = Omit<TSafeBigNumberStruct<TradingFloorLensStructs.PositionLiquidationInfoStruct>, "phase" | "liquidationPrice"> & {
19
+ export type TPositionLiquidationInfoStruct = Omit<TSafeBigNumberStruct<TradingFloorLensStructs.PositionLiquidationInfoStruct>, "phase"> & {
28
20
  phase: number;
29
- liquidationPrice: number;
30
21
  };
31
22
  export type TGetAllPositionsLiquidationInfoResultStruct = Omit<TSafeBigNumberStruct<TradingFloorLensStructs.GetAllPositionsLiquidationInfoResultStruct>, "positionsLiquidationInfo" | "positionsCount" | "traderLastIndex" | "positionLastIndex"> & {
32
23
  positionsLiquidationInfo: TPositionLiquidationInfoStruct[];
@@ -1 +1 @@
1
- {"version":3,"file":"ITradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,MAAM,MAAM,mCAAmC,GAAG,IAAI,CACpD,oBAAoB,CAAC,uBAAuB,CAAC,kCAAkC,CAAC,EAC9E,QAAQ,GACR,eAAe,GACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,WAAW,GACX,kBAAkB,GAClB,UAAU,GACV,UAAU,GACV,eAAe,GACf,eAAe,GACf,IAAI,GACJ,IAAI,GACJ,wBAAwB,GACxB,6BAA6B,GAC7B,kBAAkB,CACrB,GAAG;IACF,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2BAA2B,EAAE,MAAM,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,6CAA6C,GAAG,IAAI,CAC9D,oBAAoB,CAAC,uBAAuB,CAA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,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAGF,eAAO,MAAM,4BAA4B,EAAE,mCA2BxC,CAAC;AAEJ,eAAO,MAAM,sBAAsB,EAAE,6CAMlC,CAAC;AAEJ,eAAO,MAAM,+BAA+B,EAAE,8BAM7C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,2CAOpC,CAAC;AAEJ,eAAO,MAAM,kBAAkB,EAAE,kCAKhC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,sBAAsB,CACpB,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,gCAAgC,CAC9B,MAAM,EAAE,6CAA6C,GACpD,OAAO,CAAC,6CAA6C,CAAC,CAAC;IAE1D,8BAA8B,CAC5B,MAAM,EAAE,2CAA2C,EACnD,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAExD,uBAAuB,CACrB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAEhD,yBAAyB,CACvB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,mCAAmC,EAAE,CAAC,CAAC;IAElD,0BAA0B,CACxB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kCAAkC,CAAC,CAAC;CAChD"}
1
+ {"version":3,"file":"ITradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,EAAE,oBAAoB,EA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AE,MAAM,EACpB,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAEhD,yBAAyB,CACvB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,mCAAmC,EAAE,CAAC,CAAC;IAElD,0BAA0B,CACxB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kCAAkC,CAAC,CAAC;CAChD"}
@@ -11,23 +11,23 @@ exports.EMPTY_COMPLETE_POSITION_DATA = {
11
11
  collateral: 0n,
12
12
  phase: 0,
13
13
  inPhaseSince: 0,
14
- leverage: 0,
14
+ leverage: 0n,
15
15
  long: false,
16
- openPrice: 0,
17
- spreadReductionF: 0,
18
- minPrice: 0,
19
- maxPrice: 0,
16
+ openPrice: 0n,
17
+ spreadReductionF: 0n,
18
+ minPrice: 0n,
19
+ maxPrice: 0n,
20
20
  tpLastUpdated: 0,
21
21
  slLastUpdated: 0,
22
- tp: 0,
23
- sl: 0,
22
+ tp: 0n,
23
+ sl: 0n,
24
24
  pendingUpdateOrderType: 0,
25
25
  pendingUpdateOrderTimestamp: 0,
26
26
  pendingUpdateOrderFieldAValue: 0n,
27
27
  pendingUpdateOrderFieldBValue: 0n,
28
28
  funding: 0n,
29
29
  borrowInterest: 0n,
30
- liquidationPrice: 0,
30
+ liquidationPrice: 0n,
31
31
  };
32
32
  exports.EMPTY_POSITIONS_RESULT = {
33
33
  positions: [],
@@ -40,7 +40,7 @@ exports.EMPTY_POSITION_LIQUIDATION_INFO = {
40
40
  phase: 0,
41
41
  funding: 0n,
42
42
  borrowInterest: 0n,
43
- liquidationPrice: 0,
43
+ liquidationPrice: 0n,
44
44
  };
45
45
  exports.EMPTY_LIQUIDATION_RESULT = {
46
46
  positionsLiquidationInfo: [],
@@ -1 +1 @@
1
- {"version":3,"file":"TradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrD,OAAO,EACL,wBAAwB,EACxB,mCAAmC,EACnC,6CAA6C,EAC7C,6CAA6C,EAC7C,2CAA2C,EAC3C,2CAA2C,EAE3C,kCAAkC,EAKnC,MAAM,4BAA4B,CAAC;AAyCpC,qBAAa,uBAAwB,YAAW,wBAAwB;IACtE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;gBAEhC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,EAAE,eAAe,EAAE,MAAM;IAOlE,sBAAsB,CAC1B,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IASZ,gCAAgC,CACpC,MAAM,EAAE,6CAA6C,GACpD,OAAO,CAAC,6CAA6C,CAAC;IA6BnD,8BAA8B,CAClC,MAAM,EAAE,2CAA2C,EACnD,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,2CAA2C,CAAC;IAwCjD,uBAAuB,CAC3B,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,mCAAmC,CAAC;IAQzC,yBAAyB,CAC7B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,mCAAmC,EAAE,CAAC;IAW3C,0BAA0B,CAC9B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kCAAkC,CAAC;CAU/C"}
1
+ {"version":3,"file":"TradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrD,OAAO,EACL,wBAAwB,EACxB,mCAAmC,EACnC,6CAA6C,EAC7C,6CAA6C,EAC7C,2CAA2C,EAC3C,2CAA2C,EAE3C,kCAAkC,EAKnC,MAAM,4BAA4B,CAAC;AAyCpC,qBAAa,uBAAwB,YAAW,wBAAwB;IACtE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;gBAEhC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,EAAE,eAAe,EAAE,MAAM;IAOlE,sBAAsB,CAC1B,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IASZ,gCAAgC,CACpC,MAAM,EAAE,6CAA6C,GACpD,OAAO,CAAC,6CAA6C,CAAC;IA4BnD,8BAA8B,CAClC,MAAM,EAAE,2CAA2C,EACnD,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,2CAA2C,CAAC;IAwCjD,uBAAuB,CAC3B,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,mCAAmC,CAAC;IAQzC,yBAAyB,CAC7B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,mCAAmC,EAAE,CAAC;IAW3C,0BAA0B,CAC9B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kCAAkC,CAAC;CAW/C"}
@@ -13,18 +13,18 @@ function convertPositionData(pos) {
13
13
  positionIndex: Number(baseStruct.positionIndex),
14
14
  phase: Number(baseStruct.phase),
15
15
  inPhaseSince: Number(baseStruct.inPhaseSince),
16
- leverage: Number(baseStruct.leverage),
17
- openPrice: Number(baseStruct.openPrice),
18
- spreadReductionF: Number(baseStruct.spreadReductionF),
19
- minPrice: Number(baseStruct.minPrice),
20
- maxPrice: Number(baseStruct.maxPrice),
16
+ leverage: baseStruct.leverage,
17
+ openPrice: baseStruct.openPrice,
18
+ spreadReductionF: baseStruct.spreadReductionF,
19
+ minPrice: baseStruct.minPrice,
20
+ maxPrice: baseStruct.maxPrice,
21
21
  tpLastUpdated: Number(baseStruct.tpLastUpdated),
22
22
  slLastUpdated: Number(baseStruct.slLastUpdated),
23
- tp: Number(baseStruct.tp),
24
- sl: Number(baseStruct.sl),
23
+ tp: baseStruct.tp,
24
+ sl: baseStruct.sl,
25
25
  pendingUpdateOrderType: Number(baseStruct.pendingUpdateOrderType),
26
26
  pendingUpdateOrderTimestamp: Number(baseStruct.pendingUpdateOrderTimestamp),
27
- liquidationPrice: Number(baseStruct.liquidationPrice),
27
+ liquidationPrice: baseStruct.liquidationPrice,
28
28
  };
29
29
  }
30
30
  function convertLiquidationInfo(pos) {
@@ -32,7 +32,7 @@ function convertLiquidationInfo(pos) {
32
32
  return {
33
33
  ...baseStruct,
34
34
  phase: Number(baseStruct.phase),
35
- liquidationPrice: Number(baseStruct.liquidationPrice),
35
+ liquidationPrice: baseStruct.liquidationPrice,
36
36
  };
37
37
  }
38
38
  class TradingFloorLensService {