@gmx-io/sdk 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/build/cjs/src/abis/StBTC.json +1225 -0
  2. package/build/cjs/src/abis/SyntheticsReader.json +480 -19
  3. package/build/cjs/src/configs/__tests__/tokens.spec.js +1 -0
  4. package/build/cjs/src/configs/chains.js +57 -6
  5. package/build/cjs/src/configs/contracts.js +64 -68
  6. package/build/cjs/src/configs/dataStore.js +4 -3
  7. package/build/cjs/src/configs/express.js +2 -1
  8. package/build/cjs/src/configs/markets.js +37 -0
  9. package/build/cjs/src/configs/oracleKeeper.js +1 -0
  10. package/build/cjs/src/configs/tokens.js +130 -1
  11. package/build/cjs/src/modules/orders/helpers.js +12 -13
  12. package/build/cjs/src/modules/positions/positions.js +9 -0
  13. package/build/cjs/src/prebuilt/hashedKinkModelMarketRatesKeys.json +42 -0
  14. package/build/cjs/src/prebuilt/hashedMarketConfigKeys.json +257 -0
  15. package/build/cjs/src/prebuilt/hashedMarketValuesKeys.json +77 -0
  16. package/build/cjs/src/types/subsquid.js +103 -1
  17. package/build/cjs/src/utils/__tests__/numbers.spec.js +17 -9
  18. package/build/cjs/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +2 -0
  19. package/build/cjs/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +2 -0
  20. package/build/cjs/src/utils/__tests__/orderTransactions/swapOrders.spec.js +1 -0
  21. package/build/cjs/src/utils/__tests__/prices.spec.js +3 -2
  22. package/build/cjs/src/utils/__tests__/uiFeeReceiver.spec.js +9 -0
  23. package/build/cjs/src/utils/errors/transactionsErrors.js +2 -1
  24. package/build/cjs/src/utils/fees/executionFee.js +9 -1
  25. package/build/cjs/src/utils/numbers.js +52 -34
  26. package/build/cjs/src/utils/orderTransactions.js +3 -0
  27. package/build/cjs/src/utils/orders.js +8 -2
  28. package/build/cjs/src/utils/prices.js +1 -1
  29. package/build/cjs/src/utils/swap/swapValues.js +40 -0
  30. package/build/cjs/src/utils/tokens.js +10 -1
  31. package/build/cjs/src/utils/twap/uiFeeReceiver.js +26 -6
  32. package/build/esm/src/abis/StBTC.json +1225 -0
  33. package/build/esm/src/abis/SyntheticsReader.json +480 -19
  34. package/build/esm/src/configs/__tests__/tokens.spec.js +2 -1
  35. package/build/esm/src/configs/chains.js +56 -5
  36. package/build/esm/src/configs/contracts.js +65 -69
  37. package/build/esm/src/configs/dataStore.js +1 -0
  38. package/build/esm/src/configs/express.js +4 -3
  39. package/build/esm/src/configs/markets.js +38 -1
  40. package/build/esm/src/configs/oracleKeeper.js +2 -1
  41. package/build/esm/src/configs/tokens.js +131 -2
  42. package/build/esm/src/modules/orders/helpers.js +12 -13
  43. package/build/esm/src/modules/positions/positions.js +9 -0
  44. package/build/esm/src/prebuilt/hashedKinkModelMarketRatesKeys.json +42 -0
  45. package/build/esm/src/prebuilt/hashedMarketConfigKeys.json +257 -0
  46. package/build/esm/src/prebuilt/hashedMarketValuesKeys.json +77 -0
  47. package/build/esm/src/types/subsquid.js +102 -0
  48. package/build/esm/src/utils/__tests__/numbers.spec.js +18 -10
  49. package/build/esm/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +2 -0
  50. package/build/esm/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +2 -0
  51. package/build/esm/src/utils/__tests__/orderTransactions/swapOrders.spec.js +1 -0
  52. package/build/esm/src/utils/__tests__/prices.spec.js +3 -2
  53. package/build/esm/src/utils/__tests__/uiFeeReceiver.spec.js +9 -0
  54. package/build/esm/src/utils/errors/transactionsErrors.js +2 -1
  55. package/build/esm/src/utils/fees/executionFee.js +11 -3
  56. package/build/esm/src/utils/numbers.js +50 -31
  57. package/build/esm/src/utils/orderTransactions.js +3 -0
  58. package/build/esm/src/utils/orders.js +8 -2
  59. package/build/esm/src/utils/prices.js +1 -1
  60. package/build/esm/src/utils/swap/swapValues.js +41 -1
  61. package/build/esm/src/utils/tokens.js +7 -0
  62. package/build/esm/src/utils/twap/uiFeeReceiver.js +24 -5
  63. package/build/types/src/configs/chains.d.ts +20 -37
  64. package/build/types/src/configs/contracts.d.ts +60 -63
  65. package/build/types/src/configs/dataStore.d.ts +1 -0
  66. package/build/types/src/configs/markets.d.ts +2 -1
  67. package/build/types/src/configs/oracleKeeper.d.ts +1 -1
  68. package/build/types/src/configs/tokens.d.ts +1 -0
  69. package/build/types/src/index.d.ts +1 -1
  70. package/build/types/src/modules/base.d.ts +1 -1
  71. package/build/types/src/modules/orders/helpers.d.ts +10 -2
  72. package/build/types/src/modules/orders/orders.d.ts +10 -1
  73. package/build/types/src/types/orders.d.ts +1 -1
  74. package/build/types/src/types/sdk.d.ts +2 -1
  75. package/build/types/src/types/subsquid.d.ts +388 -0
  76. package/build/types/src/types/tokens.d.ts +1 -0
  77. package/build/types/src/types/trade.d.ts +1 -0
  78. package/build/types/src/utils/multicall.d.ts +1 -1
  79. package/build/types/src/utils/numbers.d.ts +8 -3
  80. package/build/types/src/utils/orderTransactions.d.ts +2 -3
  81. package/build/types/src/utils/prices.d.ts +1 -1
  82. package/build/types/src/utils/tokens.d.ts +2 -0
  83. package/build/types/src/utils/twap/uiFeeReceiver.d.ts +13 -0
  84. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
1
  import type { GasLimitsConfig } from "../../types/fees";
2
2
  import { MarketsInfoData } from "../../types/markets";
3
3
  import { TokensData } from "../../types/tokens";
4
- import { SwapAmounts } from "../../types/trade";
5
4
  import type { GmxSdk } from "../..";
6
5
  /** Base Optional params for helpers, allows to avoid calling markets, tokens and uiFeeFactor methods if they are already passed */
