@uniswap/client-trading 0.11.4 → 0.11.8
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 +169 -59
- package/dist/trading/v1/api_pb.js +108 -62
- package/package.json +1 -1
|
@@ -827,18 +827,28 @@ export declare enum MarginOperationType {
|
|
|
827
827
|
*/
|
|
828
828
|
export declare enum MarginPositionStatus {
|
|
829
829
|
/**
|
|
830
|
+
* Still open on chain, including a position that survived a partial
|
|
831
|
+
* liquidation.
|
|
832
|
+
*
|
|
830
833
|
* @generated from enum value: ACTIVE = 0;
|
|
831
834
|
*/
|
|
832
835
|
ACTIVE = 0,
|
|
833
836
|
/**
|
|
837
|
+
* The owner closed it, and it was never liquidated in that epoch.
|
|
838
|
+
*
|
|
834
839
|
* @generated from enum value: COMPLETED = 1;
|
|
835
840
|
*/
|
|
836
841
|
COMPLETED = 1,
|
|
837
842
|
/**
|
|
843
|
+
* A liquidation cleared its debt. Any collateral it left on the account is
|
|
844
|
+
* counted as returned, in `size` and `realized_pnl`.
|
|
845
|
+
*
|
|
838
846
|
* @generated from enum value: LIQUIDATED = 2;
|
|
839
847
|
*/
|
|
840
848
|
LIQUIDATED = 2,
|
|
841
849
|
/**
|
|
850
|
+
* The owner closed it after a partial liquidation earlier in the same epoch.
|
|
851
|
+
*
|
|
842
852
|
* @generated from enum value: PARTIALLY_LIQUIDATED = 3;
|
|
843
853
|
*/
|
|
844
854
|
PARTIALLY_LIQUIDATED = 3
|
|
@@ -8972,54 +8982,9 @@ export declare class MarginQuoteResponse extends Message<MarginQuoteResponse> {
|
|
|
8972
8982
|
static equals(a: MarginQuoteResponse | PlainMessage<MarginQuoteResponse> | undefined, b: MarginQuoteResponse | PlainMessage<MarginQuoteResponse> | undefined): boolean;
|
|
8973
8983
|
}
|
|
8974
8984
|
/**
|
|
8975
|
-
* One
|
|
8976
|
-
*
|
|
8977
|
-
*
|
|
8978
|
-
*
|
|
8979
|
-
* @generated from message trading.v1.MarginPositionLeg
|
|
8980
|
-
*/
|
|
8981
|
-
export declare class MarginPositionLeg extends Message<MarginPositionLeg> {
|
|
8982
|
-
/**
|
|
8983
|
-
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
8984
|
-
*/
|
|
8985
|
-
venue: MarginVenue;
|
|
8986
|
-
/**
|
|
8987
|
-
* The `positionId` handle every action key echoes back. Returned whether or
|
|
8988
|
-
* not a screen renders it.
|
|
8989
|
-
*
|
|
8990
|
-
* @generated from field: string sub_id = 2;
|
|
8991
|
-
*/
|
|
8992
|
-
subId: string;
|
|
8993
|
-
/**
|
|
8994
|
-
* The MarginAccount this leg lives at, derived offchain from (owner, subId).
|
|
8995
|
-
*
|
|
8996
|
-
* @generated from field: string account = 3;
|
|
8997
|
-
*/
|
|
8998
|
-
account: string;
|
|
8999
|
-
/**
|
|
9000
|
-
* @generated from field: string debt = 4;
|
|
9001
|
-
*/
|
|
9002
|
-
debt: string;
|
|
9003
|
-
/**
|
|
9004
|
-
* Best effort, like the markets feed: absent when the venue's rate read did
|
|
9005
|
-
* not return, never zero, because an unread rate and a zero rate differ.
|
|
9006
|
-
*
|
|
9007
|
-
* @generated from field: optional string borrow_rate = 5;
|
|
9008
|
-
*/
|
|
9009
|
-
borrowRate?: string;
|
|
9010
|
-
constructor(data?: PartialMessage<MarginPositionLeg>);
|
|
9011
|
-
static readonly runtime: typeof proto3;
|
|
9012
|
-
static readonly typeName = "trading.v1.MarginPositionLeg";
|
|
9013
|
-
static readonly fields: FieldList;
|
|
9014
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionLeg;
|
|
9015
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionLeg;
|
|
9016
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionLeg;
|
|
9017
|
-
static equals(a: MarginPositionLeg | PlainMessage<MarginPositionLeg> | undefined, b: MarginPositionLeg | PlainMessage<MarginPositionLeg> | undefined): boolean;
|
|
9018
|
-
}
|
|
9019
|
-
/**
|
|
9020
|
-
* One logical position, keyed (exposure_token, counter_token, direction) — the
|
|
9021
|
-
* same key the markets cursor orders on, which is why both endpoints page
|
|
9022
|
-
* through `marginMarketCursor`.
|
|
8985
|
+
* One position: a margin account (owner, sub_id) on one venue and market. Each
|
|
8986
|
+
* open allocates its own sub_id, so a wallet's positions in the same pair are
|
|
8987
|
+
* separate rows, each with its own risk and its own actions.
|
|
9023
8988
|
*
|
|
9024
8989
|
* @generated from message trading.v1.MarginPositionRow
|
|
9025
8990
|
*/
|
|
@@ -9045,12 +9010,38 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9045
9010
|
*/
|
|
9046
9011
|
size: string;
|
|
9047
9012
|
/**
|
|
9048
|
-
*
|
|
9013
|
+
* The account index every quote action key addresses.
|
|
9014
|
+
*
|
|
9015
|
+
* @generated from field: string sub_id = 32;
|
|
9016
|
+
*/
|
|
9017
|
+
subId: string;
|
|
9018
|
+
/**
|
|
9019
|
+
* @generated from field: trading.v1.MarginVenue venue = 33;
|
|
9049
9020
|
*/
|
|
9050
|
-
|
|
9021
|
+
venue: MarginVenue;
|
|
9051
9022
|
/**
|
|
9052
|
-
*
|
|
9053
|
-
*
|
|
9023
|
+
* The MarginAccount, derived offchain from (owner, sub_id).
|
|
9024
|
+
*
|
|
9025
|
+
* @generated from field: string account = 34;
|
|
9026
|
+
*/
|
|
9027
|
+
account: string;
|
|
9028
|
+
/**
|
|
9029
|
+
* ACTIVE only. Raw debt-token units owed now.
|
|
9030
|
+
*
|
|
9031
|
+
* @generated from field: optional string debt_amount = 35;
|
|
9032
|
+
*/
|
|
9033
|
+
debtAmount?: string;
|
|
9034
|
+
/**
|
|
9035
|
+
* Raw collateral-token units deposited over the position's life. Absent when
|
|
9036
|
+
* the store has not indexed the position or its flows went untracked.
|
|
9037
|
+
*
|
|
9038
|
+
* @generated from field: optional string deposited_equity = 36;
|
|
9039
|
+
*/
|
|
9040
|
+
depositedEquity?: string;
|
|
9041
|
+
/**
|
|
9042
|
+
* COST BASIS, from the position store. Absent rather than zero for a
|
|
9043
|
+
* position the store has not indexed. In the same terms as `oracle_price`:
|
|
9044
|
+
* counter per exposure, 1e18-scaled, reciprocated on a SHORT.
|
|
9054
9045
|
*
|
|
9055
9046
|
* @generated from field: optional string entry_price = 7;
|
|
9056
9047
|
*/
|
|
@@ -9060,14 +9051,22 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9060
9051
|
*/
|
|
9061
9052
|
openedAt?: bigint;
|
|
9062
9053
|
/**
|
|
9054
|
+
* Raw debt-token units. ACTIVE: stored interest plus live growth since the
|
|
9055
|
+
* last position event; terminal: lifetime interest.
|
|
9056
|
+
*
|
|
9063
9057
|
* @generated from field: optional string accrued_interest = 9;
|
|
9064
9058
|
*/
|
|
9065
9059
|
accruedInterest?: string;
|
|
9066
9060
|
/**
|
|
9061
|
+
* ACTIVE only. Raw collateral-token units: current equity plus collateral
|
|
9062
|
+
* already returned, minus collateral deposited.
|
|
9063
|
+
*
|
|
9067
9064
|
* @generated from field: optional string unrealized_pnl = 10;
|
|
9068
9065
|
*/
|
|
9069
9066
|
unrealizedPnl?: string;
|
|
9070
9067
|
/**
|
|
9068
|
+
* ACTIVE only. `unrealized_pnl` / `deposited_equity`, 1e18-scaled, signed.
|
|
9069
|
+
*
|
|
9071
9070
|
* @generated from field: optional string roe = 11;
|
|
9072
9071
|
*/
|
|
9073
9072
|
roe?: string;
|
|
@@ -9087,8 +9086,8 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9087
9086
|
*/
|
|
9088
9087
|
oraclePrice?: string;
|
|
9089
9088
|
/**
|
|
9090
|
-
*
|
|
9091
|
-
*
|
|
9089
|
+
* In TRADER terms, so a short's mark and liquidation price are both
|
|
9090
|
+
* reciprocated; see `displayRiskPrices`.
|
|
9092
9091
|
*
|
|
9093
9092
|
* @generated from field: optional string liquidation_price = 15;
|
|
9094
9093
|
*/
|
|
@@ -9102,6 +9101,9 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9102
9101
|
*/
|
|
9103
9102
|
healthFactor?: string;
|
|
9104
9103
|
/**
|
|
9104
|
+
* Annual, 1e18-scaled. Best effort, like the markets feed: absent when the
|
|
9105
|
+
* venue's rate read did not return, never zero.
|
|
9106
|
+
*
|
|
9105
9107
|
* @generated from field: optional string borrow_rate = 18;
|
|
9106
9108
|
*/
|
|
9107
9109
|
borrowRate?: string;
|
|
@@ -9113,12 +9115,16 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9113
9115
|
*/
|
|
9114
9116
|
maxWithdrawable?: string;
|
|
9115
9117
|
/**
|
|
9116
|
-
* TERMINAL only, and likewise cost-basis derived.
|
|
9118
|
+
* TERMINAL only, and likewise cost-basis derived. `realized_pnl` is raw
|
|
9119
|
+
* collateral-token units: collateral returned minus collateral deposited.
|
|
9120
|
+
* On a terminal row `size` is what the position held when it closed.
|
|
9117
9121
|
*
|
|
9118
9122
|
* @generated from field: optional int64 closed_at = 20;
|
|
9119
9123
|
*/
|
|
9120
9124
|
closedAt?: bigint;
|
|
9121
9125
|
/**
|
|
9126
|
+
* In the same terms as `entry_price`.
|
|
9127
|
+
*
|
|
9122
9128
|
* @generated from field: optional string exit_price = 21;
|
|
9123
9129
|
*/
|
|
9124
9130
|
exitPrice?: string;
|
|
@@ -9126,6 +9132,68 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9126
9132
|
* @generated from field: optional string realized_pnl = 22;
|
|
9127
9133
|
*/
|
|
9128
9134
|
realizedPnl?: string;
|
|
9135
|
+
/**
|
|
9136
|
+
* The PnL fields above, in raw DEBT-token units, with each deposit and return
|
|
9137
|
+
* valued at the venue's oracle mark at its event and a liquidation's leftover
|
|
9138
|
+
* at the liquidation's price; `entry_price` and `exit_price` are the swap
|
|
9139
|
+
* fills. The dollar figure is whichever of the two is in a stablecoin: this
|
|
9140
|
+
* one on a LONG against USDC, `unrealized_pnl` / `realized_pnl` on a SHORT
|
|
9141
|
+
* with USDC collateral. Absent when any deposit or return could not be
|
|
9142
|
+
* priced.
|
|
9143
|
+
*
|
|
9144
|
+
* @generated from field: optional string unrealized_pnl_in_debt = 23;
|
|
9145
|
+
*/
|
|
9146
|
+
unrealizedPnlInDebt?: string;
|
|
9147
|
+
/**
|
|
9148
|
+
* @generated from field: optional string realized_pnl_in_debt = 24;
|
|
9149
|
+
*/
|
|
9150
|
+
realizedPnlInDebt?: string;
|
|
9151
|
+
/**
|
|
9152
|
+
* The txs that opened and closed the position. `close_tx_hash` is TERMINAL
|
|
9153
|
+
* only; a full liquidation is its own close.
|
|
9154
|
+
*
|
|
9155
|
+
* @generated from field: optional string open_tx_hash = 25;
|
|
9156
|
+
*/
|
|
9157
|
+
openTxHash?: string;
|
|
9158
|
+
/**
|
|
9159
|
+
* @generated from field: optional string close_tx_hash = 26;
|
|
9160
|
+
*/
|
|
9161
|
+
closeTxHash?: string;
|
|
9162
|
+
/**
|
|
9163
|
+
* The latest liquidation, partial or full. On an ACTIVE row it means the
|
|
9164
|
+
* position survived a partial liquidation.
|
|
9165
|
+
*
|
|
9166
|
+
* @generated from field: optional string last_liquidation_tx_hash = 27;
|
|
9167
|
+
*/
|
|
9168
|
+
lastLiquidationTxHash?: string;
|
|
9169
|
+
/**
|
|
9170
|
+
* Raw collateral-token units held right after the open.
|
|
9171
|
+
*
|
|
9172
|
+
* @generated from field: optional string collateral_at_open = 28;
|
|
9173
|
+
*/
|
|
9174
|
+
collateralAtOpen?: string;
|
|
9175
|
+
/**
|
|
9176
|
+
* Partial decreases, oldest first, the newest 50.
|
|
9177
|
+
*
|
|
9178
|
+
* @generated from field: repeated trading.v1.MarginDecreaseActivity decreases = 29;
|
|
9179
|
+
*/
|
|
9180
|
+
decreases: MarginDecreaseActivity[];
|
|
9181
|
+
/**
|
|
9182
|
+
* ACTIVE only, raw DEBT-token units. The basis of the equity still in the
|
|
9183
|
+
* position, each deposit valued at the venue's oracle mark at its event: each
|
|
9184
|
+
* withdrawal removes the share of the basis it takes of the equity, both at
|
|
9185
|
+
* the withdrawal's price. Absent like `unrealized_pnl_in_debt`.
|
|
9186
|
+
*
|
|
9187
|
+
* @generated from field: optional string cost_basis_in_debt = 30;
|
|
9188
|
+
*/
|
|
9189
|
+
costBasisInDebt?: string;
|
|
9190
|
+
/**
|
|
9191
|
+
* ACTIVE only, raw DEBT-token units, signed: what withdrawals so far fetched
|
|
9192
|
+
* above the basis they removed.
|
|
9193
|
+
*
|
|
9194
|
+
* @generated from field: optional string realized_pnl_to_date_in_debt = 31;
|
|
9195
|
+
*/
|
|
9196
|
+
realizedPnlToDateInDebt?: string;
|
|
9129
9197
|
constructor(data?: PartialMessage<MarginPositionRow>);
|
|
9130
9198
|
static readonly runtime: typeof proto3;
|
|
9131
9199
|
static readonly typeName = "trading.v1.MarginPositionRow";
|
|
@@ -9135,6 +9203,47 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9135
9203
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionRow;
|
|
9136
9204
|
static equals(a: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined, b: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined): boolean;
|
|
9137
9205
|
}
|
|
9206
|
+
/**
|
|
9207
|
+
* @generated from message trading.v1.MarginDecreaseActivity
|
|
9208
|
+
*/
|
|
9209
|
+
export declare class MarginDecreaseActivity extends Message<MarginDecreaseActivity> {
|
|
9210
|
+
/**
|
|
9211
|
+
* @generated from field: string tx_hash = 1;
|
|
9212
|
+
*/
|
|
9213
|
+
txHash: string;
|
|
9214
|
+
/**
|
|
9215
|
+
* Epoch milliseconds, like `opened_at`.
|
|
9216
|
+
*
|
|
9217
|
+
* @generated from field: int64 at = 2;
|
|
9218
|
+
*/
|
|
9219
|
+
at: bigint;
|
|
9220
|
+
/**
|
|
9221
|
+
* Raw debt-token units.
|
|
9222
|
+
*
|
|
9223
|
+
* @generated from field: string debt_repaid = 3;
|
|
9224
|
+
*/
|
|
9225
|
+
debtRepaid: string;
|
|
9226
|
+
/**
|
|
9227
|
+
* Raw collateral-token units.
|
|
9228
|
+
*
|
|
9229
|
+
* @generated from field: string collateral_sold = 4;
|
|
9230
|
+
*/
|
|
9231
|
+
collateralSold: string;
|
|
9232
|
+
/**
|
|
9233
|
+
* In the same terms as the row's `entry_price`. Absent when nothing was sold.
|
|
9234
|
+
*
|
|
9235
|
+
* @generated from field: optional string exit_price = 5;
|
|
9236
|
+
*/
|
|
9237
|
+
exitPrice?: string;
|
|
9238
|
+
constructor(data?: PartialMessage<MarginDecreaseActivity>);
|
|
9239
|
+
static readonly runtime: typeof proto3;
|
|
9240
|
+
static readonly typeName = "trading.v1.MarginDecreaseActivity";
|
|
9241
|
+
static readonly fields: FieldList;
|
|
9242
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginDecreaseActivity;
|
|
9243
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginDecreaseActivity;
|
|
9244
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginDecreaseActivity;
|
|
9245
|
+
static equals(a: MarginDecreaseActivity | PlainMessage<MarginDecreaseActivity> | undefined, b: MarginDecreaseActivity | PlainMessage<MarginDecreaseActivity> | undefined): boolean;
|
|
9246
|
+
}
|
|
9138
9247
|
/**
|
|
9139
9248
|
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|
|
9140
9249
|
* this response: session-scoped and TTL-bound, so absent rather than wrong once
|
|
@@ -9209,12 +9318,13 @@ export declare class MarginPositionsRequest extends Message<MarginPositionsReque
|
|
|
9209
9318
|
*/
|
|
9210
9319
|
chainId: number;
|
|
9211
9320
|
/**
|
|
9212
|
-
* Selects the tab.
|
|
9213
|
-
*
|
|
9321
|
+
* Selects the tab. Empty means [ACTIVE]. ACTIVE is read on chain and the
|
|
9322
|
+
* finished statuses from the position store, so ACTIVE is requested alone;
|
|
9323
|
+
* any set of finished statuses is served in one page. No duplicates.
|
|
9214
9324
|
*
|
|
9215
|
-
* @generated from field:
|
|
9325
|
+
* @generated from field: repeated trading.v1.MarginPositionStatus statuses = 6;
|
|
9216
9326
|
*/
|
|
9217
|
-
|
|
9327
|
+
statuses: MarginPositionStatus[];
|
|
9218
9328
|
/**
|
|
9219
9329
|
* Opaque; echo `next_cursor` back verbatim. Keyset over the row order, the
|
|
9220
9330
|
* same contract `GET /margin/markets` uses.
|
|
@@ -1115,18 +1115,28 @@ proto3.util.setEnumType(MarginOperationType, "trading.v1.MarginOperationType", [
|
|
|
1115
1115
|
export var MarginPositionStatus;
|
|
1116
1116
|
(function (MarginPositionStatus) {
|
|
1117
1117
|
/**
|
|
1118
|
+
* Still open on chain, including a position that survived a partial
|
|
1119
|
+
* liquidation.
|
|
1120
|
+
*
|
|
1118
1121
|
* @generated from enum value: ACTIVE = 0;
|
|
1119
1122
|
*/
|
|
1120
1123
|
MarginPositionStatus[MarginPositionStatus["ACTIVE"] = 0] = "ACTIVE";
|
|
1121
1124
|
/**
|
|
1125
|
+
* The owner closed it, and it was never liquidated in that epoch.
|
|
1126
|
+
*
|
|
1122
1127
|
* @generated from enum value: COMPLETED = 1;
|
|
1123
1128
|
*/
|
|
1124
1129
|
MarginPositionStatus[MarginPositionStatus["COMPLETED"] = 1] = "COMPLETED";
|
|
1125
1130
|
/**
|
|
1131
|
+
* A liquidation cleared its debt. Any collateral it left on the account is
|
|
1132
|
+
* counted as returned, in `size` and `realized_pnl`.
|
|
1133
|
+
*
|
|
1126
1134
|
* @generated from enum value: LIQUIDATED = 2;
|
|
1127
1135
|
*/
|
|
1128
1136
|
MarginPositionStatus[MarginPositionStatus["LIQUIDATED"] = 2] = "LIQUIDATED";
|
|
1129
1137
|
/**
|
|
1138
|
+
* The owner closed it after a partial liquidation earlier in the same epoch.
|
|
1139
|
+
*
|
|
1130
1140
|
* @generated from enum value: PARTIALLY_LIQUIDATED = 3;
|
|
1131
1141
|
*/
|
|
1132
1142
|
MarginPositionStatus[MarginPositionStatus["PARTIALLY_LIQUIDATED"] = 3] = "PARTIALLY_LIQUIDATED";
|
|
@@ -10275,64 +10285,9 @@ MarginQuoteResponse.fields = proto3.util.newFieldList(() => [
|
|
|
10275
10285
|
{ no: 4, name: "gas_estimate", kind: "message", T: GasEstimate, opt: true },
|
|
10276
10286
|
]);
|
|
10277
10287
|
/**
|
|
10278
|
-
* One
|
|
10279
|
-
*
|
|
10280
|
-
*
|
|
10281
|
-
*
|
|
10282
|
-
* @generated from message trading.v1.MarginPositionLeg
|
|
10283
|
-
*/
|
|
10284
|
-
export class MarginPositionLeg extends Message {
|
|
10285
|
-
constructor(data) {
|
|
10286
|
-
super();
|
|
10287
|
-
/**
|
|
10288
|
-
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
10289
|
-
*/
|
|
10290
|
-
this.venue = MarginVenue.MORPHO;
|
|
10291
|
-
/**
|
|
10292
|
-
* The `positionId` handle every action key echoes back. Returned whether or
|
|
10293
|
-
* not a screen renders it.
|
|
10294
|
-
*
|
|
10295
|
-
* @generated from field: string sub_id = 2;
|
|
10296
|
-
*/
|
|
10297
|
-
this.subId = "";
|
|
10298
|
-
/**
|
|
10299
|
-
* The MarginAccount this leg lives at, derived offchain from (owner, subId).
|
|
10300
|
-
*
|
|
10301
|
-
* @generated from field: string account = 3;
|
|
10302
|
-
*/
|
|
10303
|
-
this.account = "";
|
|
10304
|
-
/**
|
|
10305
|
-
* @generated from field: string debt = 4;
|
|
10306
|
-
*/
|
|
10307
|
-
this.debt = "";
|
|
10308
|
-
proto3.util.initPartial(data, this);
|
|
10309
|
-
}
|
|
10310
|
-
static fromBinary(bytes, options) {
|
|
10311
|
-
return new MarginPositionLeg().fromBinary(bytes, options);
|
|
10312
|
-
}
|
|
10313
|
-
static fromJson(jsonValue, options) {
|
|
10314
|
-
return new MarginPositionLeg().fromJson(jsonValue, options);
|
|
10315
|
-
}
|
|
10316
|
-
static fromJsonString(jsonString, options) {
|
|
10317
|
-
return new MarginPositionLeg().fromJsonString(jsonString, options);
|
|
10318
|
-
}
|
|
10319
|
-
static equals(a, b) {
|
|
10320
|
-
return proto3.util.equals(MarginPositionLeg, a, b);
|
|
10321
|
-
}
|
|
10322
|
-
}
|
|
10323
|
-
MarginPositionLeg.runtime = proto3;
|
|
10324
|
-
MarginPositionLeg.typeName = "trading.v1.MarginPositionLeg";
|
|
10325
|
-
MarginPositionLeg.fields = proto3.util.newFieldList(() => [
|
|
10326
|
-
{ no: 1, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
10327
|
-
{ no: 2, name: "sub_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10328
|
-
{ no: 3, name: "account", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10329
|
-
{ no: 4, name: "debt", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10330
|
-
{ no: 5, name: "borrow_rate", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10331
|
-
]);
|
|
10332
|
-
/**
|
|
10333
|
-
* One logical position, keyed (exposure_token, counter_token, direction) — the
|
|
10334
|
-
* same key the markets cursor orders on, which is why both endpoints page
|
|
10335
|
-
* through `marginMarketCursor`.
|
|
10288
|
+
* One position: a margin account (owner, sub_id) on one venue and market. Each
|
|
10289
|
+
* open allocates its own sub_id, so a wallet's positions in the same pair are
|
|
10290
|
+
* separate rows, each with its own risk and its own actions.
|
|
10336
10291
|
*
|
|
10337
10292
|
* @generated from message trading.v1.MarginPositionRow
|
|
10338
10293
|
*/
|
|
@@ -10352,9 +10307,27 @@ export class MarginPositionRow extends Message {
|
|
|
10352
10307
|
*/
|
|
10353
10308
|
this.size = "";
|
|
10354
10309
|
/**
|
|
10355
|
-
*
|
|
10310
|
+
* The account index every quote action key addresses.
|
|
10311
|
+
*
|
|
10312
|
+
* @generated from field: string sub_id = 32;
|
|
10356
10313
|
*/
|
|
10357
|
-
this.
|
|
10314
|
+
this.subId = "";
|
|
10315
|
+
/**
|
|
10316
|
+
* @generated from field: trading.v1.MarginVenue venue = 33;
|
|
10317
|
+
*/
|
|
10318
|
+
this.venue = MarginVenue.MORPHO;
|
|
10319
|
+
/**
|
|
10320
|
+
* The MarginAccount, derived offchain from (owner, sub_id).
|
|
10321
|
+
*
|
|
10322
|
+
* @generated from field: string account = 34;
|
|
10323
|
+
*/
|
|
10324
|
+
this.account = "";
|
|
10325
|
+
/**
|
|
10326
|
+
* Partial decreases, oldest first, the newest 50.
|
|
10327
|
+
*
|
|
10328
|
+
* @generated from field: repeated trading.v1.MarginDecreaseActivity decreases = 29;
|
|
10329
|
+
*/
|
|
10330
|
+
this.decreases = [];
|
|
10358
10331
|
proto3.util.initPartial(data, this);
|
|
10359
10332
|
}
|
|
10360
10333
|
static fromBinary(bytes, options) {
|
|
@@ -10378,7 +10351,11 @@ MarginPositionRow.fields = proto3.util.newFieldList(() => [
|
|
|
10378
10351
|
{ no: 3, name: "exposure_token", kind: "message", T: MarginTokenMetadata },
|
|
10379
10352
|
{ no: 4, name: "counter_token", kind: "message", T: MarginTokenMetadata },
|
|
10380
10353
|
{ no: 5, name: "size", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10381
|
-
{ no:
|
|
10354
|
+
{ no: 32, name: "sub_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10355
|
+
{ no: 33, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
10356
|
+
{ no: 34, name: "account", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10357
|
+
{ no: 35, name: "debt_amount", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10358
|
+
{ no: 36, name: "deposited_equity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10382
10359
|
{ no: 7, name: "entry_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10383
10360
|
{ no: 8, name: "opened_at", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
|
|
10384
10361
|
{ no: 9, name: "accrued_interest", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
@@ -10395,6 +10372,67 @@ MarginPositionRow.fields = proto3.util.newFieldList(() => [
|
|
|
10395
10372
|
{ no: 20, name: "closed_at", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
|
|
10396
10373
|
{ no: 21, name: "exit_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10397
10374
|
{ no: 22, name: "realized_pnl", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10375
|
+
{ no: 23, name: "unrealized_pnl_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10376
|
+
{ no: 24, name: "realized_pnl_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10377
|
+
{ no: 25, name: "open_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10378
|
+
{ no: 26, name: "close_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10379
|
+
{ no: 27, name: "last_liquidation_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10380
|
+
{ no: 28, name: "collateral_at_open", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10381
|
+
{ no: 29, name: "decreases", kind: "message", T: MarginDecreaseActivity, repeated: true },
|
|
10382
|
+
{ no: 30, name: "cost_basis_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10383
|
+
{ no: 31, name: "realized_pnl_to_date_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10384
|
+
]);
|
|
10385
|
+
/**
|
|
10386
|
+
* @generated from message trading.v1.MarginDecreaseActivity
|
|
10387
|
+
*/
|
|
10388
|
+
export class MarginDecreaseActivity extends Message {
|
|
10389
|
+
constructor(data) {
|
|
10390
|
+
super();
|
|
10391
|
+
/**
|
|
10392
|
+
* @generated from field: string tx_hash = 1;
|
|
10393
|
+
*/
|
|
10394
|
+
this.txHash = "";
|
|
10395
|
+
/**
|
|
10396
|
+
* Epoch milliseconds, like `opened_at`.
|
|
10397
|
+
*
|
|
10398
|
+
* @generated from field: int64 at = 2;
|
|
10399
|
+
*/
|
|
10400
|
+
this.at = protoInt64.zero;
|
|
10401
|
+
/**
|
|
10402
|
+
* Raw debt-token units.
|
|
10403
|
+
*
|
|
10404
|
+
* @generated from field: string debt_repaid = 3;
|
|
10405
|
+
*/
|
|
10406
|
+
this.debtRepaid = "";
|
|
10407
|
+
/**
|
|
10408
|
+
* Raw collateral-token units.
|
|
10409
|
+
*
|
|
10410
|
+
* @generated from field: string collateral_sold = 4;
|
|
10411
|
+
*/
|
|
10412
|
+
this.collateralSold = "";
|
|
10413
|
+
proto3.util.initPartial(data, this);
|
|
10414
|
+
}
|
|
10415
|
+
static fromBinary(bytes, options) {
|
|
10416
|
+
return new MarginDecreaseActivity().fromBinary(bytes, options);
|
|
10417
|
+
}
|
|
10418
|
+
static fromJson(jsonValue, options) {
|
|
10419
|
+
return new MarginDecreaseActivity().fromJson(jsonValue, options);
|
|
10420
|
+
}
|
|
10421
|
+
static fromJsonString(jsonString, options) {
|
|
10422
|
+
return new MarginDecreaseActivity().fromJsonString(jsonString, options);
|
|
10423
|
+
}
|
|
10424
|
+
static equals(a, b) {
|
|
10425
|
+
return proto3.util.equals(MarginDecreaseActivity, a, b);
|
|
10426
|
+
}
|
|
10427
|
+
}
|
|
10428
|
+
MarginDecreaseActivity.runtime = proto3;
|
|
10429
|
+
MarginDecreaseActivity.typeName = "trading.v1.MarginDecreaseActivity";
|
|
10430
|
+
MarginDecreaseActivity.fields = proto3.util.newFieldList(() => [
|
|
10431
|
+
{ no: 1, name: "tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10432
|
+
{ no: 2, name: "at", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
10433
|
+
{ no: 3, name: "debt_repaid", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10434
|
+
{ no: 4, name: "collateral_sold", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10435
|
+
{ no: 5, name: "exit_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10398
10436
|
]);
|
|
10399
10437
|
/**
|
|
10400
10438
|
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|
|
@@ -10492,6 +10530,14 @@ export class MarginPositionsRequest extends Message {
|
|
|
10492
10530
|
* @generated from field: int32 chain_id = 2;
|
|
10493
10531
|
*/
|
|
10494
10532
|
this.chainId = 0;
|
|
10533
|
+
/**
|
|
10534
|
+
* Selects the tab. Empty means [ACTIVE]. ACTIVE is read on chain and the
|
|
10535
|
+
* finished statuses from the position store, so ACTIVE is requested alone;
|
|
10536
|
+
* any set of finished statuses is served in one page. No duplicates.
|
|
10537
|
+
*
|
|
10538
|
+
* @generated from field: repeated trading.v1.MarginPositionStatus statuses = 6;
|
|
10539
|
+
*/
|
|
10540
|
+
this.statuses = [];
|
|
10495
10541
|
proto3.util.initPartial(data, this);
|
|
10496
10542
|
}
|
|
10497
10543
|
static fromBinary(bytes, options) {
|
|
@@ -10512,7 +10558,7 @@ MarginPositionsRequest.typeName = "trading.v1.MarginPositionsRequest";
|
|
|
10512
10558
|
MarginPositionsRequest.fields = proto3.util.newFieldList(() => [
|
|
10513
10559
|
{ no: 1, name: "swapper", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10514
10560
|
{ no: 2, name: "chain_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
10515
|
-
{ no:
|
|
10561
|
+
{ no: 6, name: "statuses", kind: "enum", T: proto3.getEnumType(MarginPositionStatus), repeated: true },
|
|
10516
10562
|
{ no: 4, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10517
10563
|
{ no: 5, name: "limit", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
|
|
10518
10564
|
]);
|