@uniswap/client-trading 0.11.4 → 0.11.7
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/trading/v1/api_pb.d.ts +114 -3
- package/dist/trading/v1/api_pb.js +67 -0
- package/package.json +1 -1
|
@@ -9049,8 +9049,8 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9049
9049
|
*/
|
|
9050
9050
|
legs: MarginPositionLeg[];
|
|
9051
9051
|
/**
|
|
9052
|
-
* COST BASIS
|
|
9053
|
-
*
|
|
9052
|
+
* COST BASIS, from the position store. Absent rather than zero for a leg the
|
|
9053
|
+
* store has not indexed.
|
|
9054
9054
|
*
|
|
9055
9055
|
* @generated from field: optional string entry_price = 7;
|
|
9056
9056
|
*/
|
|
@@ -9060,10 +9060,16 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9060
9060
|
*/
|
|
9061
9061
|
openedAt?: bigint;
|
|
9062
9062
|
/**
|
|
9063
|
+
* Raw debt-token units. ACTIVE: stored interest plus live growth since the
|
|
9064
|
+
* last position event; terminal: lifetime interest.
|
|
9065
|
+
*
|
|
9063
9066
|
* @generated from field: optional string accrued_interest = 9;
|
|
9064
9067
|
*/
|
|
9065
9068
|
accruedInterest?: string;
|
|
9066
9069
|
/**
|
|
9070
|
+
* ACTIVE only. Raw collateral-token units: current equity plus collateral
|
|
9071
|
+
* already returned, minus collateral deposited.
|
|
9072
|
+
*
|
|
9067
9073
|
* @generated from field: optional string unrealized_pnl = 10;
|
|
9068
9074
|
*/
|
|
9069
9075
|
unrealizedPnl?: string;
|
|
@@ -9113,7 +9119,8 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9113
9119
|
*/
|
|
9114
9120
|
maxWithdrawable?: string;
|
|
9115
9121
|
/**
|
|
9116
|
-
* TERMINAL only, and likewise cost-basis derived.
|
|
9122
|
+
* TERMINAL only, and likewise cost-basis derived. `realized_pnl` is raw
|
|
9123
|
+
* collateral-token units: collateral returned minus collateral deposited.
|
|
9117
9124
|
*
|
|
9118
9125
|
* @generated from field: optional int64 closed_at = 20;
|
|
9119
9126
|
*/
|
|
@@ -9126,6 +9133,68 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9126
9133
|
* @generated from field: optional string realized_pnl = 22;
|
|
9127
9134
|
*/
|
|
9128
9135
|
realizedPnl?: string;
|
|
9136
|
+
/**
|
|
9137
|
+
* The PnL fields above, in raw DEBT-token units, with each deposit and return
|
|
9138
|
+
* valued at the venue's oracle mark at its event and a liquidation's leftover
|
|
9139
|
+
* at the liquidation's price; `entry_price` and `exit_price` are the swap
|
|
9140
|
+
* fills. The dollar figure is whichever of the two is in a stablecoin: this
|
|
9141
|
+
* one on a LONG against USDC, `unrealized_pnl` / `realized_pnl` on a SHORT
|
|
9142
|
+
* with USDC collateral. Absent when any deposit or return could not be
|
|
9143
|
+
* priced.
|
|
9144
|
+
*
|
|
9145
|
+
* @generated from field: optional string unrealized_pnl_in_debt = 23;
|
|
9146
|
+
*/
|
|
9147
|
+
unrealizedPnlInDebt?: string;
|
|
9148
|
+
/**
|
|
9149
|
+
* @generated from field: optional string realized_pnl_in_debt = 24;
|
|
9150
|
+
*/
|
|
9151
|
+
realizedPnlInDebt?: string;
|
|
9152
|
+
/**
|
|
9153
|
+
* The txs that opened and closed the position. `close_tx_hash` is TERMINAL
|
|
9154
|
+
* only; a full liquidation is its own close.
|
|
9155
|
+
*
|
|
9156
|
+
* @generated from field: optional string open_tx_hash = 25;
|
|
9157
|
+
*/
|
|
9158
|
+
openTxHash?: string;
|
|
9159
|
+
/**
|
|
9160
|
+
* @generated from field: optional string close_tx_hash = 26;
|
|
9161
|
+
*/
|
|
9162
|
+
closeTxHash?: string;
|
|
9163
|
+
/**
|
|
9164
|
+
* The latest liquidation, partial or full. On an ACTIVE row it means the
|
|
9165
|
+
* position survived a partial liquidation.
|
|
9166
|
+
*
|
|
9167
|
+
* @generated from field: optional string last_liquidation_tx_hash = 27;
|
|
9168
|
+
*/
|
|
9169
|
+
lastLiquidationTxHash?: string;
|
|
9170
|
+
/**
|
|
9171
|
+
* Raw collateral-token units held right after the open, summed over legs.
|
|
9172
|
+
*
|
|
9173
|
+
* @generated from field: optional string collateral_at_open = 28;
|
|
9174
|
+
*/
|
|
9175
|
+
collateralAtOpen?: string;
|
|
9176
|
+
/**
|
|
9177
|
+
* Partial decreases, oldest first, the newest 50 per leg.
|
|
9178
|
+
*
|
|
9179
|
+
* @generated from field: repeated trading.v1.MarginDecreaseActivity decreases = 29;
|
|
9180
|
+
*/
|
|
9181
|
+
decreases: MarginDecreaseActivity[];
|
|
9182
|
+
/**
|
|
9183
|
+
* ACTIVE only, raw DEBT-token units. The basis of the equity still in the
|
|
9184
|
+
* position, each deposit valued at the venue's oracle mark at its event: each
|
|
9185
|
+
* withdrawal removes the share of the basis it takes of the equity, both at
|
|
9186
|
+
* the withdrawal's price. Absent like `unrealized_pnl_in_debt`.
|
|
9187
|
+
*
|
|
9188
|
+
* @generated from field: optional string cost_basis_in_debt = 30;
|
|
9189
|
+
*/
|
|
9190
|
+
costBasisInDebt?: string;
|
|
9191
|
+
/**
|
|
9192
|
+
* ACTIVE only, raw DEBT-token units, signed: what withdrawals so far fetched
|
|
9193
|
+
* above the basis they removed.
|
|
9194
|
+
*
|
|
9195
|
+
* @generated from field: optional string realized_pnl_to_date_in_debt = 31;
|
|
9196
|
+
*/
|
|
9197
|
+
realizedPnlToDateInDebt?: string;
|
|
9129
9198
|
constructor(data?: PartialMessage<MarginPositionRow>);
|
|
9130
9199
|
static readonly runtime: typeof proto3;
|
|
9131
9200
|
static readonly typeName = "trading.v1.MarginPositionRow";
|
|
@@ -9135,6 +9204,48 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9135
9204
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionRow;
|
|
9136
9205
|
static equals(a: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined, b: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined): boolean;
|
|
9137
9206
|
}
|
|
9207
|
+
/**
|
|
9208
|
+
* @generated from message trading.v1.MarginDecreaseActivity
|
|
9209
|
+
*/
|
|
9210
|
+
export declare class MarginDecreaseActivity extends Message<MarginDecreaseActivity> {
|
|
9211
|
+
/**
|
|
9212
|
+
* @generated from field: string tx_hash = 1;
|
|
9213
|
+
*/
|
|
9214
|
+
txHash: string;
|
|
9215
|
+
/**
|
|
9216
|
+
* Epoch milliseconds, like `opened_at`.
|
|
9217
|
+
*
|
|
9218
|
+
* @generated from field: int64 at = 2;
|
|
9219
|
+
*/
|
|
9220
|
+
at: bigint;
|
|
9221
|
+
/**
|
|
9222
|
+
* Raw debt-token units.
|
|
9223
|
+
*
|
|
9224
|
+
* @generated from field: string debt_repaid = 3;
|
|
9225
|
+
*/
|
|
9226
|
+
debtRepaid: string;
|
|
9227
|
+
/**
|
|
9228
|
+
* Raw collateral-token units.
|
|
9229
|
+
*
|
|
9230
|
+
* @generated from field: string collateral_sold = 4;
|
|
9231
|
+
*/
|
|
9232
|
+
collateralSold: string;
|
|
9233
|
+
/**
|
|
9234
|
+
* Raw debt per raw collateral, 1e18-scaled, like `entry_price`. Absent when
|
|
9235
|
+
* nothing was sold.
|
|
9236
|
+
*
|
|
9237
|
+
* @generated from field: optional string exit_price = 5;
|
|
9238
|
+
*/
|
|
9239
|
+
exitPrice?: string;
|
|
9240
|
+
constructor(data?: PartialMessage<MarginDecreaseActivity>);
|
|
9241
|
+
static readonly runtime: typeof proto3;
|
|
9242
|
+
static readonly typeName = "trading.v1.MarginDecreaseActivity";
|
|
9243
|
+
static readonly fields: FieldList;
|
|
9244
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginDecreaseActivity;
|
|
9245
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginDecreaseActivity;
|
|
9246
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginDecreaseActivity;
|
|
9247
|
+
static equals(a: MarginDecreaseActivity | PlainMessage<MarginDecreaseActivity> | undefined, b: MarginDecreaseActivity | PlainMessage<MarginDecreaseActivity> | undefined): boolean;
|
|
9248
|
+
}
|
|
9138
9249
|
/**
|
|
9139
9250
|
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|
|
9140
9251
|
* this response: session-scoped and TTL-bound, so absent rather than wrong once
|
|
@@ -10355,6 +10355,12 @@ export class MarginPositionRow extends Message {
|
|
|
10355
10355
|
* @generated from field: repeated trading.v1.MarginPositionLeg legs = 6;
|
|
10356
10356
|
*/
|
|
10357
10357
|
this.legs = [];
|
|
10358
|
+
/**
|
|
10359
|
+
* Partial decreases, oldest first, the newest 50 per leg.
|
|
10360
|
+
*
|
|
10361
|
+
* @generated from field: repeated trading.v1.MarginDecreaseActivity decreases = 29;
|
|
10362
|
+
*/
|
|
10363
|
+
this.decreases = [];
|
|
10358
10364
|
proto3.util.initPartial(data, this);
|
|
10359
10365
|
}
|
|
10360
10366
|
static fromBinary(bytes, options) {
|
|
@@ -10395,6 +10401,67 @@ MarginPositionRow.fields = proto3.util.newFieldList(() => [
|
|
|
10395
10401
|
{ no: 20, name: "closed_at", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
|
|
10396
10402
|
{ no: 21, name: "exit_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10397
10403
|
{ no: 22, name: "realized_pnl", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10404
|
+
{ no: 23, name: "unrealized_pnl_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10405
|
+
{ no: 24, name: "realized_pnl_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10406
|
+
{ no: 25, name: "open_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10407
|
+
{ no: 26, name: "close_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10408
|
+
{ no: 27, name: "last_liquidation_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10409
|
+
{ no: 28, name: "collateral_at_open", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10410
|
+
{ no: 29, name: "decreases", kind: "message", T: MarginDecreaseActivity, repeated: true },
|
|
10411
|
+
{ no: 30, name: "cost_basis_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10412
|
+
{ no: 31, name: "realized_pnl_to_date_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10413
|
+
]);
|
|
10414
|
+
/**
|
|
10415
|
+
* @generated from message trading.v1.MarginDecreaseActivity
|
|
10416
|
+
*/
|
|
10417
|
+
export class MarginDecreaseActivity extends Message {
|
|
10418
|
+
constructor(data) {
|
|
10419
|
+
super();
|
|
10420
|
+
/**
|
|
10421
|
+
* @generated from field: string tx_hash = 1;
|
|
10422
|
+
*/
|
|
10423
|
+
this.txHash = "";
|
|
10424
|
+
/**
|
|
10425
|
+
* Epoch milliseconds, like `opened_at`.
|
|
10426
|
+
*
|
|
10427
|
+
* @generated from field: int64 at = 2;
|
|
10428
|
+
*/
|
|
10429
|
+
this.at = protoInt64.zero;
|
|
10430
|
+
/**
|
|
10431
|
+
* Raw debt-token units.
|
|
10432
|
+
*
|
|
10433
|
+
* @generated from field: string debt_repaid = 3;
|
|
10434
|
+
*/
|
|
10435
|
+
this.debtRepaid = "";
|
|
10436
|
+
/**
|
|
10437
|
+
* Raw collateral-token units.
|
|
10438
|
+
*
|
|
10439
|
+
* @generated from field: string collateral_sold = 4;
|
|
10440
|
+
*/
|
|
10441
|
+
this.collateralSold = "";
|
|
10442
|
+
proto3.util.initPartial(data, this);
|
|
10443
|
+
}
|
|
10444
|
+
static fromBinary(bytes, options) {
|
|
10445
|
+
return new MarginDecreaseActivity().fromBinary(bytes, options);
|
|
10446
|
+
}
|
|
10447
|
+
static fromJson(jsonValue, options) {
|
|
10448
|
+
return new MarginDecreaseActivity().fromJson(jsonValue, options);
|
|
10449
|
+
}
|
|
10450
|
+
static fromJsonString(jsonString, options) {
|
|
10451
|
+
return new MarginDecreaseActivity().fromJsonString(jsonString, options);
|
|
10452
|
+
}
|
|
10453
|
+
static equals(a, b) {
|
|
10454
|
+
return proto3.util.equals(MarginDecreaseActivity, a, b);
|
|
10455
|
+
}
|
|
10456
|
+
}
|
|
10457
|
+
MarginDecreaseActivity.runtime = proto3;
|
|
10458
|
+
MarginDecreaseActivity.typeName = "trading.v1.MarginDecreaseActivity";
|
|
10459
|
+
MarginDecreaseActivity.fields = proto3.util.newFieldList(() => [
|
|
10460
|
+
{ no: 1, name: "tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10461
|
+
{ no: 2, name: "at", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
10462
|
+
{ no: 3, name: "debt_repaid", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10463
|
+
{ no: 4, name: "collateral_sold", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10464
|
+
{ no: 5, name: "exit_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10398
10465
|
]);
|
|
10399
10466
|
/**
|
|
10400
10467
|
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|