@uniswap/client-trading 0.6.1 → 0.8.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/trading/v1/api-tradingService_connectquery.d.ts +29 -1
- package/dist/trading/v1/api-tradingService_connectquery.js +29 -1
- package/dist/trading/v1/api_connect.d.ts +21 -1
- package/dist/trading/v1/api_connect.js +21 -1
- package/dist/trading/v1/api_pb.d.ts +1065 -0
- package/dist/trading/v1/api_pb.js +1035 -0
- package/package.json +1 -1
|
@@ -713,6 +713,105 @@ export declare enum MarginVenue {
|
|
|
713
713
|
*/
|
|
714
714
|
AAVE_V4 = 2
|
|
715
715
|
}
|
|
716
|
+
/**
|
|
717
|
+
* Echoed on the response so a client can tell which action was priced without
|
|
718
|
+
* re-deriving it from the request. Mirrors the request's oneof exactly.
|
|
719
|
+
* Named intent to match the error codes (INTENT_MISMATCH) and the plan step
|
|
720
|
+
* vocabulary, so one word is used end to end.
|
|
721
|
+
*
|
|
722
|
+
* @generated from enum trading.v1.MarginIntent
|
|
723
|
+
*/
|
|
724
|
+
export declare enum MarginIntent {
|
|
725
|
+
/**
|
|
726
|
+
* @generated from enum value: MARGIN_INTENT_OPEN = 0;
|
|
727
|
+
*/
|
|
728
|
+
OPEN = 0,
|
|
729
|
+
/**
|
|
730
|
+
* @generated from enum value: MARGIN_INTENT_CLOSE = 1;
|
|
731
|
+
*/
|
|
732
|
+
CLOSE = 1,
|
|
733
|
+
/**
|
|
734
|
+
* @generated from enum value: MARGIN_INTENT_INCREASE_LEVERAGE = 2;
|
|
735
|
+
*/
|
|
736
|
+
INCREASE_LEVERAGE = 2,
|
|
737
|
+
/**
|
|
738
|
+
* @generated from enum value: MARGIN_INTENT_DECREASE_LEVERAGE = 3;
|
|
739
|
+
*/
|
|
740
|
+
DECREASE_LEVERAGE = 3,
|
|
741
|
+
/**
|
|
742
|
+
* @generated from enum value: MARGIN_INTENT_ADD_EQUITY = 4;
|
|
743
|
+
*/
|
|
744
|
+
ADD_EQUITY = 4,
|
|
745
|
+
/**
|
|
746
|
+
* @generated from enum value: MARGIN_INTENT_WITHDRAW_EQUITY = 5;
|
|
747
|
+
*/
|
|
748
|
+
WITHDRAW_EQUITY = 5,
|
|
749
|
+
/**
|
|
750
|
+
* @generated from enum value: MARGIN_INTENT_ADD_EQUITY_AND_INCREASE_LEVERAGE = 6;
|
|
751
|
+
*/
|
|
752
|
+
ADD_EQUITY_AND_INCREASE_LEVERAGE = 6,
|
|
753
|
+
/**
|
|
754
|
+
* @generated from enum value: MARGIN_INTENT_ADD_EQUITY_AND_DECREASE_LEVERAGE = 7;
|
|
755
|
+
*/
|
|
756
|
+
ADD_EQUITY_AND_DECREASE_LEVERAGE = 7,
|
|
757
|
+
/**
|
|
758
|
+
* @generated from enum value: MARGIN_INTENT_WITHDRAW_EQUITY_AND_INCREASE_LEVERAGE = 8;
|
|
759
|
+
*/
|
|
760
|
+
WITHDRAW_EQUITY_AND_INCREASE_LEVERAGE = 8,
|
|
761
|
+
/**
|
|
762
|
+
* @generated from enum value: MARGIN_INTENT_WITHDRAW_EQUITY_AND_DECREASE_LEVERAGE = 9;
|
|
763
|
+
*/
|
|
764
|
+
WITHDRAW_EQUITY_AND_DECREASE_LEVERAGE = 9
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* One on-chain call inside the router's execute([...actions]) stream. The
|
|
768
|
+
* quote decomposes an action into these; the plan stamps them into calldata.
|
|
769
|
+
*
|
|
770
|
+
* @generated from enum trading.v1.MarginOperationType
|
|
771
|
+
*/
|
|
772
|
+
export declare enum MarginOperationType {
|
|
773
|
+
/**
|
|
774
|
+
* @generated from enum value: INCREASE_POSITION = 0;
|
|
775
|
+
*/
|
|
776
|
+
INCREASE_POSITION = 0,
|
|
777
|
+
/**
|
|
778
|
+
* @generated from enum value: DECREASE_POSITION = 1;
|
|
779
|
+
*/
|
|
780
|
+
DECREASE_POSITION = 1,
|
|
781
|
+
/**
|
|
782
|
+
* @generated from enum value: ADD_COLLATERAL = 2;
|
|
783
|
+
*/
|
|
784
|
+
ADD_COLLATERAL = 2,
|
|
785
|
+
/**
|
|
786
|
+
* @generated from enum value: WITHDRAW = 3;
|
|
787
|
+
*/
|
|
788
|
+
WITHDRAW = 3,
|
|
789
|
+
/**
|
|
790
|
+
* @generated from enum value: SWEEP = 4;
|
|
791
|
+
*/
|
|
792
|
+
SWEEP = 4
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* @generated from enum trading.v1.MarginPositionStatus
|
|
796
|
+
*/
|
|
797
|
+
export declare enum MarginPositionStatus {
|
|
798
|
+
/**
|
|
799
|
+
* @generated from enum value: ACTIVE = 0;
|
|
800
|
+
*/
|
|
801
|
+
ACTIVE = 0,
|
|
802
|
+
/**
|
|
803
|
+
* @generated from enum value: COMPLETED = 1;
|
|
804
|
+
*/
|
|
805
|
+
COMPLETED = 1,
|
|
806
|
+
/**
|
|
807
|
+
* @generated from enum value: LIQUIDATED = 2;
|
|
808
|
+
*/
|
|
809
|
+
LIQUIDATED = 2,
|
|
810
|
+
/**
|
|
811
|
+
* @generated from enum value: PARTIALLY_LIQUIDATED = 3;
|
|
812
|
+
*/
|
|
813
|
+
PARTIALLY_LIQUIDATED = 3
|
|
814
|
+
}
|
|
716
815
|
/**
|
|
717
816
|
* @generated from message trading.v1.Encode7702Request
|
|
718
817
|
*/
|
|
@@ -7939,3 +8038,969 @@ export declare class MarginMarketsResponse extends Message<MarginMarketsResponse
|
|
|
7939
8038
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginMarketsResponse;
|
|
7940
8039
|
static equals(a: MarginMarketsResponse | PlainMessage<MarginMarketsResponse> | undefined, b: MarginMarketsResponse | PlainMessage<MarginMarketsResponse> | undefined): boolean;
|
|
7941
8040
|
}
|
|
8041
|
+
/**
|
|
8042
|
+
* increaseLeverage, decreaseLeverage. Equity is held, so no amount.
|
|
8043
|
+
*
|
|
8044
|
+
* @generated from message trading.v1.MarginLeverageAction
|
|
8045
|
+
*/
|
|
8046
|
+
export declare class MarginLeverageAction extends Message<MarginLeverageAction> {
|
|
8047
|
+
/**
|
|
8048
|
+
* @generated from field: string position_id = 1;
|
|
8049
|
+
*/
|
|
8050
|
+
positionId: string;
|
|
8051
|
+
/**
|
|
8052
|
+
* Decimal string ("3", "2.55"), never a float.
|
|
8053
|
+
*
|
|
8054
|
+
* @generated from field: string leverage_target = 2;
|
|
8055
|
+
*/
|
|
8056
|
+
leverageTarget: string;
|
|
8057
|
+
constructor(data?: PartialMessage<MarginLeverageAction>);
|
|
8058
|
+
static readonly runtime: typeof proto3;
|
|
8059
|
+
static readonly typeName = "trading.v1.MarginLeverageAction";
|
|
8060
|
+
static readonly fields: FieldList;
|
|
8061
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginLeverageAction;
|
|
8062
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginLeverageAction;
|
|
8063
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginLeverageAction;
|
|
8064
|
+
static equals(a: MarginLeverageAction | PlainMessage<MarginLeverageAction> | undefined, b: MarginLeverageAction | PlainMessage<MarginLeverageAction> | undefined): boolean;
|
|
8065
|
+
}
|
|
8066
|
+
/**
|
|
8067
|
+
* The four composites. Both axes move, so both magnitudes are carried.
|
|
8068
|
+
*
|
|
8069
|
+
* @generated from message trading.v1.MarginEquityLeverageAction
|
|
8070
|
+
*/
|
|
8071
|
+
export declare class MarginEquityLeverageAction extends Message<MarginEquityLeverageAction> {
|
|
8072
|
+
/**
|
|
8073
|
+
* @generated from field: string position_id = 1;
|
|
8074
|
+
*/
|
|
8075
|
+
positionId: string;
|
|
8076
|
+
/**
|
|
8077
|
+
* @generated from field: string leverage_target = 2;
|
|
8078
|
+
*/
|
|
8079
|
+
leverageTarget: string;
|
|
8080
|
+
/**
|
|
8081
|
+
* @generated from field: string amount = 3;
|
|
8082
|
+
*/
|
|
8083
|
+
amount: string;
|
|
8084
|
+
constructor(data?: PartialMessage<MarginEquityLeverageAction>);
|
|
8085
|
+
static readonly runtime: typeof proto3;
|
|
8086
|
+
static readonly typeName = "trading.v1.MarginEquityLeverageAction";
|
|
8087
|
+
static readonly fields: FieldList;
|
|
8088
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginEquityLeverageAction;
|
|
8089
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginEquityLeverageAction;
|
|
8090
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginEquityLeverageAction;
|
|
8091
|
+
static equals(a: MarginEquityLeverageAction | PlainMessage<MarginEquityLeverageAction> | undefined, b: MarginEquityLeverageAction | PlainMessage<MarginEquityLeverageAction> | undefined): boolean;
|
|
8092
|
+
}
|
|
8093
|
+
/**
|
|
8094
|
+
* addEquity, withdrawEquity. Size is held and leverage follows, so no target.
|
|
8095
|
+
*
|
|
8096
|
+
* `amount` is denominated in wallet_token on addEquity, and in the COLLATERAL
|
|
8097
|
+
* token on withdrawEquity. That asymmetry is deliberate, and it is the one
|
|
8098
|
+
* place the "amount is always wallet_token" rule breaks.
|
|
8099
|
+
*
|
|
8100
|
+
* A withdrawal's safety is a property of the position, not of the price its
|
|
8101
|
+
* proceeds fetch: how much collateral can leave before health hits the floor
|
|
8102
|
+
* is answerable from the position alone. Denominating in wallet_token would
|
|
8103
|
+
* make that check depend on a swap quote, so whether a withdrawal is allowed
|
|
8104
|
+
* would move with the funding route. It also matches the on-chain primitive,
|
|
8105
|
+
* which takes a collateral amount, and the max-withdrawable guard, which is
|
|
8106
|
+
* computed in collateral terms.
|
|
8107
|
+
*
|
|
8108
|
+
* @generated from message trading.v1.MarginEquityAction
|
|
8109
|
+
*/
|
|
8110
|
+
export declare class MarginEquityAction extends Message<MarginEquityAction> {
|
|
8111
|
+
/**
|
|
8112
|
+
* @generated from field: string position_id = 1;
|
|
8113
|
+
*/
|
|
8114
|
+
positionId: string;
|
|
8115
|
+
/**
|
|
8116
|
+
* @generated from field: string amount = 2;
|
|
8117
|
+
*/
|
|
8118
|
+
amount: string;
|
|
8119
|
+
constructor(data?: PartialMessage<MarginEquityAction>);
|
|
8120
|
+
static readonly runtime: typeof proto3;
|
|
8121
|
+
static readonly typeName = "trading.v1.MarginEquityAction";
|
|
8122
|
+
static readonly fields: FieldList;
|
|
8123
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginEquityAction;
|
|
8124
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginEquityAction;
|
|
8125
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginEquityAction;
|
|
8126
|
+
static equals(a: MarginEquityAction | PlainMessage<MarginEquityAction> | undefined, b: MarginEquityAction | PlainMessage<MarginEquityAction> | undefined): boolean;
|
|
8127
|
+
}
|
|
8128
|
+
/**
|
|
8129
|
+
* close. The whole position, so structurally neither a target nor an amount.
|
|
8130
|
+
*
|
|
8131
|
+
* @generated from message trading.v1.MarginPositionAction
|
|
8132
|
+
*/
|
|
8133
|
+
export declare class MarginPositionAction extends Message<MarginPositionAction> {
|
|
8134
|
+
/**
|
|
8135
|
+
* @generated from field: string position_id = 1;
|
|
8136
|
+
*/
|
|
8137
|
+
positionId: string;
|
|
8138
|
+
constructor(data?: PartialMessage<MarginPositionAction>);
|
|
8139
|
+
static readonly runtime: typeof proto3;
|
|
8140
|
+
static readonly typeName = "trading.v1.MarginPositionAction";
|
|
8141
|
+
static readonly fields: FieldList;
|
|
8142
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionAction;
|
|
8143
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionAction;
|
|
8144
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionAction;
|
|
8145
|
+
static equals(a: MarginPositionAction | PlainMessage<MarginPositionAction> | undefined, b: MarginPositionAction | PlainMessage<MarginPositionAction> | undefined): boolean;
|
|
8146
|
+
}
|
|
8147
|
+
/**
|
|
8148
|
+
* open. No position_id: the server allocates one at plan create.
|
|
8149
|
+
*
|
|
8150
|
+
* @generated from message trading.v1.MarginOpenAction
|
|
8151
|
+
*/
|
|
8152
|
+
export declare class MarginOpenAction extends Message<MarginOpenAction> {
|
|
8153
|
+
/**
|
|
8154
|
+
* @generated from field: string leverage_target = 1;
|
|
8155
|
+
*/
|
|
8156
|
+
leverageTarget: string;
|
|
8157
|
+
/**
|
|
8158
|
+
* The LENDING allowlist, distinct from `swap_config.protocols` (the AMM
|
|
8159
|
+
* allowlist for the wallet-side swap).
|
|
8160
|
+
*
|
|
8161
|
+
* @generated from field: repeated trading.v1.MarginVenue venues = 2;
|
|
8162
|
+
*/
|
|
8163
|
+
venues: MarginVenue[];
|
|
8164
|
+
/**
|
|
8165
|
+
* @generated from field: string amount = 3;
|
|
8166
|
+
*/
|
|
8167
|
+
amount: string;
|
|
8168
|
+
constructor(data?: PartialMessage<MarginOpenAction>);
|
|
8169
|
+
static readonly runtime: typeof proto3;
|
|
8170
|
+
static readonly typeName = "trading.v1.MarginOpenAction";
|
|
8171
|
+
static readonly fields: FieldList;
|
|
8172
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginOpenAction;
|
|
8173
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginOpenAction;
|
|
8174
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginOpenAction;
|
|
8175
|
+
static equals(a: MarginOpenAction | PlainMessage<MarginOpenAction> | undefined, b: MarginOpenAction | PlainMessage<MarginOpenAction> | undefined): boolean;
|
|
8176
|
+
}
|
|
8177
|
+
/**
|
|
8178
|
+
* EXECUTION POLICY for the wallet-side swap, and nothing else. It names no
|
|
8179
|
+
* token, no chain, no amount and no trade type: identity lives at the top level
|
|
8180
|
+
* in wallet_token / wallet_chain_id, the magnitude lives in the action key, and
|
|
8181
|
+
* exact-in vs exact-out follows from whether that key pays in or pays out.
|
|
8182
|
+
*
|
|
8183
|
+
* Kept separate from wallet_token because the two have different lifetimes.
|
|
8184
|
+
* wallet_token is always meaningful; this block can be moot, since paying in
|
|
8185
|
+
* the collateral token needs no funding swap at all, and whether one is needed
|
|
8186
|
+
* is a routing outcome not knowable at request time.
|
|
8187
|
+
*
|
|
8188
|
+
* @generated from message trading.v1.MarginSwapConfig
|
|
8189
|
+
*/
|
|
8190
|
+
export declare class MarginSwapConfig extends Message<MarginSwapConfig> {
|
|
8191
|
+
/**
|
|
8192
|
+
* @generated from field: optional double slippage_tolerance = 1;
|
|
8193
|
+
*/
|
|
8194
|
+
slippageTolerance?: number;
|
|
8195
|
+
/**
|
|
8196
|
+
* @generated from field: optional trading.v1.AutoSlippage auto_slippage = 2;
|
|
8197
|
+
*/
|
|
8198
|
+
autoSlippage?: AutoSlippage;
|
|
8199
|
+
/**
|
|
8200
|
+
* @generated from field: repeated trading.v1.Protocols protocols = 3;
|
|
8201
|
+
*/
|
|
8202
|
+
protocols: Protocols[];
|
|
8203
|
+
constructor(data?: PartialMessage<MarginSwapConfig>);
|
|
8204
|
+
static readonly runtime: typeof proto3;
|
|
8205
|
+
static readonly typeName = "trading.v1.MarginSwapConfig";
|
|
8206
|
+
static readonly fields: FieldList;
|
|
8207
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginSwapConfig;
|
|
8208
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginSwapConfig;
|
|
8209
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginSwapConfig;
|
|
8210
|
+
static equals(a: MarginSwapConfig | PlainMessage<MarginSwapConfig> | undefined, b: MarginSwapConfig | PlainMessage<MarginSwapConfig> | undefined): boolean;
|
|
8211
|
+
}
|
|
8212
|
+
/**
|
|
8213
|
+
* @generated from message trading.v1.MarginQuoteRequest
|
|
8214
|
+
*/
|
|
8215
|
+
export declare class MarginQuoteRequest extends Message<MarginQuoteRequest> {
|
|
8216
|
+
/**
|
|
8217
|
+
* The chain the POSITION lives on. Named rather than left as a bare chain_id
|
|
8218
|
+
* because two chains are in play: with one of them unqualified, a client
|
|
8219
|
+
* reasonably reads it as "the" chain, sets it to the chain it is paying from,
|
|
8220
|
+
* and silently gets a cross-chain funding flow it never asked for. Both are
|
|
8221
|
+
* named so both have to be stated.
|
|
8222
|
+
*
|
|
8223
|
+
* @generated from field: int32 position_chain_id = 1;
|
|
8224
|
+
*/
|
|
8225
|
+
positionChainId: number;
|
|
8226
|
+
/**
|
|
8227
|
+
* @generated from field: string exposure_token = 2;
|
|
8228
|
+
*/
|
|
8229
|
+
exposureToken: string;
|
|
8230
|
+
/**
|
|
8231
|
+
* @generated from field: string counter_token = 3;
|
|
8232
|
+
*/
|
|
8233
|
+
counterToken: string;
|
|
8234
|
+
/**
|
|
8235
|
+
* @generated from field: trading.v1.MarginDirection direction = 4;
|
|
8236
|
+
*/
|
|
8237
|
+
direction: MarginDirection;
|
|
8238
|
+
/**
|
|
8239
|
+
* @generated from field: string swapper = 5;
|
|
8240
|
+
*/
|
|
8241
|
+
swapper: string;
|
|
8242
|
+
/**
|
|
8243
|
+
* The LEVERAGE leg: the flash-accounted, debt-funded swap inside the router.
|
|
8244
|
+
* Independent of swap_config; neither defaults from the other. Always an
|
|
8245
|
+
* explicit percentage, because it derives max_debt_in / max_collateral_in,
|
|
8246
|
+
* which stamp into calldata as the MEV backstop, and a routing heuristic must
|
|
8247
|
+
* not size a binding fund-safety bound. That is why there is no
|
|
8248
|
+
* auto_slippage here and there is one inside swap_config.
|
|
8249
|
+
*
|
|
8250
|
+
* @generated from field: optional double slippage_tolerance = 6;
|
|
8251
|
+
*/
|
|
8252
|
+
slippageTolerance?: number;
|
|
8253
|
+
/**
|
|
8254
|
+
* Required iff the action has a wallet-side swap, forbidden otherwise; never
|
|
8255
|
+
* genuinely optional. Enforced structurally in Joi (with/without per key).
|
|
8256
|
+
*
|
|
8257
|
+
* @generated from field: optional trading.v1.MarginSwapConfig swap_config = 8;
|
|
8258
|
+
*/
|
|
8259
|
+
swapConfig?: MarginSwapConfig;
|
|
8260
|
+
/**
|
|
8261
|
+
* The token crossing the wallet boundary, and where it sits. Deliberately NOT
|
|
8262
|
+
* named token_in: `withdraw_equity*` and `close` pay OUT, so an "in" name
|
|
8263
|
+
* would be wrong on four of the ten keys. Flow direction is read off the
|
|
8264
|
+
* action key and never restated here. `amount` in the action key is
|
|
8265
|
+
* denominated in this token. Governed by the same per-key rules as
|
|
8266
|
+
* swap_config.
|
|
8267
|
+
*
|
|
8268
|
+
* @generated from field: optional string wallet_token = 9;
|
|
8269
|
+
*/
|
|
8270
|
+
walletToken?: string;
|
|
8271
|
+
/**
|
|
8272
|
+
* Differs from position_chain_id => cross-chain funding (pay-in only).
|
|
8273
|
+
*
|
|
8274
|
+
* @generated from field: optional int32 wallet_chain_id = 10;
|
|
8275
|
+
*/
|
|
8276
|
+
walletChainId?: number;
|
|
8277
|
+
/**
|
|
8278
|
+
* @generated from oneof trading.v1.MarginQuoteRequest.action
|
|
8279
|
+
*/
|
|
8280
|
+
action: {
|
|
8281
|
+
/**
|
|
8282
|
+
* @generated from field: trading.v1.MarginOpenAction open = 20;
|
|
8283
|
+
*/
|
|
8284
|
+
value: MarginOpenAction;
|
|
8285
|
+
case: "open";
|
|
8286
|
+
} | {
|
|
8287
|
+
/**
|
|
8288
|
+
* @generated from field: trading.v1.MarginPositionAction close = 21;
|
|
8289
|
+
*/
|
|
8290
|
+
value: MarginPositionAction;
|
|
8291
|
+
case: "close";
|
|
8292
|
+
} | {
|
|
8293
|
+
/**
|
|
8294
|
+
* @generated from field: trading.v1.MarginLeverageAction increase_leverage = 22;
|
|
8295
|
+
*/
|
|
8296
|
+
value: MarginLeverageAction;
|
|
8297
|
+
case: "increaseLeverage";
|
|
8298
|
+
} | {
|
|
8299
|
+
/**
|
|
8300
|
+
* @generated from field: trading.v1.MarginLeverageAction decrease_leverage = 23;
|
|
8301
|
+
*/
|
|
8302
|
+
value: MarginLeverageAction;
|
|
8303
|
+
case: "decreaseLeverage";
|
|
8304
|
+
} | {
|
|
8305
|
+
/**
|
|
8306
|
+
* @generated from field: trading.v1.MarginEquityAction add_equity = 24;
|
|
8307
|
+
*/
|
|
8308
|
+
value: MarginEquityAction;
|
|
8309
|
+
case: "addEquity";
|
|
8310
|
+
} | {
|
|
8311
|
+
/**
|
|
8312
|
+
* @generated from field: trading.v1.MarginEquityAction withdraw_equity = 25;
|
|
8313
|
+
*/
|
|
8314
|
+
value: MarginEquityAction;
|
|
8315
|
+
case: "withdrawEquity";
|
|
8316
|
+
} | {
|
|
8317
|
+
/**
|
|
8318
|
+
* @generated from field: trading.v1.MarginEquityLeverageAction add_equity_and_increase_leverage = 26;
|
|
8319
|
+
*/
|
|
8320
|
+
value: MarginEquityLeverageAction;
|
|
8321
|
+
case: "addEquityAndIncreaseLeverage";
|
|
8322
|
+
} | {
|
|
8323
|
+
/**
|
|
8324
|
+
* @generated from field: trading.v1.MarginEquityLeverageAction add_equity_and_decrease_leverage = 27;
|
|
8325
|
+
*/
|
|
8326
|
+
value: MarginEquityLeverageAction;
|
|
8327
|
+
case: "addEquityAndDecreaseLeverage";
|
|
8328
|
+
} | {
|
|
8329
|
+
/**
|
|
8330
|
+
* @generated from field: trading.v1.MarginEquityLeverageAction withdraw_equity_and_increase_leverage = 28;
|
|
8331
|
+
*/
|
|
8332
|
+
value: MarginEquityLeverageAction;
|
|
8333
|
+
case: "withdrawEquityAndIncreaseLeverage";
|
|
8334
|
+
} | {
|
|
8335
|
+
/**
|
|
8336
|
+
* @generated from field: trading.v1.MarginEquityLeverageAction withdraw_equity_and_decrease_leverage = 29;
|
|
8337
|
+
*/
|
|
8338
|
+
value: MarginEquityLeverageAction;
|
|
8339
|
+
case: "withdrawEquityAndDecreaseLeverage";
|
|
8340
|
+
} | {
|
|
8341
|
+
case: undefined;
|
|
8342
|
+
value?: undefined;
|
|
8343
|
+
};
|
|
8344
|
+
constructor(data?: PartialMessage<MarginQuoteRequest>);
|
|
8345
|
+
static readonly runtime: typeof proto3;
|
|
8346
|
+
static readonly typeName = "trading.v1.MarginQuoteRequest";
|
|
8347
|
+
static readonly fields: FieldList;
|
|
8348
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginQuoteRequest;
|
|
8349
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginQuoteRequest;
|
|
8350
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginQuoteRequest;
|
|
8351
|
+
static equals(a: MarginQuoteRequest | PlainMessage<MarginQuoteRequest> | undefined, b: MarginQuoteRequest | PlainMessage<MarginQuoteRequest> | undefined): boolean;
|
|
8352
|
+
}
|
|
8353
|
+
/**
|
|
8354
|
+
* The confirmed bounds for one operation. Which fields are set follows from
|
|
8355
|
+
* `type`; they are the numbers that stamp into calldata, so they are in native
|
|
8356
|
+
* token decimals (LTV and leverage are WAD).
|
|
8357
|
+
*
|
|
8358
|
+
* @generated from message trading.v1.MarginOperation
|
|
8359
|
+
*/
|
|
8360
|
+
export declare class MarginOperation extends Message<MarginOperation> {
|
|
8361
|
+
/**
|
|
8362
|
+
* @generated from field: trading.v1.MarginOperationType type = 1;
|
|
8363
|
+
*/
|
|
8364
|
+
type: MarginOperationType;
|
|
8365
|
+
/**
|
|
8366
|
+
* INCREASE_POSITION: exact-out buy, collateral asset.
|
|
8367
|
+
*
|
|
8368
|
+
* @generated from field: optional string collateral_to_buy = 2;
|
|
8369
|
+
*/
|
|
8370
|
+
collateralToBuy?: string;
|
|
8371
|
+
/**
|
|
8372
|
+
* INCREASE_POSITION: binding slippage cap on debt spent. Mandatory non-zero
|
|
8373
|
+
* on-chain; the router refuses a zero bound outright.
|
|
8374
|
+
*
|
|
8375
|
+
* @generated from field: optional string max_debt_in = 3;
|
|
8376
|
+
*/
|
|
8377
|
+
maxDebtIn?: string;
|
|
8378
|
+
/**
|
|
8379
|
+
* DECREASE_POSITION: debt cleared at the venue.
|
|
8380
|
+
*
|
|
8381
|
+
* @generated from field: optional string debt_to_repay = 4;
|
|
8382
|
+
*/
|
|
8383
|
+
debtToRepay?: string;
|
|
8384
|
+
/**
|
|
8385
|
+
* DECREASE_POSITION: cap on collateral sold, round-UP slippage pad.
|
|
8386
|
+
*
|
|
8387
|
+
* @generated from field: optional string max_collateral_in = 5;
|
|
8388
|
+
*/
|
|
8389
|
+
maxCollateralIn?: string;
|
|
8390
|
+
/**
|
|
8391
|
+
* Health assertion where one exists on-chain.
|
|
8392
|
+
*
|
|
8393
|
+
* @generated from field: optional string max_ltv_after = 6;
|
|
8394
|
+
*/
|
|
8395
|
+
maxLtvAfter?: string;
|
|
8396
|
+
/**
|
|
8397
|
+
* ADD_COLLATERAL / WITHDRAW magnitude, in the flow-native asset.
|
|
8398
|
+
*
|
|
8399
|
+
* @generated from field: optional string amount = 7;
|
|
8400
|
+
*/
|
|
8401
|
+
amount?: string;
|
|
8402
|
+
/**
|
|
8403
|
+
* Optional per-hop bound; 0 disables. 18-dec on the wire, X36 at encode.
|
|
8404
|
+
*
|
|
8405
|
+
* @generated from field: optional string min_hop_price = 8;
|
|
8406
|
+
*/
|
|
8407
|
+
minHopPrice?: string;
|
|
8408
|
+
/**
|
|
8409
|
+
* This operation's quoted fill, and the PRICE_DRIFT reference at re-stamp.
|
|
8410
|
+
*
|
|
8411
|
+
* @generated from field: optional string effective_price = 9;
|
|
8412
|
+
*/
|
|
8413
|
+
effectivePrice?: string;
|
|
8414
|
+
constructor(data?: PartialMessage<MarginOperation>);
|
|
8415
|
+
static readonly runtime: typeof proto3;
|
|
8416
|
+
static readonly typeName = "trading.v1.MarginOperation";
|
|
8417
|
+
static readonly fields: FieldList;
|
|
8418
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginOperation;
|
|
8419
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginOperation;
|
|
8420
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginOperation;
|
|
8421
|
+
static equals(a: MarginOperation | PlainMessage<MarginOperation> | undefined, b: MarginOperation | PlainMessage<MarginOperation> | undefined): boolean;
|
|
8422
|
+
}
|
|
8423
|
+
/**
|
|
8424
|
+
* @generated from message trading.v1.MarginExecutionLeg
|
|
8425
|
+
*/
|
|
8426
|
+
export declare class MarginExecutionLeg extends Message<MarginExecutionLeg> {
|
|
8427
|
+
/**
|
|
8428
|
+
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
8429
|
+
*/
|
|
8430
|
+
venue: MarginVenue;
|
|
8431
|
+
/**
|
|
8432
|
+
* Server-resolved on manage actions; absent on open until plan create
|
|
8433
|
+
* allocates it.
|
|
8434
|
+
*
|
|
8435
|
+
* @generated from field: optional string sub_id = 2;
|
|
8436
|
+
*/
|
|
8437
|
+
subId?: string;
|
|
8438
|
+
/**
|
|
8439
|
+
* Ordered. A composite action populates more than one.
|
|
8440
|
+
*
|
|
8441
|
+
* @generated from field: repeated trading.v1.MarginOperation operations = 3;
|
|
8442
|
+
*/
|
|
8443
|
+
operations: MarginOperation[];
|
|
8444
|
+
constructor(data?: PartialMessage<MarginExecutionLeg>);
|
|
8445
|
+
static readonly runtime: typeof proto3;
|
|
8446
|
+
static readonly typeName = "trading.v1.MarginExecutionLeg";
|
|
8447
|
+
static readonly fields: FieldList;
|
|
8448
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginExecutionLeg;
|
|
8449
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginExecutionLeg;
|
|
8450
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginExecutionLeg;
|
|
8451
|
+
static equals(a: MarginExecutionLeg | PlainMessage<MarginExecutionLeg> | undefined, b: MarginExecutionLeg | PlainMessage<MarginExecutionLeg> | undefined): boolean;
|
|
8452
|
+
}
|
|
8453
|
+
/**
|
|
8454
|
+
* The wallet-side swap as priced, in the same shape /quote uses for an ordinary
|
|
8455
|
+
* swap, so the funding leg reads natively rather than inventing a fourth
|
|
8456
|
+
* swap-quote vocabulary.
|
|
8457
|
+
*
|
|
8458
|
+
* Present IFF a swap was actually priced, so its presence is the signal that
|
|
8459
|
+
* one happened. Absent when the action moves no equity, and absent when the
|
|
8460
|
+
* caller already holds the collateral: paying in the collateral itself needs no
|
|
8461
|
+
* funding swap, and a block whose input and output name the same token and the
|
|
8462
|
+
* same amount describes no trade.
|
|
8463
|
+
*
|
|
8464
|
+
* 7 was auto_slippage: a request-side mode, never an answer. What a caller
|
|
8465
|
+
* needs back is the percent it RESOLVED to, which slippage_tolerance already
|
|
8466
|
+
* carries.
|
|
8467
|
+
* 8 was protocols: an echo of the request that no consumer read, and as a
|
|
8468
|
+
* repeated field it serializes as [] whether the caller named none or the
|
|
8469
|
+
* route used none, so it could not carry its own meaning.
|
|
8470
|
+
*
|
|
8471
|
+
* @generated from message trading.v1.MarginFunding
|
|
8472
|
+
*/
|
|
8473
|
+
export declare class MarginFunding extends Message<MarginFunding> {
|
|
8474
|
+
/**
|
|
8475
|
+
* @generated from field: int32 token_in_chain_id = 1;
|
|
8476
|
+
*/
|
|
8477
|
+
tokenInChainId: number;
|
|
8478
|
+
/**
|
|
8479
|
+
* @generated from field: trading.v1.QuoteInput input = 3;
|
|
8480
|
+
*/
|
|
8481
|
+
input?: QuoteInput;
|
|
8482
|
+
/**
|
|
8483
|
+
* @generated from field: trading.v1.QuoteOutput output = 4;
|
|
8484
|
+
*/
|
|
8485
|
+
output?: QuoteOutput;
|
|
8486
|
+
/**
|
|
8487
|
+
* The tolerance the floor was derived at, which is what POST /plan
|
|
8488
|
+
* re-derives against. Present even when the request asked for auto.
|
|
8489
|
+
*
|
|
8490
|
+
* @generated from field: optional double slippage_tolerance = 6;
|
|
8491
|
+
*/
|
|
8492
|
+
slippageTolerance?: number;
|
|
8493
|
+
/**
|
|
8494
|
+
* Cross-chain pay-in only: the guaranteed bridge floor.
|
|
8495
|
+
*
|
|
8496
|
+
* @generated from field: optional string min_bridge_out = 9;
|
|
8497
|
+
*/
|
|
8498
|
+
minBridgeOut?: string;
|
|
8499
|
+
/**
|
|
8500
|
+
* Percent, as /quote reports it: how far this swap lands from the pool's
|
|
8501
|
+
* price. Reported, never refused. This leg spends the caller's own money at
|
|
8502
|
+
* the tolerance they chose, unlike the leverage leg, whose impact is
|
|
8503
|
+
* multiplied by leverage and is refused past a ceiling.
|
|
8504
|
+
*
|
|
8505
|
+
* @generated from field: optional double price_impact = 10;
|
|
8506
|
+
*/
|
|
8507
|
+
priceImpact?: number;
|
|
8508
|
+
constructor(data?: PartialMessage<MarginFunding>);
|
|
8509
|
+
static readonly runtime: typeof proto3;
|
|
8510
|
+
static readonly typeName = "trading.v1.MarginFunding";
|
|
8511
|
+
static readonly fields: FieldList;
|
|
8512
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginFunding;
|
|
8513
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginFunding;
|
|
8514
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginFunding;
|
|
8515
|
+
static equals(a: MarginFunding | PlainMessage<MarginFunding> | undefined, b: MarginFunding | PlainMessage<MarginFunding> | undefined): boolean;
|
|
8516
|
+
}
|
|
8517
|
+
/**
|
|
8518
|
+
* Everything POST /plan needs, and nothing it does not. This subtree is what a
|
|
8519
|
+
* client echoes back to create a plan; `display` never is.
|
|
8520
|
+
*
|
|
8521
|
+
* @generated from message trading.v1.MarginExecution
|
|
8522
|
+
*/
|
|
8523
|
+
export declare class MarginExecution extends Message<MarginExecution> {
|
|
8524
|
+
/**
|
|
8525
|
+
* @generated from field: int32 position_chain_id = 1;
|
|
8526
|
+
*/
|
|
8527
|
+
positionChainId: number;
|
|
8528
|
+
/**
|
|
8529
|
+
* @generated from field: string swapper = 2;
|
|
8530
|
+
*/
|
|
8531
|
+
swapper: string;
|
|
8532
|
+
/**
|
|
8533
|
+
* @generated from field: string exposure_token = 3;
|
|
8534
|
+
*/
|
|
8535
|
+
exposureToken: string;
|
|
8536
|
+
/**
|
|
8537
|
+
* @generated from field: string counter_token = 4;
|
|
8538
|
+
*/
|
|
8539
|
+
counterToken: string;
|
|
8540
|
+
/**
|
|
8541
|
+
* @generated from field: trading.v1.MarginDirection direction = 5;
|
|
8542
|
+
*/
|
|
8543
|
+
direction: MarginDirection;
|
|
8544
|
+
/**
|
|
8545
|
+
* @generated from field: trading.v1.MarginIntent intent = 6;
|
|
8546
|
+
*/
|
|
8547
|
+
intent: MarginIntent;
|
|
8548
|
+
/**
|
|
8549
|
+
* Absent on open.
|
|
8550
|
+
*
|
|
8551
|
+
* @generated from field: optional string position_id = 7;
|
|
8552
|
+
*/
|
|
8553
|
+
positionId?: string;
|
|
8554
|
+
/**
|
|
8555
|
+
* Present iff the action names a leverage direction.
|
|
8556
|
+
*
|
|
8557
|
+
* @generated from field: optional string leverage_target = 8;
|
|
8558
|
+
*/
|
|
8559
|
+
leverageTarget?: string;
|
|
8560
|
+
/**
|
|
8561
|
+
* The leverage leg's confirmed control, and only the tolerance. There is no
|
|
8562
|
+
* AMM allowlist here: the leverage leg is v4 by construction, since route
|
|
8563
|
+
* discovery keeps only v4 pools and the price is re-quoted through the v4
|
|
8564
|
+
* quoter, so it could not honour one. The wallet-side swap is a real
|
|
8565
|
+
* aggregator swap and carries its own in swap_config.protocols.
|
|
8566
|
+
*
|
|
8567
|
+
* @generated from field: optional double slippage_tolerance = 9;
|
|
8568
|
+
*/
|
|
8569
|
+
slippageTolerance?: number;
|
|
8570
|
+
/**
|
|
8571
|
+
* @generated from field: optional trading.v1.MarginFunding funding = 11;
|
|
8572
|
+
*/
|
|
8573
|
+
funding?: MarginFunding;
|
|
8574
|
+
/**
|
|
8575
|
+
* @generated from field: repeated trading.v1.MarginExecutionLeg legs = 12;
|
|
8576
|
+
*/
|
|
8577
|
+
legs: MarginExecutionLeg[];
|
|
8578
|
+
constructor(data?: PartialMessage<MarginExecution>);
|
|
8579
|
+
static readonly runtime: typeof proto3;
|
|
8580
|
+
static readonly typeName = "trading.v1.MarginExecution";
|
|
8581
|
+
static readonly fields: FieldList;
|
|
8582
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginExecution;
|
|
8583
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginExecution;
|
|
8584
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginExecution;
|
|
8585
|
+
static equals(a: MarginExecution | PlainMessage<MarginExecution> | undefined, b: MarginExecution | PlainMessage<MarginExecution> | undefined): boolean;
|
|
8586
|
+
}
|
|
8587
|
+
/**
|
|
8588
|
+
* What the confirmation modal renders. Projections of the position IF this
|
|
8589
|
+
* action executes; present state lives on GET /margin/positions. Ignored by
|
|
8590
|
+
* POST /plan: projections are not execution inputs.
|
|
8591
|
+
*
|
|
8592
|
+
* @generated from message trading.v1.MarginDisplay
|
|
8593
|
+
*/
|
|
8594
|
+
export declare class MarginDisplay extends Message<MarginDisplay> {
|
|
8595
|
+
/**
|
|
8596
|
+
* Exposure asset, summed across legs.
|
|
8597
|
+
*
|
|
8598
|
+
* @generated from field: optional string size = 1;
|
|
8599
|
+
*/
|
|
8600
|
+
size?: string;
|
|
8601
|
+
/**
|
|
8602
|
+
* Position / equity, decimal string as on the request.
|
|
8603
|
+
*
|
|
8604
|
+
* @generated from field: optional string leverage = 2;
|
|
8605
|
+
*/
|
|
8606
|
+
leverage?: string;
|
|
8607
|
+
/**
|
|
8608
|
+
* Quoted fill incl. fees, impact and slippage. Size-weighted across legs.
|
|
8609
|
+
*
|
|
8610
|
+
* @generated from field: optional string effective_price = 3;
|
|
8611
|
+
*/
|
|
8612
|
+
effectivePrice?: string;
|
|
8613
|
+
/**
|
|
8614
|
+
* Oracle price at which LTV = LLTV. Multi-leg: the nearest leg's, because
|
|
8615
|
+
* legs liquidate independently.
|
|
8616
|
+
*
|
|
8617
|
+
* @generated from field: optional string liquidation_price = 4;
|
|
8618
|
+
*/
|
|
8619
|
+
liquidationPrice?: string;
|
|
8620
|
+
/**
|
|
8621
|
+
* collateral x LLTV / debt; liquidatable below 1. Nearest leg. The one risk
|
|
8622
|
+
* number that normalizes across venues, so it is what the client bands into
|
|
8623
|
+
* Healthy / Caution / Risky. The band thresholds are a product call and stay
|
|
8624
|
+
* client-side.
|
|
8625
|
+
*
|
|
8626
|
+
* @generated from field: optional string health_factor = 6;
|
|
8627
|
+
*/
|
|
8628
|
+
healthFactor?: string;
|
|
8629
|
+
/**
|
|
8630
|
+
* Annualized borrow rate on the debt, size-weighted across legs.
|
|
8631
|
+
*
|
|
8632
|
+
* @generated from field: optional string borrow_rate = 7;
|
|
8633
|
+
*/
|
|
8634
|
+
borrowRate?: string;
|
|
8635
|
+
/**
|
|
8636
|
+
* Venue liquidation-reference price.
|
|
8637
|
+
*
|
|
8638
|
+
* @generated from field: optional string oracle_price = 8;
|
|
8639
|
+
*/
|
|
8640
|
+
oraclePrice?: string;
|
|
8641
|
+
/**
|
|
8642
|
+
* close only.
|
|
8643
|
+
*
|
|
8644
|
+
* @generated from field: optional string collateral_returned = 9;
|
|
8645
|
+
*/
|
|
8646
|
+
collateralReturned?: string;
|
|
8647
|
+
/**
|
|
8648
|
+
* @generated from field: optional string debt_repaid = 10;
|
|
8649
|
+
*/
|
|
8650
|
+
debtRepaid?: string;
|
|
8651
|
+
constructor(data?: PartialMessage<MarginDisplay>);
|
|
8652
|
+
static readonly runtime: typeof proto3;
|
|
8653
|
+
static readonly typeName = "trading.v1.MarginDisplay";
|
|
8654
|
+
static readonly fields: FieldList;
|
|
8655
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginDisplay;
|
|
8656
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginDisplay;
|
|
8657
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginDisplay;
|
|
8658
|
+
static equals(a: MarginDisplay | PlainMessage<MarginDisplay> | undefined, b: MarginDisplay | PlainMessage<MarginDisplay> | undefined): boolean;
|
|
8659
|
+
}
|
|
8660
|
+
/**
|
|
8661
|
+
* @generated from message trading.v1.MarginQuoteResponse
|
|
8662
|
+
*/
|
|
8663
|
+
export declare class MarginQuoteResponse extends Message<MarginQuoteResponse> {
|
|
8664
|
+
/**
|
|
8665
|
+
* @generated from field: string request_id = 1;
|
|
8666
|
+
*/
|
|
8667
|
+
requestId: string;
|
|
8668
|
+
/**
|
|
8669
|
+
* @generated from field: trading.v1.MarginExecution execution = 2;
|
|
8670
|
+
*/
|
|
8671
|
+
execution?: MarginExecution;
|
|
8672
|
+
/**
|
|
8673
|
+
* @generated from field: trading.v1.MarginDisplay display = 3;
|
|
8674
|
+
*/
|
|
8675
|
+
display?: MarginDisplay;
|
|
8676
|
+
/**
|
|
8677
|
+
* Indicative.
|
|
8678
|
+
*
|
|
8679
|
+
* @generated from field: optional trading.v1.GasEstimate gas_estimate = 4;
|
|
8680
|
+
*/
|
|
8681
|
+
gasEstimate?: GasEstimate;
|
|
8682
|
+
constructor(data?: PartialMessage<MarginQuoteResponse>);
|
|
8683
|
+
static readonly runtime: typeof proto3;
|
|
8684
|
+
static readonly typeName = "trading.v1.MarginQuoteResponse";
|
|
8685
|
+
static readonly fields: FieldList;
|
|
8686
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginQuoteResponse;
|
|
8687
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginQuoteResponse;
|
|
8688
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginQuoteResponse;
|
|
8689
|
+
static equals(a: MarginQuoteResponse | PlainMessage<MarginQuoteResponse> | undefined, b: MarginQuoteResponse | PlainMessage<MarginQuoteResponse> | undefined): boolean;
|
|
8690
|
+
}
|
|
8691
|
+
/**
|
|
8692
|
+
* One venue's share of a position. Legs are the unit of truth: a logical
|
|
8693
|
+
* position is an aggregation performed at read time, and legs liquidate
|
|
8694
|
+
* independently, so the row's risk numbers are the NEAREST leg's.
|
|
8695
|
+
*
|
|
8696
|
+
* @generated from message trading.v1.MarginPositionLeg
|
|
8697
|
+
*/
|
|
8698
|
+
export declare class MarginPositionLeg extends Message<MarginPositionLeg> {
|
|
8699
|
+
/**
|
|
8700
|
+
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
8701
|
+
*/
|
|
8702
|
+
venue: MarginVenue;
|
|
8703
|
+
/**
|
|
8704
|
+
* The `positionId` handle every action key echoes back. Returned whether or
|
|
8705
|
+
* not a screen renders it.
|
|
8706
|
+
*
|
|
8707
|
+
* @generated from field: string sub_id = 2;
|
|
8708
|
+
*/
|
|
8709
|
+
subId: string;
|
|
8710
|
+
/**
|
|
8711
|
+
* The MarginAccount this leg lives at, derived offchain from (owner, subId).
|
|
8712
|
+
*
|
|
8713
|
+
* @generated from field: string account = 3;
|
|
8714
|
+
*/
|
|
8715
|
+
account: string;
|
|
8716
|
+
/**
|
|
8717
|
+
* @generated from field: string debt = 4;
|
|
8718
|
+
*/
|
|
8719
|
+
debt: string;
|
|
8720
|
+
/**
|
|
8721
|
+
* Best effort, like the markets feed: absent when the venue's rate read did
|
|
8722
|
+
* not return, never zero, because an unread rate and a zero rate differ.
|
|
8723
|
+
*
|
|
8724
|
+
* @generated from field: optional string borrow_rate = 5;
|
|
8725
|
+
*/
|
|
8726
|
+
borrowRate?: string;
|
|
8727
|
+
constructor(data?: PartialMessage<MarginPositionLeg>);
|
|
8728
|
+
static readonly runtime: typeof proto3;
|
|
8729
|
+
static readonly typeName = "trading.v1.MarginPositionLeg";
|
|
8730
|
+
static readonly fields: FieldList;
|
|
8731
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionLeg;
|
|
8732
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionLeg;
|
|
8733
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionLeg;
|
|
8734
|
+
static equals(a: MarginPositionLeg | PlainMessage<MarginPositionLeg> | undefined, b: MarginPositionLeg | PlainMessage<MarginPositionLeg> | undefined): boolean;
|
|
8735
|
+
}
|
|
8736
|
+
/**
|
|
8737
|
+
* One logical position, keyed (exposure_token, counter_token, direction) — the
|
|
8738
|
+
* same key the markets cursor orders on, which is why both endpoints page
|
|
8739
|
+
* through `marginMarketCursor`.
|
|
8740
|
+
*
|
|
8741
|
+
* @generated from message trading.v1.MarginPositionRow
|
|
8742
|
+
*/
|
|
8743
|
+
export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
8744
|
+
/**
|
|
8745
|
+
* @generated from field: trading.v1.MarginPositionStatus status = 1;
|
|
8746
|
+
*/
|
|
8747
|
+
status: MarginPositionStatus;
|
|
8748
|
+
/**
|
|
8749
|
+
* @generated from field: trading.v1.MarginDirection direction = 2;
|
|
8750
|
+
*/
|
|
8751
|
+
direction: MarginDirection;
|
|
8752
|
+
/**
|
|
8753
|
+
* @generated from field: trading.v1.MarginTokenMetadata exposure_token = 3;
|
|
8754
|
+
*/
|
|
8755
|
+
exposureToken?: MarginTokenMetadata;
|
|
8756
|
+
/**
|
|
8757
|
+
* @generated from field: trading.v1.MarginTokenMetadata counter_token = 4;
|
|
8758
|
+
*/
|
|
8759
|
+
counterToken?: MarginTokenMetadata;
|
|
8760
|
+
/**
|
|
8761
|
+
* @generated from field: string size = 5;
|
|
8762
|
+
*/
|
|
8763
|
+
size: string;
|
|
8764
|
+
/**
|
|
8765
|
+
* @generated from field: repeated trading.v1.MarginPositionLeg legs = 6;
|
|
8766
|
+
*/
|
|
8767
|
+
legs: MarginPositionLeg[];
|
|
8768
|
+
/**
|
|
8769
|
+
* COST BASIS. Needs the margin event consumer, which is not on the launch
|
|
8770
|
+
* path, so every field here is absent in v1 rather than zero.
|
|
8771
|
+
*
|
|
8772
|
+
* @generated from field: optional string entry_price = 7;
|
|
8773
|
+
*/
|
|
8774
|
+
entryPrice?: string;
|
|
8775
|
+
/**
|
|
8776
|
+
* @generated from field: optional int64 opened_at = 8;
|
|
8777
|
+
*/
|
|
8778
|
+
openedAt?: bigint;
|
|
8779
|
+
/**
|
|
8780
|
+
* @generated from field: optional string accrued_interest = 9;
|
|
8781
|
+
*/
|
|
8782
|
+
accruedInterest?: string;
|
|
8783
|
+
/**
|
|
8784
|
+
* @generated from field: optional string unrealized_pnl = 10;
|
|
8785
|
+
*/
|
|
8786
|
+
unrealizedPnl?: string;
|
|
8787
|
+
/**
|
|
8788
|
+
* @generated from field: optional string roe = 11;
|
|
8789
|
+
*/
|
|
8790
|
+
roe?: string;
|
|
8791
|
+
/**
|
|
8792
|
+
* ACTIVE only. Read on chain per request, never cached: a stale health factor
|
|
8793
|
+
* is the one number a caller must not act on.
|
|
8794
|
+
*
|
|
8795
|
+
* @generated from field: optional string equity = 12;
|
|
8796
|
+
*/
|
|
8797
|
+
equity?: string;
|
|
8798
|
+
/**
|
|
8799
|
+
* @generated from field: optional string leverage = 13;
|
|
8800
|
+
*/
|
|
8801
|
+
leverage?: string;
|
|
8802
|
+
/**
|
|
8803
|
+
* @generated from field: optional string oracle_price = 14;
|
|
8804
|
+
*/
|
|
8805
|
+
oraclePrice?: string;
|
|
8806
|
+
/**
|
|
8807
|
+
* Nearest leg. In TRADER terms, so a short's mark and liquidation price are
|
|
8808
|
+
* both reciprocated; see `displayRiskPrices`.
|
|
8809
|
+
*
|
|
8810
|
+
* @generated from field: optional string liquidation_price = 15;
|
|
8811
|
+
*/
|
|
8812
|
+
liquidationPrice?: string;
|
|
8813
|
+
/**
|
|
8814
|
+
* @generated from field: optional string buffer = 16;
|
|
8815
|
+
*/
|
|
8816
|
+
buffer?: string;
|
|
8817
|
+
/**
|
|
8818
|
+
* @generated from field: optional string health_factor = 17;
|
|
8819
|
+
*/
|
|
8820
|
+
healthFactor?: string;
|
|
8821
|
+
/**
|
|
8822
|
+
* @generated from field: optional string borrow_rate = 18;
|
|
8823
|
+
*/
|
|
8824
|
+
borrowRate?: string;
|
|
8825
|
+
/**
|
|
8826
|
+
* Health-floor bounded, server-computed. There is no on-chain guard on a
|
|
8827
|
+
* withdraw, so the ceiling has to come from here rather than from a quote.
|
|
8828
|
+
*
|
|
8829
|
+
* @generated from field: optional string max_withdrawable = 19;
|
|
8830
|
+
*/
|
|
8831
|
+
maxWithdrawable?: string;
|
|
8832
|
+
/**
|
|
8833
|
+
* TERMINAL only, and likewise cost-basis derived.
|
|
8834
|
+
*
|
|
8835
|
+
* @generated from field: optional int64 closed_at = 20;
|
|
8836
|
+
*/
|
|
8837
|
+
closedAt?: bigint;
|
|
8838
|
+
/**
|
|
8839
|
+
* @generated from field: optional string exit_price = 21;
|
|
8840
|
+
*/
|
|
8841
|
+
exitPrice?: string;
|
|
8842
|
+
/**
|
|
8843
|
+
* @generated from field: optional string realized_pnl = 22;
|
|
8844
|
+
*/
|
|
8845
|
+
realizedPnl?: string;
|
|
8846
|
+
constructor(data?: PartialMessage<MarginPositionRow>);
|
|
8847
|
+
static readonly runtime: typeof proto3;
|
|
8848
|
+
static readonly typeName = "trading.v1.MarginPositionRow";
|
|
8849
|
+
static readonly fields: FieldList;
|
|
8850
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionRow;
|
|
8851
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionRow;
|
|
8852
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionRow;
|
|
8853
|
+
static equals(a: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined, b: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined): boolean;
|
|
8854
|
+
}
|
|
8855
|
+
/**
|
|
8856
|
+
* Collateral parked at a MarginAccount whose open never completed. Derived from
|
|
8857
|
+
* the chain rather than the plan store, so it survives plan-row expiry and is
|
|
8858
|
+
* visible from any device.
|
|
8859
|
+
*
|
|
8860
|
+
* @generated from message trading.v1.MarginIncompleteOpen
|
|
8861
|
+
*/
|
|
8862
|
+
export declare class MarginIncompleteOpen extends Message<MarginIncompleteOpen> {
|
|
8863
|
+
/**
|
|
8864
|
+
* @generated from field: string account = 1;
|
|
8865
|
+
*/
|
|
8866
|
+
account: string;
|
|
8867
|
+
/**
|
|
8868
|
+
* @generated from field: string sub_id = 2;
|
|
8869
|
+
*/
|
|
8870
|
+
subId: string;
|
|
8871
|
+
/**
|
|
8872
|
+
* False when the account holds a balance but was never deployed, which is the
|
|
8873
|
+
* window this surface exists for: pre-swap delivered, position not opened.
|
|
8874
|
+
*
|
|
8875
|
+
* @generated from field: bool deployed = 3;
|
|
8876
|
+
*/
|
|
8877
|
+
deployed: boolean;
|
|
8878
|
+
/**
|
|
8879
|
+
* @generated from field: trading.v1.MarginTokenMetadata token = 4;
|
|
8880
|
+
*/
|
|
8881
|
+
token?: MarginTokenMetadata;
|
|
8882
|
+
/**
|
|
8883
|
+
* @generated from field: string amount = 5;
|
|
8884
|
+
*/
|
|
8885
|
+
amount: string;
|
|
8886
|
+
constructor(data?: PartialMessage<MarginIncompleteOpen>);
|
|
8887
|
+
static readonly runtime: typeof proto3;
|
|
8888
|
+
static readonly typeName = "trading.v1.MarginIncompleteOpen";
|
|
8889
|
+
static readonly fields: FieldList;
|
|
8890
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginIncompleteOpen;
|
|
8891
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginIncompleteOpen;
|
|
8892
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginIncompleteOpen;
|
|
8893
|
+
static equals(a: MarginIncompleteOpen | PlainMessage<MarginIncompleteOpen> | undefined, b: MarginIncompleteOpen | PlainMessage<MarginIncompleteOpen> | undefined): boolean;
|
|
8894
|
+
}
|
|
8895
|
+
/**
|
|
8896
|
+
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|
|
8897
|
+
* this response: session-scoped and TTL-bound, so absent rather than wrong once
|
|
8898
|
+
* a row ages out. Acceptable only because no funds are at risk in that state.
|
|
8899
|
+
*
|
|
8900
|
+
* @generated from message trading.v1.MarginPendingPlan
|
|
8901
|
+
*/
|
|
8902
|
+
export declare class MarginPendingPlan extends Message<MarginPendingPlan> {
|
|
8903
|
+
/**
|
|
8904
|
+
* @generated from field: string plan_id = 1;
|
|
8905
|
+
*/
|
|
8906
|
+
planId: string;
|
|
8907
|
+
/**
|
|
8908
|
+
* @generated from field: int64 created_at = 2;
|
|
8909
|
+
*/
|
|
8910
|
+
createdAt: bigint;
|
|
8911
|
+
/**
|
|
8912
|
+
* @generated from field: int32 current_step = 3;
|
|
8913
|
+
*/
|
|
8914
|
+
currentStep: number;
|
|
8915
|
+
/**
|
|
8916
|
+
* @generated from field: bool cancellable = 4;
|
|
8917
|
+
*/
|
|
8918
|
+
cancellable: boolean;
|
|
8919
|
+
constructor(data?: PartialMessage<MarginPendingPlan>);
|
|
8920
|
+
static readonly runtime: typeof proto3;
|
|
8921
|
+
static readonly typeName = "trading.v1.MarginPendingPlan";
|
|
8922
|
+
static readonly fields: FieldList;
|
|
8923
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPendingPlan;
|
|
8924
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPendingPlan;
|
|
8925
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPendingPlan;
|
|
8926
|
+
static equals(a: MarginPendingPlan | PlainMessage<MarginPendingPlan> | undefined, b: MarginPendingPlan | PlainMessage<MarginPendingPlan> | undefined): boolean;
|
|
8927
|
+
}
|
|
8928
|
+
/**
|
|
8929
|
+
* @generated from message trading.v1.MarginPositionsRequest
|
|
8930
|
+
*/
|
|
8931
|
+
export declare class MarginPositionsRequest extends Message<MarginPositionsRequest> {
|
|
8932
|
+
/**
|
|
8933
|
+
* @generated from field: string swapper = 1;
|
|
8934
|
+
*/
|
|
8935
|
+
swapper: string;
|
|
8936
|
+
/**
|
|
8937
|
+
* @generated from field: int32 chain_id = 2;
|
|
8938
|
+
*/
|
|
8939
|
+
chainId: number;
|
|
8940
|
+
/**
|
|
8941
|
+
* Selects the tab. Unset is ACTIVE; explicit presence so the server can tell
|
|
8942
|
+
* "not asked" from "asked for ACTIVE".
|
|
8943
|
+
*
|
|
8944
|
+
* @generated from field: optional trading.v1.MarginPositionStatus status = 3;
|
|
8945
|
+
*/
|
|
8946
|
+
status?: MarginPositionStatus;
|
|
8947
|
+
/**
|
|
8948
|
+
* Opaque; echo `next_cursor` back verbatim. Keyset over the row order, the
|
|
8949
|
+
* same contract `GET /margin/markets` uses.
|
|
8950
|
+
*
|
|
8951
|
+
* @generated from field: optional string cursor = 4;
|
|
8952
|
+
*/
|
|
8953
|
+
cursor?: string;
|
|
8954
|
+
/**
|
|
8955
|
+
* @generated from field: optional int32 limit = 5;
|
|
8956
|
+
*/
|
|
8957
|
+
limit?: number;
|
|
8958
|
+
constructor(data?: PartialMessage<MarginPositionsRequest>);
|
|
8959
|
+
static readonly runtime: typeof proto3;
|
|
8960
|
+
static readonly typeName = "trading.v1.MarginPositionsRequest";
|
|
8961
|
+
static readonly fields: FieldList;
|
|
8962
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionsRequest;
|
|
8963
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionsRequest;
|
|
8964
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionsRequest;
|
|
8965
|
+
static equals(a: MarginPositionsRequest | PlainMessage<MarginPositionsRequest> | undefined, b: MarginPositionsRequest | PlainMessage<MarginPositionsRequest> | undefined): boolean;
|
|
8966
|
+
}
|
|
8967
|
+
/**
|
|
8968
|
+
* @generated from message trading.v1.MarginPositionsResponse
|
|
8969
|
+
*/
|
|
8970
|
+
export declare class MarginPositionsResponse extends Message<MarginPositionsResponse> {
|
|
8971
|
+
/**
|
|
8972
|
+
* @generated from field: string request_id = 1;
|
|
8973
|
+
*/
|
|
8974
|
+
requestId: string;
|
|
8975
|
+
/**
|
|
8976
|
+
* @generated from field: repeated trading.v1.MarginPositionRow positions = 2;
|
|
8977
|
+
*/
|
|
8978
|
+
positions: MarginPositionRow[];
|
|
8979
|
+
/**
|
|
8980
|
+
* Absent on the last page. Present means more rows exist, never that the next
|
|
8981
|
+
* page is non-empty.
|
|
8982
|
+
*
|
|
8983
|
+
* @generated from field: optional string next_cursor = 3;
|
|
8984
|
+
*/
|
|
8985
|
+
nextCursor?: string;
|
|
8986
|
+
/**
|
|
8987
|
+
* Both recovery surfaces serialize as [] when the read ran and found nothing.
|
|
8988
|
+
* They cannot express "not read": a degraded read logs a warning and reports
|
|
8989
|
+
* empty, matching how the markets feed degrades a failed venue.
|
|
8990
|
+
*
|
|
8991
|
+
* @generated from field: repeated trading.v1.MarginIncompleteOpen incomplete_opens = 4;
|
|
8992
|
+
*/
|
|
8993
|
+
incompleteOpens: MarginIncompleteOpen[];
|
|
8994
|
+
/**
|
|
8995
|
+
* @generated from field: repeated trading.v1.MarginPendingPlan pending_plans = 5;
|
|
8996
|
+
*/
|
|
8997
|
+
pendingPlans: MarginPendingPlan[];
|
|
8998
|
+
constructor(data?: PartialMessage<MarginPositionsResponse>);
|
|
8999
|
+
static readonly runtime: typeof proto3;
|
|
9000
|
+
static readonly typeName = "trading.v1.MarginPositionsResponse";
|
|
9001
|
+
static readonly fields: FieldList;
|
|
9002
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionsResponse;
|
|
9003
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionsResponse;
|
|
9004
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionsResponse;
|
|
9005
|
+
static equals(a: MarginPositionsResponse | PlainMessage<MarginPositionsResponse> | undefined, b: MarginPositionsResponse | PlainMessage<MarginPositionsResponse> | undefined): boolean;
|
|
9006
|
+
}
|