7
6
  interface BaseOptionalParams {
@@ -46,5 +45,14 @@ export type SwapParams = ({
46
45
  /** If presented, then it's limit swap order */
47
46
  triggerPrice?: bigint;
48
47
  } & BaseOptionalParams;
49
- export declare function swap(sdk: GmxSdk, params: SwapParams): Promise<void | SwapAmounts>;
48
+ export declare function swap(sdk: GmxSdk, params: SwapParams): Promise<void | {
49
+ amountIn: bigint;
50
+ usdIn: bigint;
51
+ amountOut: bigint;
52
+ usdOut: bigint;
53
+ swapPathStats: undefined;
54
+ priceIn: bigint;
55
+ priceOut: bigint;
56
+ minOutputAmount: bigint;
57
+ }>;
50
58
  export {};
@@ -64,5 +64,14 @@ export declare class Orders extends Module {
64
64
  createWrapOrUnwrapOrder(p: WrapOrUnwrapParams): Promise<`0x${string}`>;
65
65
  long(params: PositionIncreaseParams): Promise<void>;
66
66
  short(params: PositionIncreaseParams): Promise<void>;
67
- swap(params: SwapParams): Promise<void | SwapAmounts>;
67
+ swap(params: SwapParams): Promise<void | {
68
+ amountIn: bigint;
69
+ usdIn: bigint;
70
+ amountOut: bigint;
71
+ usdOut: bigint;
72
+ swapPathStats: undefined;
73
+ priceIn: bigint;
74
+ priceOut: bigint;
75
+ minOutputAmount: bigint;
76
+ }>;
68
77
  }
@@ -70,7 +70,7 @@ export type PositionOrderInfo = Order & {
70
70
  targetCollateralToken: TokenData;
71
71
  acceptablePrice: bigint;
72
72
  triggerPrice: bigint;
73
- triggerThresholdType: TriggerThresholdType;
73
+ triggerThresholdType: TriggerThresholdType | undefined;
74
74
  };
75
75
  export type TwapOrderInfo<T extends PositionOrderInfo | SwapOrderInfo = PositionOrderInfo | SwapOrderInfo> = Omit<T, "isTwap"> & {
76
76
  isSwap: T extends SwapOrderInfo ? true : false;
@@ -1,9 +1,10 @@
1
1
  import type { PublicClient, WalletClient } from "viem";
2
+ import { UiContractsChain } from "../configs/chains";
2
3
  import type { MarketSdkConfig } from "./markets";
3
4
  import type { Token } from "./tokens";
4
5
  export interface GmxSdkConfig {
5
6
  /** Chain ID */
6
- chainId: number;
7
+ chainId: UiContractsChain;
7
8
  /** Account's address */
8
9
  account?: string;
9
10
  /** GMX Oracle URL */
@@ -1144,6 +1144,208 @@ export interface CollectedFeesInfosConnection {
1144
1144
  pageInfo: PageInfo;
1145
1145
  totalCount: Scalars['Int']['output'];
1146
1146
  }
1147
+ export interface CumulativePnl {
1148
+ __typename?: 'CumulativePnl';
1149
+ address: Scalars['String']['output'];
1150
+ cumulativeRealizedPnlLong: Scalars['BigInt']['output'];
1151
+ cumulativeRealizedPnlShort: Scalars['BigInt']['output'];
1152
+ cumulativeUnrealizedPnlLong: Scalars['BigInt']['output'];
1153
+ cumulativeUnrealizedPnlShort: Scalars['BigInt']['output'];
1154
+ entityType: EntityType;
1155
+ id: Scalars['String']['output'];
1156
+ isSnapshot: Scalars['Boolean']['output'];
1157
+ lastUnrealizedPnlLong?: Maybe<Scalars['BigInt']['output']>;
1158
+ lastUnrealizedPnlShort?: Maybe<Scalars['BigInt']['output']>;
1159
+ snapshotTimestamp?: Maybe<Scalars['Int']['output']>;
1160
+ }
1161
+ export interface CumulativePnlEdge {
1162
+ __typename?: 'CumulativePnlEdge';
1163
+ cursor: Scalars['String']['output'];
1164
+ node: CumulativePnl;
1165
+ }
1166
+ export declare enum CumulativePnlOrderByInput {
1167
+ address_ASC = "address_ASC",
1168
+ address_ASC_NULLS_FIRST = "address_ASC_NULLS_FIRST",
1169
+ address_ASC_NULLS_LAST = "address_ASC_NULLS_LAST",
1170
+ address_DESC = "address_DESC",
1171
+ address_DESC_NULLS_FIRST = "address_DESC_NULLS_FIRST",
1172
+ address_DESC_NULLS_LAST = "address_DESC_NULLS_LAST",
1173
+ cumulativeRealizedPnlLong_ASC = "cumulativeRealizedPnlLong_ASC",
1174
+ cumulativeRealizedPnlLong_ASC_NULLS_FIRST = "cumulativeRealizedPnlLong_ASC_NULLS_FIRST",
1175
+ cumulativeRealizedPnlLong_ASC_NULLS_LAST = "cumulativeRealizedPnlLong_ASC_NULLS_LAST",
1176
+ cumulativeRealizedPnlLong_DESC = "cumulativeRealizedPnlLong_DESC",
1177
+ cumulativeRealizedPnlLong_DESC_NULLS_FIRST = "cumulativeRealizedPnlLong_DESC_NULLS_FIRST",
1178
+ cumulativeRealizedPnlLong_DESC_NULLS_LAST = "cumulativeRealizedPnlLong_DESC_NULLS_LAST",
1179
+ cumulativeRealizedPnlShort_ASC = "cumulativeRealizedPnlShort_ASC",
1180
+ cumulativeRealizedPnlShort_ASC_NULLS_FIRST = "cumulativeRealizedPnlShort_ASC_NULLS_FIRST",
1181
+ cumulativeRealizedPnlShort_ASC_NULLS_LAST = "cumulativeRealizedPnlShort_ASC_NULLS_LAST",
1182
+ cumulativeRealizedPnlShort_DESC = "cumulativeRealizedPnlShort_DESC",
1183
+ cumulativeRealizedPnlShort_DESC_NULLS_FIRST = "cumulativeRealizedPnlShort_DESC_NULLS_FIRST",
1184
+ cumulativeRealizedPnlShort_DESC_NULLS_LAST = "cumulativeRealizedPnlShort_DESC_NULLS_LAST",
1185
+ cumulativeUnrealizedPnlLong_ASC = "cumulativeUnrealizedPnlLong_ASC",
1186
+ cumulativeUnrealizedPnlLong_ASC_NULLS_FIRST = "cumulativeUnrealizedPnlLong_ASC_NULLS_FIRST",
1187
+ cumulativeUnrealizedPnlLong_ASC_NULLS_LAST = "cumulativeUnrealizedPnlLong_ASC_NULLS_LAST",
1188
+ cumulativeUnrealizedPnlLong_DESC = "cumulativeUnrealizedPnlLong_DESC",
1189
+ cumulativeUnrealizedPnlLong_DESC_NULLS_FIRST = "cumulativeUnrealizedPnlLong_DESC_NULLS_FIRST",
1190
+ cumulativeUnrealizedPnlLong_DESC_NULLS_LAST = "cumulativeUnrealizedPnlLong_DESC_NULLS_LAST",
1191
+ cumulativeUnrealizedPnlShort_ASC = "cumulativeUnrealizedPnlShort_ASC",
1192
+ cumulativeUnrealizedPnlShort_ASC_NULLS_FIRST = "cumulativeUnrealizedPnlShort_ASC_NULLS_FIRST",
1193
+ cumulativeUnrealizedPnlShort_ASC_NULLS_LAST = "cumulativeUnrealizedPnlShort_ASC_NULLS_LAST",
1194
+ cumulativeUnrealizedPnlShort_DESC = "cumulativeUnrealizedPnlShort_DESC",
1195
+ cumulativeUnrealizedPnlShort_DESC_NULLS_FIRST = "cumulativeUnrealizedPnlShort_DESC_NULLS_FIRST",
1196
+ cumulativeUnrealizedPnlShort_DESC_NULLS_LAST = "cumulativeUnrealizedPnlShort_DESC_NULLS_LAST",
1197
+ entityType_ASC = "entityType_ASC",
1198
+ entityType_ASC_NULLS_FIRST = "entityType_ASC_NULLS_FIRST",
1199
+ entityType_ASC_NULLS_LAST = "entityType_ASC_NULLS_LAST",
1200
+ entityType_DESC = "entityType_DESC",
1201
+ entityType_DESC_NULLS_FIRST = "entityType_DESC_NULLS_FIRST",
1202
+ entityType_DESC_NULLS_LAST = "entityType_DESC_NULLS_LAST",
1203
+ id_ASC = "id_ASC",
1204
+ id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST",
1205
+ id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST",
1206
+ id_DESC = "id_DESC",
1207
+ id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST",
1208
+ id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST",
1209
+ isSnapshot_ASC = "isSnapshot_ASC",
1210
+ isSnapshot_ASC_NULLS_FIRST = "isSnapshot_ASC_NULLS_FIRST",
1211
+ isSnapshot_ASC_NULLS_LAST = "isSnapshot_ASC_NULLS_LAST",
1212
+ isSnapshot_DESC = "isSnapshot_DESC",
1213
+ isSnapshot_DESC_NULLS_FIRST = "isSnapshot_DESC_NULLS_FIRST",
1214
+ isSnapshot_DESC_NULLS_LAST = "isSnapshot_DESC_NULLS_LAST",
1215
+ lastUnrealizedPnlLong_ASC = "lastUnrealizedPnlLong_ASC",
1216
+ lastUnrealizedPnlLong_ASC_NULLS_FIRST = "lastUnrealizedPnlLong_ASC_NULLS_FIRST",
1217
+ lastUnrealizedPnlLong_ASC_NULLS_LAST = "lastUnrealizedPnlLong_ASC_NULLS_LAST",
1218
+ lastUnrealizedPnlLong_DESC = "lastUnrealizedPnlLong_DESC",
1219
+ lastUnrealizedPnlLong_DESC_NULLS_FIRST = "lastUnrealizedPnlLong_DESC_NULLS_FIRST",
1220
+ lastUnrealizedPnlLong_DESC_NULLS_LAST = "lastUnrealizedPnlLong_DESC_NULLS_LAST",
1221
+ lastUnrealizedPnlShort_ASC = "lastUnrealizedPnlShort_ASC",
1222
+ lastUnrealizedPnlShort_ASC_NULLS_FIRST = "lastUnrealizedPnlShort_ASC_NULLS_FIRST",
1223
+ lastUnrealizedPnlShort_ASC_NULLS_LAST = "lastUnrealizedPnlShort_ASC_NULLS_LAST",
1224
+ lastUnrealizedPnlShort_DESC = "lastUnrealizedPnlShort_DESC",
1225
+ lastUnrealizedPnlShort_DESC_NULLS_FIRST = "lastUnrealizedPnlShort_DESC_NULLS_FIRST",
1226
+ lastUnrealizedPnlShort_DESC_NULLS_LAST = "lastUnrealizedPnlShort_DESC_NULLS_LAST",
1227
+ snapshotTimestamp_ASC = "snapshotTimestamp_ASC",
1228
+ snapshotTimestamp_ASC_NULLS_FIRST = "snapshotTimestamp_ASC_NULLS_FIRST",
1229
+ snapshotTimestamp_ASC_NULLS_LAST = "snapshotTimestamp_ASC_NULLS_LAST",
1230
+ snapshotTimestamp_DESC = "snapshotTimestamp_DESC",
1231
+ snapshotTimestamp_DESC_NULLS_FIRST = "snapshotTimestamp_DESC_NULLS_FIRST",
1232
+ snapshotTimestamp_DESC_NULLS_LAST = "snapshotTimestamp_DESC_NULLS_LAST"
1233
+ }
1234
+ export interface CumulativePnlWhereInput {
1235
+ AND?: InputMaybe<Array<CumulativePnlWhereInput>>;
1236
+ OR?: InputMaybe<Array<CumulativePnlWhereInput>>;
1237
+ address_contains?: InputMaybe<Scalars['String']['input']>;
1238
+ address_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
1239
+ address_endsWith?: InputMaybe<Scalars['String']['input']>;
1240
+ address_eq?: InputMaybe<Scalars['String']['input']>;
1241
+ address_gt?: InputMaybe<Scalars['String']['input']>;
1242
+ address_gte?: InputMaybe<Scalars['String']['input']>;
1243
+ address_in?: InputMaybe<Array<Scalars['String']['input']>>;
1244
+ address_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1245
+ address_lt?: InputMaybe<Scalars['String']['input']>;
1246
+ address_lte?: InputMaybe<Scalars['String']['input']>;
1247
+ address_not_contains?: InputMaybe<Scalars['String']['input']>;
1248
+ address_not_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
1249
+ address_not_endsWith?: InputMaybe<Scalars['String']['input']>;
1250
+ address_not_eq?: InputMaybe<Scalars['String']['input']>;
1251
+ address_not_in?: InputMaybe<Array<Scalars['String']['input']>>;
1252
+ address_not_startsWith?: InputMaybe<Scalars['String']['input']>;
1253
+ address_startsWith?: InputMaybe<Scalars['String']['input']>;
1254
+ cumulativeRealizedPnlLong_eq?: InputMaybe<Scalars['BigInt']['input']>;
1255
+ cumulativeRealizedPnlLong_gt?: InputMaybe<Scalars['BigInt']['input']>;
1256
+ cumulativeRealizedPnlLong_gte?: InputMaybe<Scalars['BigInt']['input']>;
1257
+ cumulativeRealizedPnlLong_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1258
+ cumulativeRealizedPnlLong_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1259
+ cumulativeRealizedPnlLong_lt?: InputMaybe<Scalars['BigInt']['input']>;
1260
+ cumulativeRealizedPnlLong_lte?: InputMaybe<Scalars['BigInt']['input']>;
1261
+ cumulativeRealizedPnlLong_not_eq?: InputMaybe<Scalars['BigInt']['input']>;
1262
+ cumulativeRealizedPnlLong_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1263
+ cumulativeRealizedPnlShort_eq?: InputMaybe<Scalars['BigInt']['input']>;
1264
+ cumulativeRealizedPnlShort_gt?: InputMaybe<Scalars['BigInt']['input']>;
1265
+ cumulativeRealizedPnlShort_gte?: InputMaybe<Scalars['BigInt']['input']>;
1266
+ cumulativeRealizedPnlShort_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1267
+ cumulativeRealizedPnlShort_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1268
+ cumulativeRealizedPnlShort_lt?: InputMaybe<Scalars['BigInt']['input']>;
1269
+ cumulativeRealizedPnlShort_lte?: InputMaybe<Scalars['BigInt']['input']>;
1270
+ cumulativeRealizedPnlShort_not_eq?: InputMaybe<Scalars['BigInt']['input']>;
1271
+ cumulativeRealizedPnlShort_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1272
+ cumulativeUnrealizedPnlLong_eq?: InputMaybe<Scalars['BigInt']['input']>;
1273
+ cumulativeUnrealizedPnlLong_gt?: InputMaybe<Scalars['BigInt']['input']>;
1274
+ cumulativeUnrealizedPnlLong_gte?: InputMaybe<Scalars['BigInt']['input']>;
1275
+ cumulativeUnrealizedPnlLong_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1276
+ cumulativeUnrealizedPnlLong_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1277
+ cumulativeUnrealizedPnlLong_lt?: InputMaybe<Scalars['BigInt']['input']>;
1278
+ cumulativeUnrealizedPnlLong_lte?: InputMaybe<Scalars['BigInt']['input']>;
1279
+ cumulativeUnrealizedPnlLong_not_eq?: InputMaybe<Scalars['BigInt']['input']>;
1280
+ cumulativeUnrealizedPnlLong_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1281
+ cumulativeUnrealizedPnlShort_eq?: InputMaybe<Scalars['BigInt']['input']>;
1282
+ cumulativeUnrealizedPnlShort_gt?: InputMaybe<Scalars['BigInt']['input']>;
1283
+ cumulativeUnrealizedPnlShort_gte?: InputMaybe<Scalars['BigInt']['input']>;
1284
+ cumulativeUnrealizedPnlShort_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1285
+ cumulativeUnrealizedPnlShort_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1286
+ cumulativeUnrealizedPnlShort_lt?: InputMaybe<Scalars['BigInt']['input']>;
1287
+ cumulativeUnrealizedPnlShort_lte?: InputMaybe<Scalars['BigInt']['input']>;
1288
+ cumulativeUnrealizedPnlShort_not_eq?: InputMaybe<Scalars['BigInt']['input']>;
1289
+ cumulativeUnrealizedPnlShort_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1290
+ entityType_eq?: InputMaybe<EntityType>;
1291
+ entityType_in?: InputMaybe<Array<EntityType>>;
1292
+ entityType_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1293
+ entityType_not_eq?: InputMaybe<EntityType>;
1294
+ entityType_not_in?: InputMaybe<Array<EntityType>>;
1295
+ id_contains?: InputMaybe<Scalars['String']['input']>;
1296
+ id_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
1297
+ id_endsWith?: InputMaybe<Scalars['String']['input']>;
1298
+ id_eq?: InputMaybe<Scalars['String']['input']>;
1299
+ id_gt?: InputMaybe<Scalars['String']['input']>;
1300
+ id_gte?: InputMaybe<Scalars['String']['input']>;
1301
+ id_in?: InputMaybe<Array<Scalars['String']['input']>>;
1302
+ id_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1303
+ id_lt?: InputMaybe<Scalars['String']['input']>;
1304
+ id_lte?: InputMaybe<Scalars['String']['input']>;
1305
+ id_not_contains?: InputMaybe<Scalars['String']['input']>;
1306
+ id_not_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
1307
+ id_not_endsWith?: InputMaybe<Scalars['String']['input']>;
1308
+ id_not_eq?: InputMaybe<Scalars['String']['input']>;
1309
+ id_not_in?: InputMaybe<Array<Scalars['String']['input']>>;
1310
+ id_not_startsWith?: InputMaybe<Scalars['String']['input']>;
1311
+ id_startsWith?: InputMaybe<Scalars['String']['input']>;
1312
+ isSnapshot_eq?: InputMaybe<Scalars['Boolean']['input']>;
1313
+ isSnapshot_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1314
+ isSnapshot_not_eq?: InputMaybe<Scalars['Boolean']['input']>;
1315
+ lastUnrealizedPnlLong_eq?: InputMaybe<Scalars['BigInt']['input']>;
1316
+ lastUnrealizedPnlLong_gt?: InputMaybe<Scalars['BigInt']['input']>;
1317
+ lastUnrealizedPnlLong_gte?: InputMaybe<Scalars['BigInt']['input']>;
1318
+ lastUnrealizedPnlLong_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1319
+ lastUnrealizedPnlLong_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1320
+ lastUnrealizedPnlLong_lt?: InputMaybe<Scalars['BigInt']['input']>;
1321
+ lastUnrealizedPnlLong_lte?: InputMaybe<Scalars['BigInt']['input']>;
1322
+ lastUnrealizedPnlLong_not_eq?: InputMaybe<Scalars['BigInt']['input']>;
1323
+ lastUnrealizedPnlLong_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1324
+ lastUnrealizedPnlShort_eq?: InputMaybe<Scalars['BigInt']['input']>;
1325
+ lastUnrealizedPnlShort_gt?: InputMaybe<Scalars['BigInt']['input']>;
1326
+ lastUnrealizedPnlShort_gte?: InputMaybe<Scalars['BigInt']['input']>;
1327
+ lastUnrealizedPnlShort_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1328
+ lastUnrealizedPnlShort_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1329
+ lastUnrealizedPnlShort_lt?: InputMaybe<Scalars['BigInt']['input']>;
1330
+ lastUnrealizedPnlShort_lte?: InputMaybe<Scalars['BigInt']['input']>;
1331
+ lastUnrealizedPnlShort_not_eq?: InputMaybe<Scalars['BigInt']['input']>;
1332
+ lastUnrealizedPnlShort_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
1333
+ snapshotTimestamp_eq?: InputMaybe<Scalars['Int']['input']>;
1334
+ snapshotTimestamp_gt?: InputMaybe<Scalars['Int']['input']>;
1335
+ snapshotTimestamp_gte?: InputMaybe<Scalars['Int']['input']>;
1336
+ snapshotTimestamp_in?: InputMaybe<Array<Scalars['Int']['input']>>;
1337
+ snapshotTimestamp_isNull?: InputMaybe<Scalars['Boolean']['input']>;
1338
+ snapshotTimestamp_lt?: InputMaybe<Scalars['Int']['input']>;
1339
+ snapshotTimestamp_lte?: InputMaybe<Scalars['Int']['input']>;
1340
+ snapshotTimestamp_not_eq?: InputMaybe<Scalars['Int']['input']>;
1341
+ snapshotTimestamp_not_in?: InputMaybe<Array<Scalars['Int']['input']>>;
1342
+ }
1343
+ export interface CumulativePnlsConnection {
1344
+ __typename?: 'CumulativePnlsConnection';
1345
+ edges: Array<CumulativePnlEdge>;
1346
+ pageInfo: PageInfo;
1347
+ totalCount: Scalars['Int']['output'];
1348
+ }
1147
1349
  export interface CumulativePoolValue {
1148
1350
  __typename?: 'CumulativePoolValue';
1149
1351
  address: Scalars['String']['output'];
@@ -1376,6 +1578,21 @@ export declare enum GlvOrderByInput {
1376
1578
  shortTokenAddress_DESC_NULLS_FIRST = "shortTokenAddress_DESC_NULLS_FIRST",
1377
1579
  shortTokenAddress_DESC_NULLS_LAST = "shortTokenAddress_DESC_NULLS_LAST"
1378
1580
  }
1581
+ export interface GlvPnlApr {
1582
+ __typename?: 'GlvPnlApr';
1583
+ apr: Scalars['BigInt']['output'];
1584
+ glvAddress: Scalars['String']['output'];
1585
+ periodRealizedPnlLong: Scalars['BigInt']['output'];
1586
+ periodRealizedPnlShort: Scalars['BigInt']['output'];
1587
+ periodUnrealizedPnlLong: Scalars['BigInt']['output'];
1588
+ periodUnrealizedPnlShort: Scalars['BigInt']['output'];
1589
+ timeWeightedPoolValue: Scalars['BigInt']['output'];
1590
+ }
1591
+ export interface GlvPnlAprsWhereInputWhereInput {
1592
+ glvAddresses?: InputMaybe<Array<Scalars['String']['input']>>;
1593
+ periodEnd: Scalars['Float']['input'];
1594
+ periodStart: Scalars['Float']['input'];
1595
+ }
1379
1596
  export interface GlvWhereInput {
1380
1597
  AND?: InputMaybe<Array<GlvWhereInput>>;
1381
1598
  OR?: InputMaybe<Array<GlvWhereInput>>;
@@ -3024,6 +3241,21 @@ export declare enum MarketOrderByInput {
3024
3241
  shortToken_DESC_NULLS_FIRST = "shortToken_DESC_NULLS_FIRST",
3025
3242
  shortToken_DESC_NULLS_LAST = "shortToken_DESC_NULLS_LAST"
3026
3243
  }
3244
+ export interface MarketPnlApr {
3245
+ __typename?: 'MarketPnlApr';
3246
+ apr: Scalars['BigInt']['output'];
3247
+ marketAddress: Scalars['String']['output'];
3248
+ periodRealizedPnlLong: Scalars['BigInt']['output'];
3249
+ periodRealizedPnlShort: Scalars['BigInt']['output'];
3250
+ periodUnrealizedPnlLong: Scalars['BigInt']['output'];
3251
+ periodUnrealizedPnlShort: Scalars['BigInt']['output'];
3252
+ timeWeightedPoolValue: Scalars['BigInt']['output'];
3253
+ }
3254
+ export interface MarketPnlAprsWhereInput {
3255
+ marketAddresses?: InputMaybe<Array<Scalars['String']['input']>>;
3256
+ periodEnd: Scalars['Float']['input'];
3257
+ periodStart: Scalars['Float']['input'];
3258
+ }
3027
3259
  export interface MarketWhereInput {
3028
3260
  AND?: InputMaybe<Array<MarketWhereInput>>;
3029
3261
  OR?: InputMaybe<Array<MarketWhereInput>>;
@@ -3884,6 +4116,118 @@ export interface PeriodAccountStatObject {
3884
4116
  volume: Scalars['BigInt']['output'];
3885
4117
  wins: Scalars['Float']['output'];
3886
4118
  }
4119
+ export interface PnlAprSnapshot {
4120
+ __typename?: 'PnlAprSnapshot';
4121
+ address: Scalars['String']['output'];
4122
+ apr: Scalars['BigInt']['output'];
4123
+ entityType: EntityType;
4124
+ id: Scalars['String']['output'];
4125
+ snapshotTimestamp: Scalars['Int']['output'];
4126
+ }
4127
+ export interface PnlAprSnapshotEdge {
4128
+ __typename?: 'PnlAprSnapshotEdge';
4129
+ cursor: Scalars['String']['output'];
4130
+ node: PnlAprSnapshot;
4131
+ }
4132
+ export declare enum PnlAprSnapshotOrderByInput {
4133
+ address_ASC = "address_ASC",
4134
+ address_ASC_NULLS_FIRST = "address_ASC_NULLS_FIRST",
4135
+ address_ASC_NULLS_LAST = "address_ASC_NULLS_LAST",
4136
+ address_DESC = "address_DESC",
4137
+ address_DESC_NULLS_FIRST = "address_DESC_NULLS_FIRST",
4138
+ address_DESC_NULLS_LAST = "address_DESC_NULLS_LAST",
4139
+ apr_ASC = "apr_ASC",
4140
+ apr_ASC_NULLS_FIRST = "apr_ASC_NULLS_FIRST",
4141
+ apr_ASC_NULLS_LAST = "apr_ASC_NULLS_LAST",
4142
+ apr_DESC = "apr_DESC",
4143
+ apr_DESC_NULLS_FIRST = "apr_DESC_NULLS_FIRST",
4144
+ apr_DESC_NULLS_LAST = "apr_DESC_NULLS_LAST",
4145
+ entityType_ASC = "entityType_ASC",
4146
+ entityType_ASC_NULLS_FIRST = "entityType_ASC_NULLS_FIRST",
4147
+ entityType_ASC_NULLS_LAST = "entityType_ASC_NULLS_LAST",
4148
+ entityType_DESC = "entityType_DESC",
4149
+ entityType_DESC_NULLS_FIRST = "entityType_DESC_NULLS_FIRST",
4150
+ entityType_DESC_NULLS_LAST = "entityType_DESC_NULLS_LAST",
4151
+ id_ASC = "id_ASC",
4152
+ id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST",
4153
+ id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST",
4154
+ id_DESC = "id_DESC",
4155
+ id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST",
4156
+ id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST",
4157
+ snapshotTimestamp_ASC = "snapshotTimestamp_ASC",
4158
+ snapshotTimestamp_ASC_NULLS_FIRST = "snapshotTimestamp_ASC_NULLS_FIRST",
4159
+ snapshotTimestamp_ASC_NULLS_LAST = "snapshotTimestamp_ASC_NULLS_LAST",
4160
+ snapshotTimestamp_DESC = "snapshotTimestamp_DESC",
4161
+ snapshotTimestamp_DESC_NULLS_FIRST = "snapshotTimestamp_DESC_NULLS_FIRST",
4162
+ snapshotTimestamp_DESC_NULLS_LAST = "snapshotTimestamp_DESC_NULLS_LAST"
4163
+ }
4164
+ export interface PnlAprSnapshotWhereInput {
4165
+ AND?: InputMaybe<Array<PnlAprSnapshotWhereInput>>;
4166
+ OR?: InputMaybe<Array<PnlAprSnapshotWhereInput>>;
4167
+ address_contains?: InputMaybe<Scalars['String']['input']>;
4168
+ address_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
4169
+ address_endsWith?: InputMaybe<Scalars['String']['input']>;
4170
+ address_eq?: InputMaybe<Scalars['String']['input']>;
4171
+ address_gt?: InputMaybe<Scalars['String']['input']>;
4172
+ address_gte?: InputMaybe<Scalars['String']['input']>;
4173
+ address_in?: InputMaybe<Array<Scalars['String']['input']>>;
4174
+ address_isNull?: InputMaybe<Scalars['Boolean']['input']>;
4175
+ address_lt?: InputMaybe<Scalars['String']['input']>;
4176
+ address_lte?: InputMaybe<Scalars['String']['input']>;
4177
+ address_not_contains?: InputMaybe<Scalars['String']['input']>;
4178
+ address_not_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
4179
+ address_not_endsWith?: InputMaybe<Scalars['String']['input']>;
4180
+ address_not_eq?: InputMaybe<Scalars['String']['input']>;
4181
+ address_not_in?: InputMaybe<Array<Scalars['String']['input']>>;
4182
+ address_not_startsWith?: InputMaybe<Scalars['String']['input']>;
4183
+ address_startsWith?: InputMaybe<Scalars['String']['input']>;
4184
+ apr_eq?: InputMaybe<Scalars['BigInt']['input']>;
4185
+ apr_gt?: InputMaybe<Scalars['BigInt']['input']>;
4186
+ apr_gte?: InputMaybe<Scalars['BigInt']['input']>;
4187
+ apr_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
4188
+ apr_isNull?: InputMaybe<Scalars['Boolean']['input']>;
4189
+ apr_lt?: InputMaybe<Scalars['BigInt']['input']>;
4190
+ apr_lte?: InputMaybe<Scalars['BigInt']['input']>;
4191
+ apr_not_eq?: InputMaybe<Scalars['BigInt']['input']>;
4192
+ apr_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
4193
+ entityType_eq?: InputMaybe<EntityType>;
4194
+ entityType_in?: InputMaybe<Array<EntityType>>;
4195
+ entityType_isNull?: InputMaybe<Scalars['Boolean']['input']>;
4196
+ entityType_not_eq?: InputMaybe<EntityType>;
4197
+ entityType_not_in?: InputMaybe<Array<EntityType>>;
4198
+ id_contains?: InputMaybe<Scalars['String']['input']>;
4199
+ id_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
4200
+ id_endsWith?: InputMaybe<Scalars['String']['input']>;
4201
+ id_eq?: InputMaybe<Scalars['String']['input']>;
4202
+ id_gt?: InputMaybe<Scalars['String']['input']>;
4203
+ id_gte?: InputMaybe<Scalars['String']['input']>;
4204
+ id_in?: InputMaybe<Array<Scalars['String']['input']>>;
4205
+ id_isNull?: InputMaybe<Scalars['Boolean']['input']>;
4206
+ id_lt?: InputMaybe<Scalars['String']['input']>;
4207
+ id_lte?: InputMaybe<Scalars['String']['input']>;
4208
+ id_not_contains?: InputMaybe<Scalars['String']['input']>;
4209
+ id_not_containsInsensitive?: InputMaybe<Scalars['String']['input']>;
4210
+ id_not_endsWith?: InputMaybe<Scalars['String']['input']>;
4211
+ id_not_eq?: InputMaybe<Scalars['String']['input']>;
4212
+ id_not_in?: InputMaybe<Array<Scalars['String']['input']>>;
4213
+ id_not_startsWith?: InputMaybe<Scalars['String']['input']>;
4214
+ id_startsWith?: InputMaybe<Scalars['String']['input']>;
4215
+ snapshotTimestamp_eq?: InputMaybe<Scalars['Int']['input']>;
4216
+ snapshotTimestamp_gt?: InputMaybe<Scalars['Int']['input']>;
4217
+ snapshotTimestamp_gte?: InputMaybe<Scalars['Int']['input']>;
4218
+ snapshotTimestamp_in?: InputMaybe<Array<Scalars['Int']['input']>>;
4219
+ snapshotTimestamp_isNull?: InputMaybe<Scalars['Boolean']['input']>;
4220
+ snapshotTimestamp_lt?: InputMaybe<Scalars['Int']['input']>;
4221
+ snapshotTimestamp_lte?: InputMaybe<Scalars['Int']['input']>;
4222
+ snapshotTimestamp_not_eq?: InputMaybe<Scalars['Int']['input']>;
4223
+ snapshotTimestamp_not_in?: InputMaybe<Array<Scalars['Int']['input']>>;
4224
+ }
4225
+ export interface PnlAprSnapshotsConnection {
4226
+ __typename?: 'PnlAprSnapshotsConnection';
4227
+ edges: Array<PnlAprSnapshotEdge>;
4228
+ pageInfo: PageInfo;
4229
+ totalCount: Scalars['Int']['output'];
4230
+ }
3887
4231
  export interface Position {
3888
4232
  __typename?: 'Position';
3889
4233
  account: Scalars['String']['output'];
@@ -5339,6 +5683,9 @@ export interface Query {
5339
5683
  collectedFeesInfoById?: Maybe<CollectedFeesInfo>;
5340
5684
  collectedFeesInfos: Array<CollectedFeesInfo>;
5341
5685
  collectedFeesInfosConnection: CollectedFeesInfosConnection;
5686
+ cumulativePnlById?: Maybe<CumulativePnl>;
5687
+ cumulativePnls: Array<CumulativePnl>;
5688
+ cumulativePnlsConnection: CumulativePnlsConnection;
5342
5689
  cumulativePoolValueById?: Maybe<CumulativePoolValue>;
5343
5690
  cumulativePoolValues: Array<CumulativePoolValue>;
5344
5691
  cumulativePoolValuesConnection: CumulativePoolValuesConnection;
@@ -5346,6 +5693,7 @@ export interface Query {
5346
5693
  glvs: Array<Glv>;
5347
5694
  glvsAprByPeriod: Array<GlvApr>;
5348
5695
  glvsConnection: GlvsConnection;
5696
+ glvsPnlAprByPeriod: Array<GlvPnlApr>;
5349
5697
  marketById?: Maybe<Market>;
5350
5698
  marketInfoById?: Maybe<MarketInfo>;
5351
5699
  marketInfos: Array<MarketInfo>;
@@ -5353,6 +5701,7 @@ export interface Query {
5353
5701
  markets: Array<Market>;
5354
5702
  marketsAprByPeriod: Array<MarketApr>;
5355
5703
  marketsConnection: MarketsConnection;
5704
+ marketsPnlAprByPeriod: Array<MarketPnlApr>;
5356
5705
  onChainSettingById?: Maybe<OnChainSetting>;
5357
5706
  onChainSettings: Array<OnChainSetting>;
5358
5707
  onChainSettingsConnection: OnChainSettingsConnection;
@@ -5360,6 +5709,9 @@ export interface Query {
5360
5709
  orders: Array<Order>;
5361
5710
  ordersConnection: OrdersConnection;
5362
5711
  periodAccountStats: Array<PeriodAccountStatObject>;
5712
+ pnlAprSnapshotById?: Maybe<PnlAprSnapshot>;
5713
+ pnlAprSnapshots: Array<PnlAprSnapshot>;
5714
+ pnlAprSnapshotsConnection: PnlAprSnapshotsConnection;
5363
5715
  positionById?: Maybe<Position>;
5364
5716
  positionChangeById?: Maybe<PositionChange>;
5365
5717
  positionChanges: Array<PositionChange>;
@@ -5499,6 +5851,21 @@ export interface QuerycollectedFeesInfosConnectionArgs {
5499
5851
  orderBy: Array<CollectedFeesInfoOrderByInput>;
5500
5852
  where?: InputMaybe<CollectedFeesInfoWhereInput>;
5501
5853
  }
5854
+ export interface QuerycumulativePnlByIdArgs {
5855
+ id: Scalars['String']['input'];
5856
+ }
5857
+ export interface QuerycumulativePnlsArgs {
5858
+ limit?: InputMaybe<Scalars['Int']['input']>;
5859
+ offset?: InputMaybe<Scalars['Int']['input']>;
5860
+ orderBy?: InputMaybe<Array<CumulativePnlOrderByInput>>;
5861
+ where?: InputMaybe<CumulativePnlWhereInput>;
5862
+ }
5863
+ export interface QuerycumulativePnlsConnectionArgs {
5864
+ after?: InputMaybe<Scalars['String']['input']>;
5865
+ first?: InputMaybe<Scalars['Int']['input']>;
5866
+ orderBy: Array<CumulativePnlOrderByInput>;
5867
+ where?: InputMaybe<CumulativePnlWhereInput>;
5868
+ }
5502
5869
  export interface QuerycumulativePoolValueByIdArgs {
5503
5870
  id: Scalars['String']['input'];
5504
5871
  }
@@ -5532,6 +5899,9 @@ export interface QueryglvsConnectionArgs {
5532
5899
  orderBy: Array<GlvOrderByInput>;
5533
5900
  where?: InputMaybe<GlvWhereInput>;
5534
5901
  }
5902
+ export interface QueryglvsPnlAprByPeriodArgs {
5903
+ where?: InputMaybe<GlvPnlAprsWhereInputWhereInput>;
5904
+ }
5535
5905
  export interface QuerymarketByIdArgs {
5536
5906
  id: Scalars['String']['input'];
5537
5907
  }
@@ -5565,6 +5935,9 @@ export interface QuerymarketsConnectionArgs {
5565
5935
  orderBy: Array<MarketOrderByInput>;
5566
5936
  where?: InputMaybe<MarketWhereInput>;
5567
5937
  }
5938
+ export interface QuerymarketsPnlAprByPeriodArgs {
5939
+ where?: InputMaybe<MarketPnlAprsWhereInput>;
5940
+ }
5568
5941
  export interface QueryonChainSettingByIdArgs {
5569
5942
  id: Scalars['String']['input'];
5570
5943
  }
@@ -5600,6 +5973,21 @@ export interface QueryperiodAccountStatsArgs {
5600
5973
  offset?: InputMaybe<Scalars['Float']['input']>;
5601
5974
  where?: InputMaybe<WhereInput>;
5602
5975
  }
5976
+ export interface QuerypnlAprSnapshotByIdArgs {
5977
+ id: Scalars['String']['input'];
5978
+ }
5979
+ export interface QuerypnlAprSnapshotsArgs {
5980
+ limit?: InputMaybe<Scalars['Int']['input']>;
5981
+ offset?: InputMaybe<Scalars['Int']['input']>;
5982
+ orderBy?: InputMaybe<Array<PnlAprSnapshotOrderByInput>>;
5983
+ where?: InputMaybe<PnlAprSnapshotWhereInput>;
5984
+ }
5985
+ export interface QuerypnlAprSnapshotsConnectionArgs {
5986
+ after?: InputMaybe<Scalars['String']['input']>;
5987
+ first?: InputMaybe<Scalars['Int']['input']>;
5988
+ orderBy: Array<PnlAprSnapshotOrderByInput>;
5989
+ where?: InputMaybe<PnlAprSnapshotWhereInput>;
5990
+ }
5603
5991
  export interface QuerypositionByIdArgs {
5604
5992
  id: Scalars['String']['input'];
5605
5993
  }
@@ -45,6 +45,7 @@ export type Token = {
45
45
  isV1Available?: boolean;
46
46
  isPlatformToken?: boolean;
47
47
  isPlatformTradingToken?: boolean;
48
+ isStaking?: boolean;
48
49
  shouldResetAllowance?: boolean;
49
50
  };
50
51
  export type TokenInfo = Token & {
@@ -280,5 +280,6 @@ export type TradeSearchParams = {
280
280
  pool?: string;
281
281
  collateral?: string;
282
282
  market?: string;
283
+ chainId?: string;
283
284
  };
284
285
  export {};
@@ -12,7 +12,7 @@ export declare class Multicall {
12
12
  };
13
13
  static getInstance(sdk: GmxSdk): Promise<Multicall>;
14
14
  constructor(sdk: GmxSdk);
15
- get chainId(): number;
15
+ get chainId(): import("../configs/chains").UiContractsChain;
16
16
  call(request: MulticallRequestConfig<any>, maxTimeout: number): Promise<MulticallResult<any>>;
17
17
  }
18
18
  export type SkipKey = null | undefined | false;
@@ -48,11 +48,13 @@ export declare function formatTokenAmount(amount?: bigint, tokenDecimals?: numbe
48
48
  minThreshold?: string;
49
49
  maxThreshold?: string;
50
50
  displayPlus?: boolean;
51
+ isStable?: boolean;
51
52
  }): string | undefined;
52
53
  export declare function formatTokenAmountWithUsd(tokenAmount?: bigint, usdAmount?: bigint, tokenSymbol?: string, tokenDecimals?: number, opts?: {
53
54
  fallbackToZero?: boolean;
54
55
  displayDecimals?: number;
55
56
  displayPlus?: boolean;
57
+ isStable?: boolean;
56
58
  }): string | undefined;
57
59
  /**
58
60
  *
@@ -65,8 +67,11 @@ export declare function formatRatePercentage(rate?: bigint, opts?: {
65
67
  export declare function formatUsdPrice(price?: bigint, opts?: Parameters<typeof formatUsd>[1]): string | undefined;
66
68
  export declare function formatPercentageDisplay(percentage: number, hideThreshold?: number): string;
67
69
  export declare function formatAmountHuman(amount: BigNumberish | undefined, tokenDecimals: number, showDollar?: boolean, displayDecimals?: number): string;
68
- export declare function formatBalanceAmount(amount: bigint, tokenDecimals: number, tokenSymbol?: string, showZero?: boolean, toExponential?: boolean): string;
69
- export declare function formatBalanceAmountWithUsd(amount: bigint, amountUsd: bigint, tokenDecimals: number, tokenSymbol?: string, showZero?: boolean): string;
70
+ export declare function formatBalanceAmount(amount: bigint, tokenDecimals: number, tokenSymbol?: string, { showZero, toExponential, isStable, }?: {
71
+ showZero?: boolean;
72
+ toExponential?: boolean;
73
+ isStable?: boolean;
74
+ }): string;
70
75
  export declare function formatFactor(factor: bigint): string;
71
76
  export declare function numberWithCommas(x: BigNumberish): string;
72
77
  export declare const formatAmount: (amount: BigNumberish | undefined, tokenDecimals: number, displayDecimals?: number, useCommas?: boolean, defaultValue?: string, visualMultiplier?: number) => string;
@@ -117,7 +122,7 @@ type DeserializeBigIntInObject<T> = {
117
122
  };
118
123
  export declare function serializeBigIntsInObject<T extends object>(obj: T): SerializedBigIntsInObject<T>;
119
124
  export declare function deserializeBigIntsInObject<T extends object>(obj: T): DeserializeBigIntInObject<T>;
120
- export declare function calculateDisplayDecimals(price?: bigint, decimals?: number, visualMultiplier?: number): 5 | 2 | 3 | 4 | 6 | 7 | 8 | 9;
125
+ export declare function calculateDisplayDecimals(price?: bigint, decimals?: number, visualMultiplier?: number, isStable?: boolean): 5 | 2 | 3 | 4 | 6 | 7 | 8 | 9;
121
126
  export declare function clamp(value: number, min: number, max: number): number;
122
127
  export declare function absDiffBps(value: bigint, base: bigint): bigint;
123
128
  export {};
@@ -3,7 +3,7 @@ import { DecreasePositionSwapType, OrderType } from "../types/orders";
3
3
  import { ContractPrice, ERC20Address, TokensData } from "../types/tokens";
4
4
  import { ExternalSwapQuote } from "../types/trade";
5
5
  import { TwapOrderParams } from "../types/twap";
6
- type ExchangeRouterCall = {
6
+ export type ExchangeRouterCall = {
7
7
  method: string;
8
8
  params: any[];
9
9
  };
@@ -131,6 +131,7 @@ export type SwapOrderParams = CommonOrderParams & {
131
131
  swapPath: string[];
132
132
  externalSwapQuote: ExternalSwapQuote | undefined;
133
133
  minOutputAmount: bigint;
134
+ expectedOutputAmount?: bigint;
134
135
  orderType: OrderType.MarketSwap | OrderType.LimitSwap;
135
136
  triggerRatio: bigint | undefined;
136
137
  };
@@ -187,7 +188,6 @@ export declare function buildTokenTransfersParamsForIncreaseOrSwap({ chainId, re
187
188
  externalSwapQuote: ExternalSwapQuote | undefined;
188
189
  minOutputAmount: bigint;
189
190
  swapPath: string[];
190
- orderType: OrderType;
191
191
  }): TokenTransfersParams;
192
192
  export declare function getBatchExternalCalls(batchParams: BatchOrderTxnParams): ExternalCallsPayload;
193
193
  export declare function combineExternalCalls(externalCalls: ExternalCallsPayload[]): ExternalCallsPayload;
@@ -228,4 +228,3 @@ export declare function getBatchSwapsCount(orderParams: BatchOrderTxnParams | un
228
228
  export declare function getIsEmptyBatch(orderParams: BatchOrderTxnParams | undefined): boolean;
229
229
  export declare function getBatchIsNativePayment(orderParams: BatchOrderTxnParams): boolean;
230
230
  export declare function getIsInvalidBatchReceiver(batchParams: BatchOrderTxnParams, signerAddress: string): boolean;
231
- export {};
@@ -8,7 +8,7 @@ export declare function getMarkPrice(p: {
8
8
  isLong: boolean;
9
9
  }): bigint;
10
10
  export declare function getShouldUseMaxPrice(isIncrease: boolean, isLong: boolean): boolean;
11
- export declare function getOrderThresholdType(orderType: OrderType, isLong: boolean): TriggerThresholdType;
11
+ export declare function getOrderThresholdType(orderType: OrderType, isLong: boolean): TriggerThresholdType | undefined;
12
12
  export declare function getAcceptablePriceInfo(p: {
13
13
  marketInfo: MarketInfo;
14
14
  isIncrease: boolean;
@@ -39,6 +39,8 @@ export declare function getAmountByRatio(p: {
39
39
  }): bigint;
40
40
  export declare function getIsWrap(token1: Token, token2: Token): boolean | undefined;
41
41
  export declare function getIsUnwrap(token1: Token, token2: Token): boolean | undefined;
42
+ export declare function getIsStake(token1: Token, token2: Token): boolean | undefined;
43
+ export declare function getIsUnstake(token1: Token, token2: Token): boolean | undefined;
42
44
  export declare function getTokensRatioByPrice(p: {
43
45
  fromToken: Token;
44
46
  toToken: Token;