perps-sdk-ts 1.0.1

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 (117) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/CONTRACT_METHOD_FIXES.md +189 -0
  3. package/INTEGRATION_SUMMARY.md +219 -0
  4. package/OPTIMIZATION_GUIDE.md +238 -0
  5. package/README.md +384 -0
  6. package/SNAPSHOT_FIX_SUMMARY.md +161 -0
  7. package/SNAPSHOT_OPTIMIZATION_SUMMARY.md +199 -0
  8. package/dist/abis/Referral.d.ts +36 -0
  9. package/dist/abis/Referral.js +4 -0
  10. package/dist/abis/Trading.d.ts +57 -0
  11. package/dist/abis/Trading.js +742 -0
  12. package/dist/abis/erc20.d.ts +51 -0
  13. package/dist/abis/erc20.js +4 -0
  14. package/dist/abis/index.d.ts +8 -0
  15. package/dist/abis/index.js +24 -0
  16. package/dist/abis/multicall.d.ts +85 -0
  17. package/dist/abis/multicall.js +4 -0
  18. package/dist/abis/pairInfos.d.ts +77 -0
  19. package/dist/abis/pairInfos.js +4 -0
  20. package/dist/abis/pairStorage.d.ts +124 -0
  21. package/dist/abis/pairStorage.js +4 -0
  22. package/dist/abis/priceAggregator.d.ts +77 -0
  23. package/dist/abis/priceAggregator.js +4 -0
  24. package/dist/abis/tardingStorage.d.ts +97 -0
  25. package/dist/abis/tardingStorage.js +1295 -0
  26. package/dist/abis.d.ts +623 -0
  27. package/dist/abis.js +49 -0
  28. package/dist/client.d.ts +118 -0
  29. package/dist/client.js +224 -0
  30. package/dist/config.d.ts +43 -0
  31. package/dist/config.js +42 -0
  32. package/dist/crypto/spki.d.ts +55 -0
  33. package/dist/crypto/spki.js +160 -0
  34. package/dist/feed/feed_client.d.ts +68 -0
  35. package/dist/feed/feed_client.js +239 -0
  36. package/dist/index.d.ts +28 -0
  37. package/dist/index.js +87 -0
  38. package/dist/rpc/asset_parameters.d.ts +62 -0
  39. package/dist/rpc/asset_parameters.js +169 -0
  40. package/dist/rpc/blended.d.ts +23 -0
  41. package/dist/rpc/blended.js +55 -0
  42. package/dist/rpc/category_parameters.d.ts +34 -0
  43. package/dist/rpc/category_parameters.js +105 -0
  44. package/dist/rpc/delegation.d.ts +81 -0
  45. package/dist/rpc/delegation.js +180 -0
  46. package/dist/rpc/fee_parameters.d.ts +46 -0
  47. package/dist/rpc/fee_parameters.js +113 -0
  48. package/dist/rpc/multicall.d.ts +83 -0
  49. package/dist/rpc/multicall.js +117 -0
  50. package/dist/rpc/pair_info_queries.d.ts +101 -0
  51. package/dist/rpc/pair_info_queries.js +161 -0
  52. package/dist/rpc/pairs_cache.d.ts +62 -0
  53. package/dist/rpc/pairs_cache.js +240 -0
  54. package/dist/rpc/referral_operations.d.ts +67 -0
  55. package/dist/rpc/referral_operations.js +143 -0
  56. package/dist/rpc/snapshot.d.ts +49 -0
  57. package/dist/rpc/snapshot.js +162 -0
  58. package/dist/rpc/trade.d.ts +84 -0
  59. package/dist/rpc/trade.js +249 -0
  60. package/dist/rpc/trading_operations.d.ts +103 -0
  61. package/dist/rpc/trading_operations.js +295 -0
  62. package/dist/rpc/trading_parameters.d.ts +49 -0
  63. package/dist/rpc/trading_parameters.js +94 -0
  64. package/dist/signers/base.d.ts +24 -0
  65. package/dist/signers/base.js +10 -0
  66. package/dist/signers/kms.d.ts +47 -0
  67. package/dist/signers/kms.js +172 -0
  68. package/dist/signers/local.d.ts +43 -0
  69. package/dist/signers/local.js +64 -0
  70. package/dist/types.d.ts +1419 -0
  71. package/dist/types.js +245 -0
  72. package/dist/utils.d.ts +52 -0
  73. package/dist/utils.js +134 -0
  74. package/examples/advanced-queries.ts +181 -0
  75. package/examples/basic-usage.ts +78 -0
  76. package/examples/delegation-and-referrals.ts +130 -0
  77. package/examples/get-pyth-ids.ts +61 -0
  78. package/examples/kms-signer.ts +31 -0
  79. package/examples/optimized-snapshot.ts +153 -0
  80. package/examples/price-feed-with-sdk-ids.ts +97 -0
  81. package/examples/price-feed.ts +36 -0
  82. package/examples/trading-operations.ts +149 -0
  83. package/package.json +41 -0
  84. package/src/abis/Referral.ts +3 -0
  85. package/src/abis/Trading.ts +741 -0
  86. package/src/abis/erc20.ts +3 -0
  87. package/src/abis/index.ts +8 -0
  88. package/src/abis/multicall.ts +3 -0
  89. package/src/abis/pairInfos.ts +3 -0
  90. package/src/abis/pairStorage.ts +3 -0
  91. package/src/abis/priceAggregator.ts +3 -0
  92. package/src/abis/tardingStorage.ts +1294 -0
  93. package/src/abis.ts +56 -0
  94. package/src/client.ts +373 -0
  95. package/src/config.ts +62 -0
  96. package/src/crypto/spki.ts +197 -0
  97. package/src/feed/feed_client.ts +288 -0
  98. package/src/index.ts +114 -0
  99. package/src/rpc/asset_parameters.ts +217 -0
  100. package/src/rpc/blended.ts +77 -0
  101. package/src/rpc/category_parameters.ts +128 -0
  102. package/src/rpc/delegation.ts +225 -0
  103. package/src/rpc/fee_parameters.ts +150 -0
  104. package/src/rpc/multicall.ts +164 -0
  105. package/src/rpc/pair_info_queries.ts +208 -0
  106. package/src/rpc/pairs_cache.ts +268 -0
  107. package/src/rpc/referral_operations.ts +164 -0
  108. package/src/rpc/snapshot.ts +210 -0
  109. package/src/rpc/trade.ts +306 -0
  110. package/src/rpc/trading_operations.ts +378 -0
  111. package/src/rpc/trading_parameters.ts +127 -0
  112. package/src/signers/base.ts +27 -0
  113. package/src/signers/kms.ts +212 -0
  114. package/src/signers/local.ts +70 -0
  115. package/src/types.ts +410 -0
  116. package/src/utils.ts +155 -0
  117. package/tsconfig.json +18 -0
