@lifi/perps-types 8.0.0 → 10.0.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.
- package/dist/cjs/account.d.ts +16 -7
- package/dist/cjs/account.d.ts.map +1 -1
- package/dist/esm/account.d.ts +81 -14
- package/dist/esm/account.d.ts.map +1 -1
- package/dist/types/account.d.ts +81 -14
- package/dist/types/account.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/account.ts +82 -14
package/dist/cjs/account.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface Position {
|
|
|
14
14
|
markPrice: string;
|
|
15
15
|
liquidationPrice: string;
|
|
16
16
|
unrealizedPnl: string;
|
|
17
|
+
accruedFunding: string;
|
|
17
18
|
leverage: number;
|
|
18
19
|
marginUsed: string;
|
|
19
20
|
initialMarginRequirement: string;
|
|
@@ -28,7 +29,8 @@ export interface OpenOrder {
|
|
|
28
29
|
market: MarketDisplay;
|
|
29
30
|
side: OrderSide;
|
|
30
31
|
type: OrderType;
|
|
31
|
-
|
|
32
|
+
originalSize: string;
|
|
33
|
+
remainingSize: string;
|
|
32
34
|
price: string;
|
|
33
35
|
filledSize: string;
|
|
34
36
|
reduceOnly: boolean;
|
|
@@ -84,6 +86,10 @@ export interface OrdersResponse {
|
|
|
84
86
|
triggerOrders: TriggerOrder[];
|
|
85
87
|
pagination: Pagination;
|
|
86
88
|
}
|
|
89
|
+
export interface Fee {
|
|
90
|
+
amount: string;
|
|
91
|
+
asset: string;
|
|
92
|
+
}
|
|
87
93
|
export interface Fill {
|
|
88
94
|
id: string;
|
|
89
95
|
orderId: string;
|
|
@@ -95,7 +101,7 @@ export interface Fill {
|
|
|
95
101
|
status: FillStatus;
|
|
96
102
|
liquidity: LiquidityRole;
|
|
97
103
|
filledSize?: string;
|
|
98
|
-
fee?:
|
|
104
|
+
fee?: Fee;
|
|
99
105
|
realizedPnl?: string | null;
|
|
100
106
|
startPosition?: string;
|
|
101
107
|
classification: FillClassification;
|
|
@@ -120,24 +126,26 @@ export interface BaseActivity {
|
|
|
120
126
|
}
|
|
121
127
|
export interface DepositActivity extends BaseActivity {
|
|
122
128
|
type: ActivityType.DEPOSIT;
|
|
129
|
+
asset: string;
|
|
123
130
|
amount: string;
|
|
124
131
|
explorerLink?: string;
|
|
125
132
|
}
|
|
126
133
|
export interface WithdrawalActivity extends BaseActivity {
|
|
127
134
|
type: ActivityType.WITHDRAWAL;
|
|
135
|
+
asset: string;
|
|
128
136
|
amount: string;
|
|
129
|
-
fee
|
|
137
|
+
fee?: Fee;
|
|
130
138
|
explorerLink?: string;
|
|
131
139
|
}
|
|
132
140
|
export interface LiquidatedPosition {
|
|
133
141
|
market: MarketDisplay;
|
|
134
|
-
size
|
|
142
|
+
size?: string;
|
|
135
143
|
}
|
|
136
144
|
export interface LiquidationActivity extends BaseActivity {
|
|
137
145
|
type: ActivityType.LIQUIDATION;
|
|
138
|
-
liquidatedNotionalPosition
|
|
139
|
-
accountValue
|
|
140
|
-
leverageType
|
|
146
|
+
liquidatedNotionalPosition?: string;
|
|
147
|
+
accountValue?: string;
|
|
148
|
+
leverageType?: string;
|
|
141
149
|
liquidatedPositions: LiquidatedPosition[];
|
|
142
150
|
}
|
|
143
151
|
export interface FundingActivity extends BaseActivity {
|
|
@@ -152,6 +160,7 @@ export type TransferActivity = BaseActivity & {
|
|
|
152
160
|
direction: 'IN' | 'OUT';
|
|
153
161
|
asset: string;
|
|
154
162
|
amount: string;
|
|
163
|
+
fees?: Fee[];
|
|
155
164
|
meta?: Record<string, unknown>;
|
|
156
165
|
explorerLink?: string;
|
|
157
166
|
} & ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,aAAa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,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CACxC;AAQD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAE5B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
package/dist/esm/account.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export interface Position {
|
|
|
33
33
|
liquidationPrice: string;
|
|
34
34
|
/** Unrealized PnL in quote-currency units. */
|
|
35
35
|
unrealizedPnl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Funding this position accrued since it opened, in quote-currency units.
|
|
38
|
+
* Positive means the account received funding and negative means the account
|
|
39
|
+
* paid it, matching {@link FundingActivity} amounts. Every venue resets the
|
|
40
|
+
* value when the position returns to flat.
|
|
41
|
+
*/
|
|
42
|
+
accruedFunding: string;
|
|
36
43
|
/** Position leverage as a numeric multiple. */
|
|
37
44
|
leverage: number;
|
|
38
45
|
/**
|
|
@@ -69,8 +76,10 @@ export interface OpenOrder {
|
|
|
69
76
|
market: MarketDisplay;
|
|
70
77
|
side: OrderSide;
|
|
71
78
|
type: OrderType;
|
|
72
|
-
/**
|
|
73
|
-
|
|
79
|
+
/** Quantity the order was submitted for, in base-asset units. */
|
|
80
|
+
originalSize: string;
|
|
81
|
+
/** Quantity still resting on the book, in base-asset units. */
|
|
82
|
+
remainingSize: string;
|
|
74
83
|
/** Limit/order price in quote-asset units. */
|
|
75
84
|
price: string;
|
|
76
85
|
/** Quantity already filled in base-asset units. */
|
|
@@ -187,6 +196,24 @@ export interface OrdersResponse {
|
|
|
187
196
|
triggerOrders: TriggerOrder[];
|
|
188
197
|
pagination: Pagination;
|
|
189
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Fee a venue charged, in the asset the venue charged it in. A venue does not
|
|
201
|
+
* always charge a fee in the asset the record is otherwise denominated in, so
|
|
202
|
+
* a consumer must format the amount against `asset` and never against the
|
|
203
|
+
* fill's quote asset or the activity's own `asset`.
|
|
204
|
+
*
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
export interface Fee {
|
|
208
|
+
/** Decimal string in `asset`'s units. */
|
|
209
|
+
amount: string;
|
|
210
|
+
/**
|
|
211
|
+
* Display symbol the fee is denominated in, resolved by the provider
|
|
212
|
+
* adapter. Falls back to the venue's own asset id when the registry knows no
|
|
213
|
+
* symbol.
|
|
214
|
+
*/
|
|
215
|
+
asset: string;
|
|
216
|
+
}
|
|
190
217
|
/**
|
|
191
218
|
* Normalized execution/fill record for an order.
|
|
192
219
|
*
|
|
@@ -208,7 +235,8 @@ export interface Fill {
|
|
|
208
235
|
status: FillStatus;
|
|
209
236
|
liquidity: LiquidityRole;
|
|
210
237
|
filledSize?: string;
|
|
211
|
-
fee
|
|
238
|
+
/** Absent when the venue reports no fee for the fill. */
|
|
239
|
+
fee?: Fee;
|
|
212
240
|
realizedPnl?: string | null;
|
|
213
241
|
startPosition?: string;
|
|
214
242
|
classification: FillClassification;
|
|
@@ -251,26 +279,38 @@ export interface BaseActivity {
|
|
|
251
279
|
timestamp: string;
|
|
252
280
|
}
|
|
253
281
|
/**
|
|
254
|
-
* Account activity representing a completed deposit.
|
|
282
|
+
* Account activity representing a completed deposit. `amount` is a decimal
|
|
283
|
+
* string in `asset`'s units.
|
|
255
284
|
*
|
|
256
285
|
* @public
|
|
257
286
|
*/
|
|
258
287
|
export interface DepositActivity extends BaseActivity {
|
|
259
288
|
type: ActivityType.DEPOSIT;
|
|
289
|
+
/**
|
|
290
|
+
* Display symbol of the deposited asset, resolved by the provider adapter.
|
|
291
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
292
|
+
*/
|
|
293
|
+
asset: string;
|
|
260
294
|
amount: string;
|
|
261
295
|
/** Fully-resolved block-explorer URL for the on-chain deposit tx. */
|
|
262
296
|
explorerLink?: string;
|
|
263
297
|
}
|
|
264
298
|
/**
|
|
265
|
-
* Account activity representing a completed withdrawal. `amount`
|
|
266
|
-
*
|
|
299
|
+
* Account activity representing a completed withdrawal. `amount` is a decimal
|
|
300
|
+
* string in `asset`'s units.
|
|
267
301
|
*
|
|
268
302
|
* @public
|
|
269
303
|
*/
|
|
270
304
|
export interface WithdrawalActivity extends BaseActivity {
|
|
271
305
|
type: ActivityType.WITHDRAWAL;
|
|
306
|
+
/**
|
|
307
|
+
* Display symbol of the withdrawn asset, resolved by the provider adapter.
|
|
308
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
309
|
+
*/
|
|
310
|
+
asset: string;
|
|
272
311
|
amount: string;
|
|
273
|
-
fee
|
|
312
|
+
/** Absent when the venue reports no fee for the withdrawal. */
|
|
313
|
+
fee?: Fee;
|
|
274
314
|
/** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
|
|
275
315
|
explorerLink?: string;
|
|
276
316
|
}
|
|
@@ -281,18 +321,31 @@ export interface WithdrawalActivity extends BaseActivity {
|
|
|
281
321
|
*/
|
|
282
322
|
export interface LiquidatedPosition {
|
|
283
323
|
market: MarketDisplay;
|
|
284
|
-
size
|
|
324
|
+
/** Absent when the venue reports no liquidated size for the position. */
|
|
325
|
+
size?: string;
|
|
285
326
|
}
|
|
286
327
|
/**
|
|
287
|
-
* Account activity representing a liquidation event.
|
|
328
|
+
* Account activity representing a liquidation event. `liquidatedPositions` is
|
|
329
|
+
* never empty: a provider adapter drops any record whose positions it cannot
|
|
330
|
+
* identify. A venue that liquidates several cross-margin positions in one
|
|
331
|
+
* cascade reports them as one activity with several entries, so consumers
|
|
332
|
+
* must never group activities by timestamp.
|
|
288
333
|
*
|
|
289
334
|
* @public
|
|
290
335
|
*/
|
|
291
336
|
export interface LiquidationActivity extends BaseActivity {
|
|
292
337
|
type: ActivityType.LIQUIDATION;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
338
|
+
/** Absent when the venue reports no liquidated notional. */
|
|
339
|
+
liquidatedNotionalPosition?: string;
|
|
340
|
+
/** Absent when the venue reports no account value at liquidation time. */
|
|
341
|
+
accountValue?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Margin mode the liquidated account ran under, in the venue's own
|
|
344
|
+
* vocabulary — typically `cross` or `isolated`, but the venue may report
|
|
345
|
+
* any string. Absent when the venue reports no margin mode on a
|
|
346
|
+
* liquidation row.
|
|
347
|
+
*/
|
|
348
|
+
leverageType?: string;
|
|
296
349
|
liquidatedPositions: LiquidatedPosition[];
|
|
297
350
|
}
|
|
298
351
|
/**
|
|
@@ -304,13 +357,19 @@ export interface LiquidationActivity extends BaseActivity {
|
|
|
304
357
|
export interface FundingActivity extends BaseActivity {
|
|
305
358
|
type: ActivityType.FUNDING;
|
|
306
359
|
market: MarketDisplay;
|
|
360
|
+
/**
|
|
361
|
+
* Signed, in quote-currency units. Positive means the account received
|
|
362
|
+
* funding; negative means the account paid it.
|
|
363
|
+
*/
|
|
307
364
|
amount: string;
|
|
308
365
|
positionSize: string;
|
|
309
366
|
fundingRate: string;
|
|
310
367
|
}
|
|
311
368
|
/**
|
|
312
|
-
* Account activity representing an inbound or outbound transfer
|
|
313
|
-
* counterparty identifier is required by the
|
|
369
|
+
* Account activity representing an inbound or outbound transfer between two
|
|
370
|
+
* distinct accounts. At least one counterparty identifier is required by the
|
|
371
|
+
* type-level union below. Same-account movements — a venue's own route or
|
|
372
|
+
* margin-location moves — are never reported as transfers.
|
|
314
373
|
*
|
|
315
374
|
* @public
|
|
316
375
|
*/
|
|
@@ -319,6 +378,14 @@ export type TransferActivity = BaseActivity & {
|
|
|
319
378
|
direction: 'IN' | 'OUT';
|
|
320
379
|
asset: string;
|
|
321
380
|
amount: string;
|
|
381
|
+
/**
|
|
382
|
+
* Every fee the venue charged for the transfer, in the order the venue
|
|
383
|
+
* reports them. A venue may charge several fees for one transfer, each in a
|
|
384
|
+
* different asset — a transfer fee plus a separate gas fee in the chain's
|
|
385
|
+
* native token — so this is a list and not a single amount. Absent when the
|
|
386
|
+
* venue reports no fee.
|
|
387
|
+
*/
|
|
388
|
+
fees?: Fee[];
|
|
322
389
|
meta?: Record<string, unknown>;
|
|
323
390
|
/** Fully-resolved block-explorer URL for the on-chain transfer tx. */
|
|
324
391
|
explorerLink?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACb,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,EAAE,YAAY,CAAA;IAClB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAA;IACxB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAA;IACrB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAA;IAChC,UAAU,EAAE,UAAU,CAAA;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,+DAA+D;IAC/D,wBA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A;IAChB,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,qGAAqG;IACrG,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
package/dist/types/account.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export interface Position {
|
|
|
33
33
|
liquidationPrice: string;
|
|
34
34
|
/** Unrealized PnL in quote-currency units. */
|
|
35
35
|
unrealizedPnl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Funding this position accrued since it opened, in quote-currency units.
|
|
38
|
+
* Positive means the account received funding and negative means the account
|
|
39
|
+
* paid it, matching {@link FundingActivity} amounts. Every venue resets the
|
|
40
|
+
* value when the position returns to flat.
|
|
41
|
+
*/
|
|
42
|
+
accruedFunding: string;
|
|
36
43
|
/** Position leverage as a numeric multiple. */
|
|
37
44
|
leverage: number;
|
|
38
45
|
/**
|
|
@@ -69,8 +76,10 @@ export interface OpenOrder {
|
|
|
69
76
|
market: MarketDisplay;
|
|
70
77
|
side: OrderSide;
|
|
71
78
|
type: OrderType;
|
|
72
|
-
/**
|
|
73
|
-
|
|
79
|
+
/** Quantity the order was submitted for, in base-asset units. */
|
|
80
|
+
originalSize: string;
|
|
81
|
+
/** Quantity still resting on the book, in base-asset units. */
|
|
82
|
+
remainingSize: string;
|
|
74
83
|
/** Limit/order price in quote-asset units. */
|
|
75
84
|
price: string;
|
|
76
85
|
/** Quantity already filled in base-asset units. */
|
|
@@ -187,6 +196,24 @@ export interface OrdersResponse {
|
|
|
187
196
|
triggerOrders: TriggerOrder[];
|
|
188
197
|
pagination: Pagination;
|
|
189
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Fee a venue charged, in the asset the venue charged it in. A venue does not
|
|
201
|
+
* always charge a fee in the asset the record is otherwise denominated in, so
|
|
202
|
+
* a consumer must format the amount against `asset` and never against the
|
|
203
|
+
* fill's quote asset or the activity's own `asset`.
|
|
204
|
+
*
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
export interface Fee {
|
|
208
|
+
/** Decimal string in `asset`'s units. */
|
|
209
|
+
amount: string;
|
|
210
|
+
/**
|
|
211
|
+
* Display symbol the fee is denominated in, resolved by the provider
|
|
212
|
+
* adapter. Falls back to the venue's own asset id when the registry knows no
|
|
213
|
+
* symbol.
|
|
214
|
+
*/
|
|
215
|
+
asset: string;
|
|
216
|
+
}
|
|
190
217
|
/**
|
|
191
218
|
* Normalized execution/fill record for an order.
|
|
192
219
|
*
|
|
@@ -208,7 +235,8 @@ export interface Fill {
|
|
|
208
235
|
status: FillStatus;
|
|
209
236
|
liquidity: LiquidityRole;
|
|
210
237
|
filledSize?: string;
|
|
211
|
-
fee
|
|
238
|
+
/** Absent when the venue reports no fee for the fill. */
|
|
239
|
+
fee?: Fee;
|
|
212
240
|
realizedPnl?: string | null;
|
|
213
241
|
startPosition?: string;
|
|
214
242
|
classification: FillClassification;
|
|
@@ -251,26 +279,38 @@ export interface BaseActivity {
|
|
|
251
279
|
timestamp: string;
|
|
252
280
|
}
|
|
253
281
|
/**
|
|
254
|
-
* Account activity representing a completed deposit.
|
|
282
|
+
* Account activity representing a completed deposit. `amount` is a decimal
|
|
283
|
+
* string in `asset`'s units.
|
|
255
284
|
*
|
|
256
285
|
* @public
|
|
257
286
|
*/
|
|
258
287
|
export interface DepositActivity extends BaseActivity {
|
|
259
288
|
type: ActivityType.DEPOSIT;
|
|
289
|
+
/**
|
|
290
|
+
* Display symbol of the deposited asset, resolved by the provider adapter.
|
|
291
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
292
|
+
*/
|
|
293
|
+
asset: string;
|
|
260
294
|
amount: string;
|
|
261
295
|
/** Fully-resolved block-explorer URL for the on-chain deposit tx. */
|
|
262
296
|
explorerLink?: string;
|
|
263
297
|
}
|
|
264
298
|
/**
|
|
265
|
-
* Account activity representing a completed withdrawal. `amount`
|
|
266
|
-
*
|
|
299
|
+
* Account activity representing a completed withdrawal. `amount` is a decimal
|
|
300
|
+
* string in `asset`'s units.
|
|
267
301
|
*
|
|
268
302
|
* @public
|
|
269
303
|
*/
|
|
270
304
|
export interface WithdrawalActivity extends BaseActivity {
|
|
271
305
|
type: ActivityType.WITHDRAWAL;
|
|
306
|
+
/**
|
|
307
|
+
* Display symbol of the withdrawn asset, resolved by the provider adapter.
|
|
308
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
309
|
+
*/
|
|
310
|
+
asset: string;
|
|
272
311
|
amount: string;
|
|
273
|
-
fee
|
|
312
|
+
/** Absent when the venue reports no fee for the withdrawal. */
|
|
313
|
+
fee?: Fee;
|
|
274
314
|
/** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
|
|
275
315
|
explorerLink?: string;
|
|
276
316
|
}
|
|
@@ -281,18 +321,31 @@ export interface WithdrawalActivity extends BaseActivity {
|
|
|
281
321
|
*/
|
|
282
322
|
export interface LiquidatedPosition {
|
|
283
323
|
market: MarketDisplay;
|
|
284
|
-
size
|
|
324
|
+
/** Absent when the venue reports no liquidated size for the position. */
|
|
325
|
+
size?: string;
|
|
285
326
|
}
|
|
286
327
|
/**
|
|
287
|
-
* Account activity representing a liquidation event.
|
|
328
|
+
* Account activity representing a liquidation event. `liquidatedPositions` is
|
|
329
|
+
* never empty: a provider adapter drops any record whose positions it cannot
|
|
330
|
+
* identify. A venue that liquidates several cross-margin positions in one
|
|
331
|
+
* cascade reports them as one activity with several entries, so consumers
|
|
332
|
+
* must never group activities by timestamp.
|
|
288
333
|
*
|
|
289
334
|
* @public
|
|
290
335
|
*/
|
|
291
336
|
export interface LiquidationActivity extends BaseActivity {
|
|
292
337
|
type: ActivityType.LIQUIDATION;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
338
|
+
/** Absent when the venue reports no liquidated notional. */
|
|
339
|
+
liquidatedNotionalPosition?: string;
|
|
340
|
+
/** Absent when the venue reports no account value at liquidation time. */
|
|
341
|
+
accountValue?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Margin mode the liquidated account ran under, in the venue's own
|
|
344
|
+
* vocabulary — typically `cross` or `isolated`, but the venue may report
|
|
345
|
+
* any string. Absent when the venue reports no margin mode on a
|
|
346
|
+
* liquidation row.
|
|
347
|
+
*/
|
|
348
|
+
leverageType?: string;
|
|
296
349
|
liquidatedPositions: LiquidatedPosition[];
|
|
297
350
|
}
|
|
298
351
|
/**
|
|
@@ -304,13 +357,19 @@ export interface LiquidationActivity extends BaseActivity {
|
|
|
304
357
|
export interface FundingActivity extends BaseActivity {
|
|
305
358
|
type: ActivityType.FUNDING;
|
|
306
359
|
market: MarketDisplay;
|
|
360
|
+
/**
|
|
361
|
+
* Signed, in quote-currency units. Positive means the account received
|
|
362
|
+
* funding; negative means the account paid it.
|
|
363
|
+
*/
|
|
307
364
|
amount: string;
|
|
308
365
|
positionSize: string;
|
|
309
366
|
fundingRate: string;
|
|
310
367
|
}
|
|
311
368
|
/**
|
|
312
|
-
* Account activity representing an inbound or outbound transfer
|
|
313
|
-
* counterparty identifier is required by the
|
|
369
|
+
* Account activity representing an inbound or outbound transfer between two
|
|
370
|
+
* distinct accounts. At least one counterparty identifier is required by the
|
|
371
|
+
* type-level union below. Same-account movements — a venue's own route or
|
|
372
|
+
* margin-location moves — are never reported as transfers.
|
|
314
373
|
*
|
|
315
374
|
* @public
|
|
316
375
|
*/
|
|
@@ -319,6 +378,14 @@ export type TransferActivity = BaseActivity & {
|
|
|
319
378
|
direction: 'IN' | 'OUT';
|
|
320
379
|
asset: string;
|
|
321
380
|
amount: string;
|
|
381
|
+
/**
|
|
382
|
+
* Every fee the venue charged for the transfer, in the order the venue
|
|
383
|
+
* reports them. A venue may charge several fees for one transfer, each in a
|
|
384
|
+
* different asset — a transfer fee plus a separate gas fee in the chain's
|
|
385
|
+
* native token — so this is a list and not a single amount. Absent when the
|
|
386
|
+
* venue reports no fee.
|
|
387
|
+
*/
|
|
388
|
+
fees?: Fee[];
|
|
322
389
|
meta?: Record<string, unknown>;
|
|
323
390
|
/** Fully-resolved block-explorer URL for the on-chain transfer tx. */
|
|
324
391
|
explorerLink?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACb,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,EAAE,YAAY,CAAA;IAClB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAA;IACxB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAA;IACrB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAA;IAChC,UAAU,EAAE,UAAU,CAAA;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,+DAA+D;IAC/D,wBAAwB,EAAE,MAAM,CAAA;IAChC,mEAAmE;IACnE,eAAe,EAAE,MAAM,CAAA;CACxB;AAED;;;;GAIG;AACH,MAA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B"}
|
package/package.json
CHANGED
package/src/account.ts
CHANGED
|
@@ -45,6 +45,13 @@ export interface Position {
|
|
|
45
45
|
liquidationPrice: string
|
|
46
46
|
/** Unrealized PnL in quote-currency units. */
|
|
47
47
|
unrealizedPnl: string
|
|
48
|
+
/**
|
|
49
|
+
* Funding this position accrued since it opened, in quote-currency units.
|
|
50
|
+
* Positive means the account received funding and negative means the account
|
|
51
|
+
* paid it, matching {@link FundingActivity} amounts. Every venue resets the
|
|
52
|
+
* value when the position returns to flat.
|
|
53
|
+
*/
|
|
54
|
+
accruedFunding: string
|
|
48
55
|
/** Position leverage as a numeric multiple. */
|
|
49
56
|
leverage: number
|
|
50
57
|
/**
|
|
@@ -83,8 +90,10 @@ export interface OpenOrder {
|
|
|
83
90
|
market: MarketDisplay
|
|
84
91
|
side: OrderSide
|
|
85
92
|
type: OrderType
|
|
86
|
-
/**
|
|
87
|
-
|
|
93
|
+
/** Quantity the order was submitted for, in base-asset units. */
|
|
94
|
+
originalSize: string
|
|
95
|
+
/** Quantity still resting on the book, in base-asset units. */
|
|
96
|
+
remainingSize: string
|
|
88
97
|
/** Limit/order price in quote-asset units. */
|
|
89
98
|
price: string
|
|
90
99
|
/** Quantity already filled in base-asset units. */
|
|
@@ -209,6 +218,25 @@ export interface OrdersResponse {
|
|
|
209
218
|
pagination: Pagination
|
|
210
219
|
}
|
|
211
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Fee a venue charged, in the asset the venue charged it in. A venue does not
|
|
223
|
+
* always charge a fee in the asset the record is otherwise denominated in, so
|
|
224
|
+
* a consumer must format the amount against `asset` and never against the
|
|
225
|
+
* fill's quote asset or the activity's own `asset`.
|
|
226
|
+
*
|
|
227
|
+
* @public
|
|
228
|
+
*/
|
|
229
|
+
export interface Fee {
|
|
230
|
+
/** Decimal string in `asset`'s units. */
|
|
231
|
+
amount: string
|
|
232
|
+
/**
|
|
233
|
+
* Display symbol the fee is denominated in, resolved by the provider
|
|
234
|
+
* adapter. Falls back to the venue's own asset id when the registry knows no
|
|
235
|
+
* symbol.
|
|
236
|
+
*/
|
|
237
|
+
asset: string
|
|
238
|
+
}
|
|
239
|
+
|
|
212
240
|
/**
|
|
213
241
|
* Normalized execution/fill record for an order.
|
|
214
242
|
*
|
|
@@ -230,7 +258,8 @@ export interface Fill {
|
|
|
230
258
|
status: FillStatus
|
|
231
259
|
liquidity: LiquidityRole
|
|
232
260
|
filledSize?: string
|
|
233
|
-
fee
|
|
261
|
+
/** Absent when the venue reports no fee for the fill. */
|
|
262
|
+
fee?: Fee
|
|
234
263
|
realizedPnl?: string | null
|
|
235
264
|
startPosition?: string
|
|
236
265
|
classification: FillClassification
|
|
@@ -277,27 +306,39 @@ export interface BaseActivity {
|
|
|
277
306
|
}
|
|
278
307
|
|
|
279
308
|
/**
|
|
280
|
-
* Account activity representing a completed deposit.
|
|
309
|
+
* Account activity representing a completed deposit. `amount` is a decimal
|
|
310
|
+
* string in `asset`'s units.
|
|
281
311
|
*
|
|
282
312
|
* @public
|
|
283
313
|
*/
|
|
284
314
|
export interface DepositActivity extends BaseActivity {
|
|
285
315
|
type: ActivityType.DEPOSIT
|
|
316
|
+
/**
|
|
317
|
+
* Display symbol of the deposited asset, resolved by the provider adapter.
|
|
318
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
319
|
+
*/
|
|
320
|
+
asset: string
|
|
286
321
|
amount: string
|
|
287
322
|
/** Fully-resolved block-explorer URL for the on-chain deposit tx. */
|
|
288
323
|
explorerLink?: string
|
|
289
324
|
}
|
|
290
325
|
|
|
291
326
|
/**
|
|
292
|
-
* Account activity representing a completed withdrawal. `amount`
|
|
293
|
-
*
|
|
327
|
+
* Account activity representing a completed withdrawal. `amount` is a decimal
|
|
328
|
+
* string in `asset`'s units.
|
|
294
329
|
*
|
|
295
330
|
* @public
|
|
296
331
|
*/
|
|
297
332
|
export interface WithdrawalActivity extends BaseActivity {
|
|
298
333
|
type: ActivityType.WITHDRAWAL
|
|
334
|
+
/**
|
|
335
|
+
* Display symbol of the withdrawn asset, resolved by the provider adapter.
|
|
336
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
337
|
+
*/
|
|
338
|
+
asset: string
|
|
299
339
|
amount: string
|
|
300
|
-
fee
|
|
340
|
+
/** Absent when the venue reports no fee for the withdrawal. */
|
|
341
|
+
fee?: Fee
|
|
301
342
|
/** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
|
|
302
343
|
explorerLink?: string
|
|
303
344
|
}
|
|
@@ -309,19 +350,32 @@ export interface WithdrawalActivity extends BaseActivity {
|
|
|
309
350
|
*/
|
|
310
351
|
export interface LiquidatedPosition {
|
|
311
352
|
market: MarketDisplay
|
|
312
|
-
size
|
|
353
|
+
/** Absent when the venue reports no liquidated size for the position. */
|
|
354
|
+
size?: string
|
|
313
355
|
}
|
|
314
356
|
|
|
315
357
|
/**
|
|
316
|
-
* Account activity representing a liquidation event.
|
|
358
|
+
* Account activity representing a liquidation event. `liquidatedPositions` is
|
|
359
|
+
* never empty: a provider adapter drops any record whose positions it cannot
|
|
360
|
+
* identify. A venue that liquidates several cross-margin positions in one
|
|
361
|
+
* cascade reports them as one activity with several entries, so consumers
|
|
362
|
+
* must never group activities by timestamp.
|
|
317
363
|
*
|
|
318
364
|
* @public
|
|
319
365
|
*/
|
|
320
366
|
export interface LiquidationActivity extends BaseActivity {
|
|
321
367
|
type: ActivityType.LIQUIDATION
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
368
|
+
/** Absent when the venue reports no liquidated notional. */
|
|
369
|
+
liquidatedNotionalPosition?: string
|
|
370
|
+
/** Absent when the venue reports no account value at liquidation time. */
|
|
371
|
+
accountValue?: string
|
|
372
|
+
/**
|
|
373
|
+
* Margin mode the liquidated account ran under, in the venue's own
|
|
374
|
+
* vocabulary — typically `cross` or `isolated`, but the venue may report
|
|
375
|
+
* any string. Absent when the venue reports no margin mode on a
|
|
376
|
+
* liquidation row.
|
|
377
|
+
*/
|
|
378
|
+
leverageType?: string
|
|
325
379
|
liquidatedPositions: LiquidatedPosition[]
|
|
326
380
|
}
|
|
327
381
|
|
|
@@ -334,6 +388,10 @@ export interface LiquidationActivity extends BaseActivity {
|
|
|
334
388
|
export interface FundingActivity extends BaseActivity {
|
|
335
389
|
type: ActivityType.FUNDING
|
|
336
390
|
market: MarketDisplay
|
|
391
|
+
/**
|
|
392
|
+
* Signed, in quote-currency units. Positive means the account received
|
|
393
|
+
* funding; negative means the account paid it.
|
|
394
|
+
*/
|
|
337
395
|
amount: string
|
|
338
396
|
positionSize: string
|
|
339
397
|
fundingRate: string
|
|
@@ -342,8 +400,10 @@ export interface FundingActivity extends BaseActivity {
|
|
|
342
400
|
// At least one of `counterpartyAccountIndex` / `counterpartyAddress` is always
|
|
343
401
|
// present; both may appear together.
|
|
344
402
|
/**
|
|
345
|
-
* Account activity representing an inbound or outbound transfer
|
|
346
|
-
* counterparty identifier is required by the
|
|
403
|
+
* Account activity representing an inbound or outbound transfer between two
|
|
404
|
+
* distinct accounts. At least one counterparty identifier is required by the
|
|
405
|
+
* type-level union below. Same-account movements — a venue's own route or
|
|
406
|
+
* margin-location moves — are never reported as transfers.
|
|
347
407
|
*
|
|
348
408
|
* @public
|
|
349
409
|
*/
|
|
@@ -352,6 +412,14 @@ export type TransferActivity = BaseActivity & {
|
|
|
352
412
|
direction: 'IN' | 'OUT'
|
|
353
413
|
asset: string
|
|
354
414
|
amount: string
|
|
415
|
+
/**
|
|
416
|
+
* Every fee the venue charged for the transfer, in the order the venue
|
|
417
|
+
* reports them. A venue may charge several fees for one transfer, each in a
|
|
418
|
+
* different asset — a transfer fee plus a separate gas fee in the chain's
|
|
419
|
+
* native token — so this is a list and not a single amount. Absent when the
|
|
420
|
+
* venue reports no fee.
|
|
421
|
+
*/
|
|
422
|
+
fees?: Fee[]
|
|
355
423
|
meta?: Record<string, unknown>
|
|
356
424
|
/** Fully-resolved block-explorer URL for the on-chain transfer tx. */
|
|
357
425
|
explorerLink?: string
|