@0xmonaco/types 1.0.2 → 1.0.3
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.
|
@@ -145,6 +145,14 @@ export interface SimulateOrderRiskResponse {
|
|
|
145
145
|
maintenanceMarginRequiredAfter: string;
|
|
146
146
|
freeCollateralAfter: string;
|
|
147
147
|
estimatedFee?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Estimated liquidation mark-price. In ISOLATED mode, this is the
|
|
150
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
151
|
+
* only the target position's mark while all other marks in the cross risk
|
|
152
|
+
* bucket remain unchanged. Other position marks, funding, realized PnL,
|
|
153
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
154
|
+
* as unavailable, never as zero.
|
|
155
|
+
*/
|
|
148
156
|
estimatedLiquidationPrice?: string;
|
|
149
157
|
}
|
|
150
158
|
export interface MarginAccountsAPI extends BaseAPI {
|
|
@@ -28,6 +28,14 @@ export interface Position {
|
|
|
28
28
|
* the market initial-margin floor; zero without open exposure.
|
|
29
29
|
*/
|
|
30
30
|
initialMarginRequired?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
33
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
34
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
35
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
36
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
37
|
+
* as unavailable, never as zero.
|
|
38
|
+
*/
|
|
31
39
|
liquidationPrice: string;
|
|
32
40
|
status: PositionStatus;
|
|
33
41
|
updatedAt: string;
|
|
@@ -84,6 +92,14 @@ export interface PositionRisk {
|
|
|
84
92
|
markPrice: string;
|
|
85
93
|
indexPrice?: string;
|
|
86
94
|
unrealizedPnl: string;
|
|
95
|
+
/**
|
|
96
|
+
* Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
97
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
98
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
99
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
100
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
101
|
+
* as unavailable, never as zero.
|
|
102
|
+
*/
|
|
87
103
|
liquidationPrice: string;
|
|
88
104
|
marginRatio: string;
|
|
89
105
|
/**
|
|
@@ -138,17 +154,45 @@ export interface ListPositionHistoryParams {
|
|
|
138
154
|
tradingPairId?: string;
|
|
139
155
|
page?: number;
|
|
140
156
|
pageSize?: number;
|
|
157
|
+
/** Return only per-execution position reductions, closes, and liquidations. */
|
|
158
|
+
reductionOnly?: boolean;
|
|
141
159
|
}
|
|
142
160
|
export interface PositionHistoryEvent {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
161
|
+
/** Wire-format event ID. */
|
|
162
|
+
id: string;
|
|
163
|
+
/** @deprecated Use id. */
|
|
164
|
+
event_id?: string;
|
|
165
|
+
positionId: string;
|
|
166
|
+
marginAccountId: string;
|
|
167
|
+
tradingPairId: string;
|
|
168
|
+
/** Lifecycle action from the API, for example DECREASE or CLOSE. */
|
|
169
|
+
action: string;
|
|
170
|
+
/** @deprecated Use action. */
|
|
171
|
+
eventType?: string;
|
|
172
|
+
/** Signed quantity change for lifecycle rows. */
|
|
173
|
+
sizeChange?: string;
|
|
174
|
+
/** @deprecated Use sizeChange. */
|
|
148
175
|
quantity?: string;
|
|
149
176
|
price?: string;
|
|
150
177
|
realizedPnl?: string;
|
|
151
|
-
|
|
178
|
+
feesPaid?: string;
|
|
179
|
+
collateralChange?: string;
|
|
180
|
+
orderId?: string;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
/** @deprecated Use createdAt. */
|
|
183
|
+
timestamp?: string;
|
|
184
|
+
/** Average entry price before this reducing execution. */
|
|
185
|
+
entryPrice?: string;
|
|
186
|
+
/** Initial margin allocated to this reducing execution. */
|
|
187
|
+
allocatedInitialMargin?: string;
|
|
188
|
+
/** Funding allocated to this reducing execution; positive means paid. */
|
|
189
|
+
fundingPaid?: string;
|
|
190
|
+
/** Realized PnL after trading fees and funding. */
|
|
191
|
+
netRealizedPnl?: string;
|
|
192
|
+
/** Realized return on the allocated initial margin, as a percentage. */
|
|
193
|
+
realizedRoe?: string;
|
|
194
|
+
/** Side of the position before this reducing execution. */
|
|
195
|
+
positionSide?: "LONG" | "SHORT";
|
|
152
196
|
}
|
|
153
197
|
export interface ListPositionHistoryResponse {
|
|
154
198
|
events: PositionHistoryEvent[];
|
|
@@ -90,6 +90,7 @@ export declare const ListPositionHistorySchema: z.ZodObject<{
|
|
|
90
90
|
positionId: z.ZodOptional<z.ZodUUID>;
|
|
91
91
|
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
92
92
|
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
93
|
+
reductionOnly: z.ZodOptional<z.ZodBoolean>;
|
|
93
94
|
}, z.core.$strip>;
|
|
94
95
|
export declare const GetPositionPnlHistorySchema: z.ZodObject<{
|
|
95
96
|
positionId: z.ZodUUID;
|
|
@@ -94,6 +94,7 @@ export const ListPositionHistorySchema = PaginationSchema.extend({
|
|
|
94
94
|
positionId: UUIDSchema.optional(),
|
|
95
95
|
marginAccountId: UUIDSchema.optional(),
|
|
96
96
|
tradingPairId: UUIDSchema.optional(),
|
|
97
|
+
reductionOnly: z.boolean().optional(),
|
|
97
98
|
});
|
|
98
99
|
const PnlHistoryIntervalSchema = z.enum(["1m", "5m", "15m", "1h", "4h", "1d"], {
|
|
99
100
|
message: 'Interval must be one of "1m", "5m", "15m", "1h", "4h", "1d"',
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -3993,6 +3993,14 @@ export interface components {
|
|
|
3993
3993
|
* position has no open exposure.
|
|
3994
3994
|
*/
|
|
3995
3995
|
initialMarginRequired?: string | null;
|
|
3996
|
+
/**
|
|
3997
|
+
* @description Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
3998
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
3999
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
4000
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
4001
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
4002
|
+
* as unavailable, never as zero.
|
|
4003
|
+
*/
|
|
3996
4004
|
liquidationPrice?: string | null;
|
|
3997
4005
|
status?: string | null;
|
|
3998
4006
|
updatedAt?: string | null;
|
|
@@ -4004,6 +4012,14 @@ export interface components {
|
|
|
4004
4012
|
markPrice?: string | null;
|
|
4005
4013
|
indexPrice?: string | null;
|
|
4006
4014
|
unrealizedPnl?: string | null;
|
|
4015
|
+
/**
|
|
4016
|
+
* @description Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
4017
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
4018
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
4019
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
4020
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
4021
|
+
* as unavailable, never as zero.
|
|
4022
|
+
*/
|
|
4007
4023
|
liquidationPrice?: string | null;
|
|
4008
4024
|
marginRatio?: string | null;
|
|
4009
4025
|
/**
|
|
@@ -4888,6 +4904,14 @@ export interface components {
|
|
|
4888
4904
|
* position has no open exposure.
|
|
4889
4905
|
*/
|
|
4890
4906
|
initialMarginRequired?: string | null;
|
|
4907
|
+
/**
|
|
4908
|
+
* @description Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
4909
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
4910
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
4911
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
4912
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
4913
|
+
* as unavailable, never as zero.
|
|
4914
|
+
*/
|
|
4891
4915
|
liquidationPrice?: string | null;
|
|
4892
4916
|
status?: string | null;
|
|
4893
4917
|
updatedAt?: string | null;
|
|
@@ -4909,6 +4933,18 @@ export interface components {
|
|
|
4909
4933
|
/** Format: uuid */
|
|
4910
4934
|
orderId?: string | null;
|
|
4911
4935
|
createdAt?: string | null;
|
|
4936
|
+
/** @description Average entry price immediately before this reduction execution. */
|
|
4937
|
+
entryPrice?: string | null;
|
|
4938
|
+
/** @description Initial margin allocated pro rata to this reduction execution. */
|
|
4939
|
+
allocatedInitialMargin?: string | null;
|
|
4940
|
+
/** @description Funding allocated pro rata to this reduction; positive means paid. */
|
|
4941
|
+
fundingPaid?: string | null;
|
|
4942
|
+
/** @description Realized PnL after trading fees and funding for this reduction execution. */
|
|
4943
|
+
netRealizedPnl?: string | null;
|
|
4944
|
+
/** @description Net realized PnL divided by allocated_initial_margin, expressed as a percentage. */
|
|
4945
|
+
realizedRoe?: string | null;
|
|
4946
|
+
/** @description Position side immediately before this reduction execution. */
|
|
4947
|
+
positionSide?: string | null;
|
|
4912
4948
|
};
|
|
4913
4949
|
/**
|
|
4914
4950
|
* @description One PnL state sample for a position in one bucket. Cumulative fields are
|
|
@@ -5330,6 +5366,14 @@ export interface components {
|
|
|
5330
5366
|
maintenanceMarginRequiredAfter?: string | null;
|
|
5331
5367
|
freeCollateralAfter?: string | null;
|
|
5332
5368
|
estimatedFee?: string | null;
|
|
5369
|
+
/**
|
|
5370
|
+
* @description Estimated liquidation mark-price. In ISOLATED mode, this is the
|
|
5371
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
5372
|
+
* only the target position's mark while all other marks in the cross risk
|
|
5373
|
+
* bucket remain unchanged. Other position marks, funding, realized PnL,
|
|
5374
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
5375
|
+
* as unavailable, never as zero.
|
|
5376
|
+
*/
|
|
5333
5377
|
estimatedLiquidationPrice?: string | null;
|
|
5334
5378
|
/**
|
|
5335
5379
|
* @description The margin account the simulation was resolved against. Always populated;
|
|
@@ -9223,6 +9267,8 @@ export interface operations {
|
|
|
9223
9267
|
page?: number;
|
|
9224
9268
|
/** @description Items per page (max 100) */
|
|
9225
9269
|
pageSize?: number;
|
|
9270
|
+
/** @description When true, return only DECREASE, CLOSE, and LIQUIDATE execution rows. */
|
|
9271
|
+
reductionOnly?: boolean;
|
|
9226
9272
|
};
|
|
9227
9273
|
header?: never;
|
|
9228
9274
|
path?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"lint": "biome lint ."
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@0xmonaco/contracts": "1.0.
|
|
23
|
+
"@0xmonaco/contracts": "1.0.3",
|
|
24
24
|
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|