@@ -0,0 +1,51 @@
1
+ declare const abi: ({
2
+ inputs: {
3
+ internalType: string;
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ stateMutability: string;
8
+ type: string;
9
+ name?: undefined;
10
+ anonymous?: undefined;
11
+ outputs?: undefined;
12
+ } | {
13
+ inputs: {
14
+ internalType: string;
15
+ name: string;
16
+ type: string;
17
+ }[];
18
+ name: string;
19
+ type: string;
20
+ stateMutability?: undefined;
21
+ anonymous?: undefined;
22
+ outputs?: undefined;
23
+ } | {
24
+ anonymous: boolean;
25
+ inputs: {
26
+ indexed: boolean;
27
+ internalType: string;
28
+ name: string;
29
+ type: string;
30
+ }[];
31
+ name: string;
32
+ type: string;
33
+ stateMutability?: undefined;
34
+ outputs?: undefined;
35
+ } | {
36
+ inputs: {
37
+ internalType: string;
38
+ name: string;
39
+ type: string;
40
+ }[];
41
+ name: string;
42
+ outputs: {
43
+ internalType: string;
44
+ name: string;
45
+ type: string;
46
+ }[];
47
+ stateMutability: string;
48
+ type: string;
49
+ anonymous?: undefined;
50
+ })[];
51
+ export default abi;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const abi = [{ "inputs": [{ "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "initialSupply", "type": "uint256" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientAllowance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientBalance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "approver", "type": "address" }], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }], "name": "ERC20InvalidSpender", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "value", "type": "bool" }], "name": "BlacklistUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "CrosschainBurn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "CrosschainMint", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferStarted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "bool", "name": "value", "type": "bool" }], "name": "blacklistUpdate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_from", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "crosschainBurn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "crosschainMint", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], "name": "isBlackListed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingOwner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "_interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
4
+ exports.default = abi;
@@ -0,0 +1,8 @@
1
+ export * from "./Referral";
2
+ export * from "./Trading";
3
+ export * from "./erc20";
4
+ export * from "./multicall";
5
+ export * from "./pairInfos";
6
+ export * from "./pairStorage";
7
+ export * from "./priceAggregator";
8
+ export * from "./tardingStorage";
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Referral"), exports);
18
+ __exportStar(require("./Trading"), exports);
19
+ __exportStar(require("./erc20"), exports);
20
+ __exportStar(require("./multicall"), exports);
21
+ __exportStar(require("./pairInfos"), exports);
22
+ __exportStar(require("./pairStorage"), exports);
23
+ __exportStar(require("./priceAggregator"), exports);
24
+ __exportStar(require("./tardingStorage"), exports);
@@ -0,0 +1,85 @@
1
+ declare const abi: ({
2
+ inputs: {
3
+ internalType: string;
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ stateMutability: string;
8
+ type: string;
9
+ name?: undefined;
10
+ outputs?: undefined;
11
+ } | {
12
+ inputs: {
13
+ internalType: string;
14
+ name: string;
15
+ type: string;
16
+ }[];
17
+ name: string;
18
+ outputs: {
19
+ components: ({
20
+ internalType: string;
21
+ name: string;
22
+ type: string;
23
+ components?: undefined;
24
+ } | {
25
+ components: ({
26
+ components: {
27
+ internalType: string;
28
+ name: string;
29
+ type: string;
30
+ }[];
31
+ internalType: string;
32
+ name: string;
33
+ type: string;
34
+ } | {
35
+ internalType: string;
36
+ name: string;
37
+ type: string;
38
+ components?: undefined;
39
+ })[];
40
+ internalType: string;
41
+ name: string;
42
+ type: string;
43
+ })[];
44
+ internalType: string;
45
+ name: string;
46
+ type: string;
47
+ }[];
48
+ stateMutability: string;
49
+ type: string;
50
+ } | {
51
+ inputs: ({
52
+ internalType: string;
53
+ name: string;
54
+ type: string;
55
+ components?: undefined;
56
+ } | {
57
+ components: {
58
+ internalType: string;
59
+ name: string;
60
+ type: string;
61
+ }[];
62
+ internalType: string;
63
+ name: string;
64
+ type: string;
65
+ })[];
66
+ name: string;
67
+ outputs: ({
68
+ internalType: string;
69
+ name: string;
70
+ type: string;
71
+ components?: undefined;
72
+ } | {
73
+ components: {
74
+ internalType: string;
75
+ name: string;
76
+ type: string;
77
+ }[];
78
+ internalType: string;
79
+ name: string;
80
+ type: string;
81
+ })[];
82
+ stateMutability: string;
83
+ type: string;
84
+ })[];
85
+ export default abi;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const abi = [{ "inputs": [{ "internalType": "address", "name": "_storage", "type": "address" }, { "internalType": "address", "name": "_pairInfos", "type": "address" }, { "internalType": "address", "name": "_pairsStorage", "type": "address" }, { "internalType": "address", "name": "_trading", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "target", "type": "address" }, { "internalType": "bytes", "name": "callData", "type": "bytes" }], "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" }], "name": "aggregate", "outputs": [{ "internalType": "uint256", "name": "blockNumber", "type": "uint256" }, { "internalType": "bytes[]", "name": "returnData", "type": "bytes[]" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "target", "type": "address" }, { "internalType": "bool", "name": "allowFailure", "type": "bool" }, { "internalType": "bytes", "name": "callData", "type": "bytes" }], "internalType": "struct Multicall3.Call3[]", "name": "calls", "type": "tuple[]" }], "name": "aggregate3", "outputs": [{ "components": [{ "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "bytes", "name": "returnData", "type": "bytes" }], "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "target", "type": "address" }, { "internalType": "bool", "name": "allowFailure", "type": "bool" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "bytes", "name": "callData", "type": "bytes" }], "internalType": "struct Multicall3.Call3Value[]", "name": "calls", "type": "tuple[]" }], "name": "aggregate3Value", "outputs": [{ "components": [{ "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "bytes", "name": "returnData", "type": "bytes" }], "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "target", "type": "address" }, { "internalType": "bytes", "name": "callData", "type": "bytes" }], "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" }], "name": "blockAndAggregate", "outputs": [{ "internalType": "uint256", "name": "blockNumber", "type": "uint256" }, { "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }, { "components": [{ "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "bytes", "name": "returnData", "type": "bytes" }], "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" }], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "getBasefee", "outputs": [{ "internalType": "uint256", "name": "basefee", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "blockNumber", "type": "uint256" }], "name": "getBlockHash", "outputs": [{ "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getBlockNumber", "outputs": [{ "internalType": "uint256", "name": "blockNumber", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getChainId", "outputs": [{ "internalType": "uint256", "name": "chainid", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCurrentBlockCoinbase", "outputs": [{ "internalType": "address", "name": "coinbase", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCurrentBlockDifficulty", "outputs": [{ "internalType": "uint256", "name": "difficulty", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCurrentBlockGasLimit", "outputs": [{ "internalType": "uint256", "name": "gaslimit", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getCurrentBlockTimestamp", "outputs": [{ "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "addr", "type": "address" }], "name": "getEthBalance", "outputs": [{ "internalType": "uint256", "name": "balance", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "userAddress", "type": "address" }], "name": "getFirstEmptyTradeIndexes", "outputs": [{ "internalType": "uint256[]", "name": "firstEmptyTradeIndexes", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getLastBlockHash", "outputs": [{ "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }], "name": "getLiquidationPrice", "outputs": [{ "internalType": "uint256", "name": "liquidationPrice", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getLongShortRatios", "outputs": [{ "internalType": "uint256[]", "name": "longRatio", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "shortRatio", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getMargins", "outputs": [{ "internalType": "uint256[]", "name": "rolloverFeePerBlockP", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "rolloverFeePerBlockLong", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "rolloverFeePerBlockShort", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "openInterestUSDCLong", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "openInterestUSDCShort", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getMarginsForPair", "outputs": [{ "internalType": "uint256", "name": "rolloverFeePerBlockP", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFeePerBlockLong", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFeePerBlockShort", "type": "uint256" }, { "internalType": "uint256", "name": "openInterestUSDCLong", "type": "uint256" }, { "internalType": "uint256", "name": "openInterestUSDCShort", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "userAddress", "type": "address" }], "name": "getOpenLimitOrdersCounts", "outputs": [{ "internalType": "uint256[]", "name": "openLimitOrdersCounts", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_trader", "type": "address" }], "name": "getPendingOrder", "outputs": [{ "components": [{ "internalType": "uint256", "name": "orderId", "type": "uint256" }, { "components": [{ "components": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "initialPosToken", "type": "uint256" }, { "internalType": "uint256", "name": "positionSizeUSDC", "type": "uint256" }, { "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "bool", "name": "buy", "type": "bool" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "tp", "type": "uint256" }, { "internalType": "uint256", "name": "sl", "type": "uint256" }, { "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "internalType": "struct ITradingStorage.Trade", "name": "trade", "type": "tuple" }, { "internalType": "uint256", "name": "block", "type": "uint256" }, { "internalType": "uint256", "name": "wantedPrice", "type": "uint256" }, { "internalType": "uint256", "name": "slippageP", "type": "uint256" }], "internalType": "struct ITradingStorage.PendingMarketOrder", "name": "orderInfo", "type": "tuple" }], "internalType": "struct IMulticall.AggregatedPendingOrder[]", "name": "pendingOrders", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "userAddress", "type": "address" }], "name": "getPositions", "outputs": [{ "components": [{ "components": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "initialPosToken", "type": "uint256" }, { "internalType": "uint256", "name": "positionSizeUSDC", "type": "uint256" }, { "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "bool", "name": "buy", "type": "bool" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "tp", "type": "uint256" }, { "internalType": "uint256", "name": "sl", "type": "uint256" }, { "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "internalType": "struct ITradingStorage.Trade", "name": "trade", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "openInterestUSDC", "type": "uint256" }, { "internalType": "uint256", "name": "tpLastUpdated", "type": "uint256" }, { "internalType": "uint256", "name": "slLastUpdated", "type": "uint256" }, { "internalType": "bool", "name": "beingMarketClosed", "type": "bool" }, { "internalType": "uint256", "name": "lossProtection", "type": "uint256" }], "internalType": "struct ITradingStorage.TradeInfo", "name": "tradeInfo", "type": "tuple" }, { "internalType": "uint256", "name": "rolloverFee", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationPrice", "type": "uint256" }, { "internalType": "bool", "name": "isPnl", "type": "bool" }], "internalType": "struct IMulticall.AggregatedTrade[]", "name": "", "type": "tuple[]" }, { "components": [{ "components": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "positionSize", "type": "uint256" }, { "internalType": "bool", "name": "buy", "type": "bool" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "tp", "type": "uint256" }, { "internalType": "uint256", "name": "sl", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "slippageP", "type": "uint256" }, { "internalType": "uint256", "name": "block", "type": "uint256" }, { "internalType": "uint256", "name": "executionFee", "type": "uint256" }], "internalType": "struct ITradingStorage.OpenLimitOrder", "name": "order", "type": "tuple" }, { "internalType": "uint256", "name": "liquidationPrice", "type": "uint256" }], "internalType": "struct IMulticall.AggregatedOrder[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "userAddress", "type": "address" }, { "internalType": "uint256", "name": "startPairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "endPairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "maxTradesPerPair", "type": "uint256" }], "name": "getPositionsForPairIndexes", "outputs": [{ "components": [{ "components": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "initialPosToken", "type": "uint256" }, { "internalType": "uint256", "name": "positionSizeUSDC", "type": "uint256" }, { "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "bool", "name": "buy", "type": "bool" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "tp", "type": "uint256" }, { "internalType": "uint256", "name": "sl", "type": "uint256" }, { "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "internalType": "struct ITradingStorage.Trade", "name": "trade", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "openInterestUSDC", "type": "uint256" }, { "internalType": "uint256", "name": "tpLastUpdated", "type": "uint256" }, { "internalType": "uint256", "name": "slLastUpdated", "type": "uint256" }, { "internalType": "bool", "name": "beingMarketClosed", "type": "bool" }, { "internalType": "uint256", "name": "lossProtection", "type": "uint256" }], "internalType": "struct ITradingStorage.TradeInfo", "name": "tradeInfo", "type": "tuple" }, { "internalType": "uint256", "name": "rolloverFee", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationPrice", "type": "uint256" }, { "internalType": "bool", "name": "isPnl", "type": "bool" }], "internalType": "struct IMulticall.AggregatedTrade[]", "name": "", "type": "tuple[]" }, { "components": [{ "components": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "positionSize", "type": "uint256" }, { "internalType": "bool", "name": "buy", "type": "bool" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "tp", "type": "uint256" }, { "internalType": "uint256", "name": "sl", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "slippageP", "type": "uint256" }, { "internalType": "uint256", "name": "block", "type": "uint256" }, { "internalType": "uint256", "name": "executionFee", "type": "uint256" }], "internalType": "struct ITradingStorage.OpenLimitOrder", "name": "order", "type": "tuple" }, { "internalType": "uint256", "name": "liquidationPrice", "type": "uint256" }], "internalType": "struct IMulticall.AggregatedOrder[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bool", "name": "requireSuccess", "type": "bool" }, { "components": [{ "internalType": "address", "name": "target", "type": "address" }, { "internalType": "bytes", "name": "callData", "type": "bytes" }], "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" }], "name": "tryAggregate", "outputs": [{ "components": [{ "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "bytes", "name": "returnData", "type": "bytes" }], "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "bool", "name": "requireSuccess", "type": "bool" }, { "components": [{ "internalType": "address", "name": "target", "type": "address" }, { "internalType": "bytes", "name": "callData", "type": "bytes" }], "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" }], "name": "tryBlockAndAggregate", "outputs": [{ "internalType": "uint256", "name": "blockNumber", "type": "uint256" }, { "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }, { "components": [{ "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "bytes", "name": "returnData", "type": "bytes" }], "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_storage", "type": "address" }, { "internalType": "address", "name": "_pairInfos", "type": "address" }, { "internalType": "address", "name": "_pairsStorage", "type": "address" }, { "internalType": "address", "name": "_trading", "type": "address" }], "name": "updateContracts", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
4
+ exports.default = abi;
@@ -0,0 +1,77 @@
1
+ declare const abi: ({
2
+ inputs: never[];
3
+ stateMutability: string;
4
+ type: string;
5
+ anonymous?: undefined;
6
+ name?: undefined;
7
+ outputs?: undefined;
8
+ } | {
9
+ anonymous: boolean;
10
+ inputs: ({
11
+ indexed: boolean;
12
+ internalType: string;
13
+ name: string;
14
+ type: string;
15
+ components?: undefined;
16
+ } | {
17
+ components: {
18
+ internalType: string;
19
+ name: string;
20
+ type: string;
21
+ }[];
22
+ indexed: boolean;
23
+ internalType: string;
24
+ name: string;
25
+ type: string;
26
+ })[];
27
+ name: string;
28
+ type: string;
29
+ stateMutability?: undefined;
30
+ outputs?: undefined;
31
+ } | {
32
+ inputs: {
33
+ internalType: string;
34
+ name: string;
35
+ type: string;
36
+ }[];
37
+ name: string;
38
+ outputs: {
39
+ components: {
40
+ internalType: string;
41
+ name: string;
42
+ type: string;
43
+ }[];
44
+ internalType: string;
45
+ name: string;
46
+ type: string;
47
+ }[];
48
+ stateMutability: string;
49
+ type: string;
50
+ anonymous?: undefined;
51
+ } | {
52
+ inputs: ({
53
+ components: {
54
+ internalType: string;
55
+ name: string;
56
+ type: string;
57
+ }[];
58
+ internalType: string;
59
+ name: string;
60
+ type: string;
61
+ } | {
62
+ internalType: string;
63
+ name: string;
64
+ type: string;
65
+ components?: undefined;
66
+ })[];
67
+ name: string;
68
+ outputs: {
69
+ internalType: string;
70
+ name: string;
71
+ type: string;
72
+ }[];
73
+ stateMutability: string;
74
+ type: string;
75
+ anonymous?: undefined;
76
+ })[];
77
+ export default abi;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const abi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "valueLong", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "valueShort", "type": "uint256" }], "name": "AccRolloverFeesStored", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "multiplierCoeffMax", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "groupId", "type": "uint256" }], "name": "CoeffUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "multiplierDenom", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "groupId", "type": "uint256" }], "name": "DenomUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "bool", "name": "buy", "type": "bool" }, { "indexed": false, "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "indexed": false, "internalType": "int256", "name": "percentProfit", "type": "int256" }, { "indexed": false, "internalType": "uint256", "name": "r", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "closingFee", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "lossProtection", "type": "uint256" }], "name": "FeesCharged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "keeper", "type": "address" }], "name": "KeeperUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newThreshold", "type": "uint256" }], "name": "LiqThresholdUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "numTiers", "type": "uint256" }, { "indexed": false, "internalType": "uint256[]", "name": "longSkewConfig", "type": "uint256[]" }, { "indexed": false, "internalType": "uint256[]", "name": "shortSkewConfig", "type": "uint256[]" }], "name": "LossProtectionConfigSet", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "value", "type": "address" }], "name": "ManagerUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "MaxNegativePnlOnOpenPUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "minMultiplierRate", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "maxMultiplierRate", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "groupId", "type": "uint256" }], "name": "MultiplierUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "valueAbove", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "valueBelow", "type": "uint256" }], "name": "OnePercentDepthUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "components": [{ "internalType": "uint256", "name": "onePercentDepthAbove", "type": "uint256" }, { "internalType": "uint256", "name": "onePercentDepthBelow", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFeePerBlockP", "type": "uint256" }], "indexed": false, "internalType": "struct IPairInfos.PairParams", "name": "value", "type": "tuple" }], "name": "PairParamsUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "newPairStorage", "type": "address" }], "name": "PairStorageUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }], "name": "RolloverFeePerBlockPUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "trader", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "index", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rollover", "type": "uint256" }], "name": "TradeInitialAccFeesStored", "type": "event" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getAccRolloverFeesLong", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getAccRolloverFeesShort", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getAccRolloverFeesUpdateBlock", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_pairIndex", "type": "uint256" }, { "internalType": "bool", "name": "_long", "type": "bool" }, { "internalType": "uint256", "name": "_longOI", "type": "uint256" }, { "internalType": "uint256", "name": "_shortOI", "type": "uint256" }], "name": "getBlendedSkew", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "_longOI", "type": "uint256" }, { "internalType": "uint256", "name": "_shortOI", "type": "uint256" }], "name": "getBlendedUtilizationRatio", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getOnePercentDepthAbove", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getOnePercentDepthBelow", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "indices", "type": "uint256[]" }], "name": "getPairInfos", "outputs": [{ "components": [{ "internalType": "uint256", "name": "onePercentDepthAbove", "type": "uint256" }, { "internalType": "uint256", "name": "onePercentDepthBelow", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFeePerBlockP", "type": "uint256" }], "internalType": "struct IPairInfos.PairParams[]", "name": "", "type": "tuple[]" }, { "components": [{ "internalType": "uint256", "name": "accPerOiLong", "type": "uint256" }, { "internalType": "uint256", "name": "accPerOiShort", "type": "uint256" }, { "internalType": "uint256", "name": "lastUpdateBlock", "type": "uint256" }], "internalType": "struct IPairInfos.PairRolloverFees[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getPendingAccRolloverFees", "outputs": [{ "internalType": "uint256", "name": "valueLong", "type": "uint256" }, { "internalType": "uint256", "name": "valueShort", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_pairIndex", "type": "uint256" }, { "internalType": "bool", "name": "_isBuy", "type": "bool" }, { "internalType": "uint256", "name": "_leveragePosition", "type": "uint256" }, { "internalType": "bool", "name": "isPnl", "type": "bool" }], "name": "getPriceImpactSpread", "outputs": [{ "internalType": "int256", "name": "spread", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }], "name": "getRolloverFeePerBlockP", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_pairIndex", "type": "uint256" }, { "internalType": "bool", "name": "_isBuy", "type": "bool" }, { "internalType": "uint256", "name": "_leveragePosition", "type": "uint256" }, { "internalType": "bool", "name": "isPnl", "type": "bool" }], "name": "getSkewImpactSpread", "outputs": [{ "internalType": "int256", "name": "spread", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }], "name": "getTradeInitialAccRolloverFeesPerCollateral", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "bool", "name": "long", "type": "bool" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }], "name": "getTradeLiquidationPrice", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "bool", "name": "long", "type": "bool" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFee", "type": "uint256" }], "name": "getTradeLiquidationPricePure", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "bool", "name": "long", "type": "bool" }, { "internalType": "uint256", "name": "tradeOpenInterest", "type": "uint256" }, { "internalType": "bool", "name": "isPnl", "type": "bool" }], "name": "getTradePriceImpact", "outputs": [{ "internalType": "uint256", "name": "priceAfterImpact", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "bool", "name": "long", "type": "bool" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }], "name": "getTradeRolloverFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "accRolloverFeesPerOi", "type": "uint256" }, { "internalType": "uint256", "name": "endAccRolloverFeesPerOi", "type": "uint256" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }], "name": "getTradeRolloverFeePure", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "initialPosToken", "type": "uint256" }, { "internalType": "uint256", "name": "positionSizeUSDC", "type": "uint256" }, { "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "bool", "name": "buy", "type": "bool" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "tp", "type": "uint256" }, { "internalType": "uint256", "name": "sl", "type": "uint256" }, { "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "internalType": "struct ITradingStorage.Trade", "name": "_trade", "type": "tuple" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "int256", "name": "percentProfit", "type": "int256" }, { "internalType": "uint256", "name": "closingFee", "type": "uint256" }], "name": "getTradeValue", "outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "int256", "name": "pnl", "type": "int256" }, { "internalType": "uint256", "name": "fees", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "int256", "name": "percentProfit", "type": "int256" }, { "internalType": "uint256", "name": "rolloverFee", "type": "uint256" }, { "internalType": "uint256", "name": "closingFee", "type": "uint256" }, { "internalType": "uint256", "name": "lossProtection", "type": "uint256" }], "name": "getTradeValuePure", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "int256", "name": "", "type": "int256" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_storageT", "type": "address" }, { "internalType": "address", "name": "_pairsStorage", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "keeper", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "liqThreshold", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "longSkewConfig", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "lossProtectionNumTiers", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "initialPosToken", "type": "uint256" }, { "internalType": "uint256", "name": "positionSizeUSDC", "type": "uint256" }, { "internalType": "uint256", "name": "openPrice", "type": "uint256" }, { "internalType": "bool", "name": "buy", "type": "bool" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }, { "internalType": "uint256", "name": "tp", "type": "uint256" }, { "internalType": "uint256", "name": "sl", "type": "uint256" }, { "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "internalType": "struct ITradingStorage.Trade", "name": "_trade", "type": "tuple" }, { "internalType": "bool", "name": "isPnl", "type": "bool" }], "name": "lossProtectionTier", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "manager", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "leverage", "type": "uint256" }], "name": "minMaxRollOverFee", "outputs": [{ "internalType": "uint256", "name": "minBorrowFee", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowFee", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "pairParams", "outputs": [{ "internalType": "uint256", "name": "onePercentDepthAbove", "type": "uint256" }, { "internalType": "uint256", "name": "onePercentDepthBelow", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFeePerBlockP", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "pairRolloverFees", "outputs": [{ "internalType": "uint256", "name": "accPerOiLong", "type": "uint256" }, { "internalType": "uint256", "name": "accPerOiShort", "type": "uint256" }, { "internalType": "uint256", "name": "lastUpdateBlock", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pairsStorage", "outputs": [{ "internalType": "contract IPairStorage", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }], "name": "resetTradeInitialAccess", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_keeper", "type": "address" }], "name": "setKeeper", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_pairIndex", "type": "uint256" }, { "internalType": "uint256[]", "name": "_longSkewConfig", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "_shortSkewConfig", "type": "uint256[]" }], "name": "setLossProtectionConfig", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_manager", "type": "address" }], "name": "setManager", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "valueAbove", "type": "uint256" }, { "internalType": "uint256", "name": "valueBelow", "type": "uint256" }], "name": "setOnePercentDepth", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "indices", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "valuesAbove", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "valuesBelow", "type": "uint256[]" }], "name": "setOnePercentDepthArray", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "components": [{ "internalType": "uint256", "name": "onePercentDepthAbove", "type": "uint256" }, { "internalType": "uint256", "name": "onePercentDepthBelow", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFeePerBlockP", "type": "uint256" }], "internalType": "struct IPairInfos.PairParams", "name": "value", "type": "tuple" }], "name": "setPairParams", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "indices", "type": "uint256[]" }, { "components": [{ "internalType": "uint256", "name": "onePercentDepthAbove", "type": "uint256" }, { "internalType": "uint256", "name": "onePercentDepthBelow", "type": "uint256" }, { "internalType": "uint256", "name": "rolloverFeePerBlockP", "type": "uint256" }], "internalType": "struct IPairInfos.PairParams[]", "name": "values", "type": "tuple[]" }], "name": "setPairParamsArray", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "setRolloverFeePerBlockP", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "shortSkewConfig", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "storageT", "outputs": [{ "internalType": "contract ITradingStorage", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "pairIndex", "type": "uint256" }, { "internalType": "uint256", "name": "index", "type": "uint256" }, { "internalType": "bool", "name": "long", "type": "bool" }], "name": "storeTradeInitialAccFees", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "tradeInitialAccFees", "outputs": [{ "internalType": "uint256", "name": "rollover", "type": "uint256" }, { "internalType": "bool", "name": "openedAfterUpdate", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_newThreshold", "type": "uint256" }], "name": "udpateLiquidationThreshold", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_newPairStorage", "type": "address" }], "name": "updatePairStorage", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
4
+ exports.default = abi;
@@ -0,0 +1,124 @@
1
+ declare const abi: ({
2
+ inputs: never[];
3
+ stateMutability: string;
4
+ type: string;
5
+ anonymous?: undefined;
6
+ name?: undefined;
7
+ outputs?: undefined;
8
+ } | {
9
+ anonymous: boolean;
10
+ inputs: {
11
+ components: {
12
+ internalType: string;
13
+ name: string;
14
+ type: string;
15
+ }[];
16
+ indexed: boolean;
17
+ internalType: string;
18
+ name: string;
19
+ type: string;
20
+ }[];
21
+ name: string;
22
+ type: string;
23
+ stateMutability?: undefined;
24
+ outputs?: undefined;
25
+ } | {
26
+ anonymous: boolean;
27
+ inputs: {
28
+ indexed: boolean;
29
+ internalType: string;
30
+ name: string;
31
+ type: string;
32
+ }[];
33
+ name: string;
34
+ type: string;
35
+ stateMutability?: undefined;
36
+ outputs?: undefined;
37
+ } | {
38
+ inputs: {
39
+ internalType: string;
40
+ name: string;
41
+ type: string;
42
+ }[];
43
+ name: string;
44
+ outputs: ({
45
+ internalType: string;
46
+ name: string;
47
+ type: string;
48
+ components?: undefined;
49
+ } | {
50
+ components: {
51
+ internalType: string;
52
+ name: string;
53
+ type: string;
54
+ }[];
55
+ internalType: string;
56
+ name: string;
57
+ type: string;
58
+ })[];
59
+ stateMutability: string;
60
+ type: string;
61
+ anonymous?: undefined;
62
+ } | {
63
+ inputs: {
64
+ internalType: string;
65
+ name: string;
66
+ type: string;
67
+ }[];
68
+ name: string;
69
+ outputs: {
70
+ components: ({
71
+ components: {
72
+ internalType: string;
73
+ name: string;
74
+ type: string;
75
+ }[];
76
+ internalType: string;
77
+ name: string;
78
+ type: string;
79
+ } | {
80
+ internalType: string;
81
+ name: string;
82
+ type: string;
83
+ components?: undefined;
84
+ })[];
85
+ internalType: string;
86
+ name: string;
87
+ type: string;
88
+ }[];
89
+ stateMutability: string;
90
+ type: string;
91
+ anonymous?: undefined;
92
+ } | {
93
+ inputs: ({
94
+ internalType: string;
95
+ name: string;
96
+ type: string;
97
+ components?: undefined;
98
+ } | {
99
+ components: ({
100
+ internalType: string;
101
+ name: string;
102
+ type: string;
103
+ components?: undefined;
104
+ } | {
105
+ components: {
106
+ internalType: string;
107
+ name: string;
108
+ type: string;
109
+ }[];
110
+ internalType: string;
111
+ name: string;
112
+ type: string;
113
+ })[];
114
+ internalType: string;
115
+ name: string;
116
+ type: string;
117
+ })[];
118
+ name: string;
119
+ outputs: never[];
120
+ stateMutability: string;
121
+ type: string;
122
+ anonymous?: undefined;
123
+ })[];
124
+ export default abi;