@compass-labs/api-sdk 2.2.110 → 2.2.112-rc.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/commonjs/models/components/accountsummary.d.ts +2 -3
- package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -1
- package/dist/commonjs/models/components/accountsummary.js.map +1 -1
- package/dist/commonjs/models/components/collateralposition.d.ts +2 -3
- package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/collateralposition.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.d.ts +2 -3
- package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +2 -3
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +2 -3
- package/dist/commonjs/models/components/creditenablecollateralparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditenablecollateralparams.js.map +1 -1
- package/dist/commonjs/models/components/creditlooprequest.d.ts +2 -3
- package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditlooprequest.js.map +1 -1
- package/dist/commonjs/models/components/creditprotocol.d.ts +4 -6
- package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditprotocol.js +2 -3
- package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.d.ts +2 -3
- package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +2 -3
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.d.ts +2 -3
- package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
- package/dist/commonjs/models/components/creditunlooprequest.d.ts +2 -3
- package/dist/commonjs/models/components/creditunlooprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditunlooprequest.js.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts +2 -3
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
- package/dist/commonjs/models/components/debtposition.d.ts +2 -3
- package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/debtposition.js.map +1 -1
- package/dist/commonjs/models/components/loopedposition.d.ts +2 -3
- package/dist/commonjs/models/components/loopedposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/loopedposition.js.map +1 -1
- package/dist/commonjs/models/components/rebalancetarget.d.ts +17 -3
- package/dist/commonjs/models/components/rebalancetarget.d.ts.map +1 -1
- package/dist/commonjs/models/components/rebalancetarget.js +6 -0
- package/dist/commonjs/models/components/rebalancetarget.js.map +1 -1
- package/dist/commonjs/models/components/rebalancetargetpreview.d.ts +17 -6
- package/dist/commonjs/models/components/rebalancetargetpreview.d.ts.map +1 -1
- package/dist/commonjs/models/components/rebalancetargetpreview.js +7 -1
- package/dist/commonjs/models/components/rebalancetargetpreview.js.map +1 -1
- package/dist/esm/models/components/accountsummary.d.ts +2 -3
- package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
- package/dist/esm/models/components/accountsummary.js.map +1 -1
- package/dist/esm/models/components/collateralposition.d.ts +2 -3
- package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
- package/dist/esm/models/components/collateralposition.js.map +1 -1
- package/dist/esm/models/components/creditborrowparams.d.ts +2 -3
- package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowparams.js.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.d.ts +2 -3
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
- package/dist/esm/models/components/creditenablecollateralparams.d.ts +2 -3
- package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
- package/dist/esm/models/components/creditlooprequest.d.ts +2 -3
- package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditlooprequest.js.map +1 -1
- package/dist/esm/models/components/creditprotocol.d.ts +4 -6
- package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/esm/models/components/creditprotocol.js +2 -3
- package/dist/esm/models/components/creditprotocol.js.map +1 -1
- package/dist/esm/models/components/creditrepayparams.d.ts +2 -3
- package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayparams.js.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.d.ts +2 -3
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.d.ts +2 -3
- package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
- package/dist/esm/models/components/creditunlooprequest.d.ts +2 -3
- package/dist/esm/models/components/creditunlooprequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditunlooprequest.js.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.d.ts +2 -3
- package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
- package/dist/esm/models/components/debtposition.d.ts +2 -3
- package/dist/esm/models/components/debtposition.d.ts.map +1 -1
- package/dist/esm/models/components/debtposition.js.map +1 -1
- package/dist/esm/models/components/loopedposition.d.ts +2 -3
- package/dist/esm/models/components/loopedposition.d.ts.map +1 -1
- package/dist/esm/models/components/loopedposition.js.map +1 -1
- package/dist/esm/models/components/rebalancetarget.d.ts +17 -3
- package/dist/esm/models/components/rebalancetarget.d.ts.map +1 -1
- package/dist/esm/models/components/rebalancetarget.js +6 -0
- package/dist/esm/models/components/rebalancetarget.js.map +1 -1
- package/dist/esm/models/components/rebalancetargetpreview.d.ts +17 -6
- package/dist/esm/models/components/rebalancetargetpreview.d.ts.map +1 -1
- package/dist/esm/models/components/rebalancetargetpreview.js +7 -1
- package/dist/esm/models/components/rebalancetargetpreview.js.map +1 -1
- package/docs/models/components/accountsummary.md +11 -11
- package/docs/models/components/collateralposition.md +17 -17
- package/docs/models/components/creditborrowparams.md +11 -11
- package/docs/models/components/creditborrowrequest.md +21 -21
- package/docs/models/components/creditenablecollateralparams.md +7 -7
- package/docs/models/components/creditlooprequest.md +19 -19
- package/docs/models/components/creditprotocol.md +2 -3
- package/docs/models/components/creditrepayparams.md +10 -10
- package/docs/models/components/creditrepayrequest.md +20 -20
- package/docs/models/components/creditsupplyparams.md +9 -9
- package/docs/models/components/creditunlooprequest.md +17 -17
- package/docs/models/components/creditwithdrawparams.md +9 -9
- package/docs/models/components/debtposition.md +16 -16
- package/docs/models/components/loopedposition.md +17 -17
- package/docs/models/components/rebalancetarget.md +13 -10
- package/docs/models/components/rebalancetargetpreview.md +19 -16
- package/docs/models/components/rebalancetargetpreviewhealthfactorscope.md +1 -1
- package/openapi_prepped_for_speakeasy.json +78 -4
- package/package.json +1 -1
- package/src/models/components/accountsummary.ts +2 -3
- package/src/models/components/collateralposition.ts +2 -3
- package/src/models/components/creditborrowparams.ts +2 -3
- package/src/models/components/creditborrowrequest.ts +2 -3
- package/src/models/components/creditenablecollateralparams.ts +2 -3
- package/src/models/components/creditlooprequest.ts +2 -3
- package/src/models/components/creditprotocol.ts +4 -6
- package/src/models/components/creditrepayparams.ts +2 -3
- package/src/models/components/creditrepayrequest.ts +2 -3
- package/src/models/components/creditsupplyparams.ts +2 -3
- package/src/models/components/creditunlooprequest.ts +2 -3
- package/src/models/components/creditwithdrawparams.ts +2 -3
- package/src/models/components/debtposition.ts +2 -3
- package/src/models/components/loopedposition.ts +2 -3
- package/src/models/components/rebalancetarget.ts +23 -3
- package/src/models/components/rebalancetargetpreview.ts +23 -6
|
@@ -40,9 +40,8 @@ export type CreditEnableCollateralParams = {
|
|
|
40
40
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
41
41
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
42
42
|
*
|
|
43
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
44
|
-
* ``/v2/credit/looped_positions
|
|
45
|
-
* which rejects EULER with a 422.
|
|
43
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
44
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
46
45
|
*/
|
|
47
46
|
protocol?: CreditProtocol | undefined;
|
|
48
47
|
/**
|
|
@@ -94,9 +94,8 @@ export type CreditLoopRequest = {
|
|
|
94
94
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
95
95
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
96
96
|
*
|
|
97
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
98
|
-
* ``/v2/credit/looped_positions
|
|
99
|
-
* which rejects EULER with a 422.
|
|
97
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
98
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
100
99
|
*/
|
|
101
100
|
protocol?: CreditProtocol | undefined;
|
|
102
101
|
/**
|
|
@@ -22,9 +22,8 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
22
22
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
23
23
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
24
24
|
*
|
|
25
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
26
|
-
* ``/v2/credit/looped_positions
|
|
27
|
-
* which rejects EULER with a 422.
|
|
25
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
26
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
28
27
|
*/
|
|
29
28
|
export const CreditProtocol = {
|
|
30
29
|
Aave: "AAVE",
|
|
@@ -48,9 +47,8 @@ export const CreditProtocol = {
|
|
|
48
47
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
49
48
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
50
49
|
*
|
|
51
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
52
|
-
* ``/v2/credit/looped_positions
|
|
53
|
-
* which rejects EULER with a 422.
|
|
50
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
51
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
54
52
|
*/
|
|
55
53
|
export type CreditProtocol = ClosedEnum<typeof CreditProtocol>;
|
|
56
54
|
|
|
@@ -56,9 +56,8 @@ export type CreditRepayParams = {
|
|
|
56
56
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
57
57
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
58
58
|
*
|
|
59
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
60
|
-
* ``/v2/credit/looped_positions
|
|
61
|
-
* which rejects EULER with a 422.
|
|
59
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
60
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
62
61
|
*/
|
|
63
62
|
protocol?: CreditProtocol | undefined;
|
|
64
63
|
/**
|
|
@@ -73,9 +73,8 @@ export type CreditRepayRequest = {
|
|
|
73
73
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
74
74
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
75
75
|
*
|
|
76
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
77
|
-
* ``/v2/credit/looped_positions
|
|
78
|
-
* which rejects EULER with a 422.
|
|
76
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
77
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
79
78
|
*/
|
|
80
79
|
protocol?: CreditProtocol | undefined;
|
|
81
80
|
/**
|
|
@@ -44,9 +44,8 @@ export type CreditSupplyParams = {
|
|
|
44
44
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
45
45
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
46
46
|
*
|
|
47
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
48
|
-
* ``/v2/credit/looped_positions
|
|
49
|
-
* which rejects EULER with a 422.
|
|
47
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
48
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
50
49
|
*/
|
|
51
50
|
protocol?: CreditProtocol | undefined;
|
|
52
51
|
/**
|
|
@@ -86,9 +86,8 @@ export type CreditUnloopRequest = {
|
|
|
86
86
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
87
87
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
88
88
|
*
|
|
89
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
90
|
-
* ``/v2/credit/looped_positions
|
|
91
|
-
* which rejects EULER with a 422.
|
|
89
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
90
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
92
91
|
*/
|
|
93
92
|
protocol?: CreditProtocol | undefined;
|
|
94
93
|
/**
|
|
@@ -44,9 +44,8 @@ export type CreditWithdrawParams = {
|
|
|
44
44
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
45
45
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
46
46
|
*
|
|
47
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
48
|
-
* ``/v2/credit/looped_positions
|
|
49
|
-
* which rejects EULER with a 422.
|
|
47
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
48
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
50
49
|
*/
|
|
51
50
|
protocol?: CreditProtocol | undefined;
|
|
52
51
|
/**
|
|
@@ -42,9 +42,8 @@ export type DebtPosition = {
|
|
|
42
42
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
43
43
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
44
44
|
*
|
|
45
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
46
|
-
* ``/v2/credit/looped_positions
|
|
47
|
-
* which rejects EULER with a 422.
|
|
45
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
46
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
48
47
|
*/
|
|
49
48
|
protocol?: CreditProtocol | undefined;
|
|
50
49
|
/**
|
|
@@ -58,9 +58,8 @@ export type LoopedPosition = {
|
|
|
58
58
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
59
59
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
60
60
|
*
|
|
61
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
62
|
-
* ``/v2/credit/looped_positions
|
|
63
|
-
* which rejects EULER with a 422.
|
|
61
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
62
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
64
63
|
*/
|
|
65
64
|
protocol: CreditProtocol;
|
|
66
65
|
/**
|
|
@@ -51,15 +51,26 @@ export type RebalanceTarget = {
|
|
|
51
51
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
52
52
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
53
53
|
*
|
|
54
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
55
|
-
* ``/v2/credit/looped_positions
|
|
56
|
-
* which rejects EULER with a 422.
|
|
54
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
55
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
57
56
|
*/
|
|
58
57
|
protocol?: CreditProtocol | undefined;
|
|
59
58
|
/**
|
|
60
59
|
* Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
|
|
61
60
|
*/
|
|
62
61
|
marketId?: string | null | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Euler only: the EVK vault the collateral is supplied to (from /v2/credit/euler_markets). Required when protocol=EULER.
|
|
64
|
+
*/
|
|
65
|
+
collateralVault?: string | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Euler only: the EVK vault borrowed from (the sub-account's controller). Required when protocol=EULER.
|
|
68
|
+
*/
|
|
69
|
+
borrowVault?: string | null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Euler only: the EVC sub-account (0-255) this position lives in. Omit it and the plan resolves it from the live book: the sub-account already holding this vault pair, else the lowest free sub-account for a new position. The resolved id is echoed in the preview. Pass it explicitly when the same pair is open on several sub-accounts.
|
|
72
|
+
*/
|
|
73
|
+
subAccountId?: number | null | undefined;
|
|
63
74
|
/**
|
|
64
75
|
* Token supplied as collateral for this position. For MORPHO it must be the market's collateral token.
|
|
65
76
|
*/
|
|
@@ -146,6 +157,9 @@ export function rebalanceTargetMaxSlippagePercentToJSON(
|
|
|
146
157
|
export type RebalanceTarget$Outbound = {
|
|
147
158
|
protocol?: string | undefined;
|
|
148
159
|
market_id?: string | null | undefined;
|
|
160
|
+
collateral_vault?: string | null | undefined;
|
|
161
|
+
borrow_vault?: string | null | undefined;
|
|
162
|
+
sub_account_id?: number | null | undefined;
|
|
149
163
|
collateral_token: string;
|
|
150
164
|
borrow_token: string;
|
|
151
165
|
target_equity_usd?: number | string | null | undefined;
|
|
@@ -162,6 +176,9 @@ export const RebalanceTarget$outboundSchema: z.ZodType<
|
|
|
162
176
|
> = z.object({
|
|
163
177
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
164
178
|
marketId: z.nullable(z.string()).optional(),
|
|
179
|
+
collateralVault: z.nullable(z.string()).optional(),
|
|
180
|
+
borrowVault: z.nullable(z.string()).optional(),
|
|
181
|
+
subAccountId: z.nullable(z.number().int()).optional(),
|
|
165
182
|
collateralToken: z.string(),
|
|
166
183
|
borrowToken: z.string(),
|
|
167
184
|
targetEquityUsd: z.nullable(z.union([z.number(), z.string()])).optional(),
|
|
@@ -171,6 +188,9 @@ export const RebalanceTarget$outboundSchema: z.ZodType<
|
|
|
171
188
|
}).transform((v) => {
|
|
172
189
|
return remap$(v, {
|
|
173
190
|
marketId: "market_id",
|
|
191
|
+
collateralVault: "collateral_vault",
|
|
192
|
+
borrowVault: "borrow_vault",
|
|
193
|
+
subAccountId: "sub_account_id",
|
|
174
194
|
collateralToken: "collateral_token",
|
|
175
195
|
borrowToken: "borrow_token",
|
|
176
196
|
targetEquityUsd: "target_equity_usd",
|
|
@@ -26,14 +26,14 @@ import {
|
|
|
26
26
|
} from "./unlooplegpreview.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* 'market' for Morpho (isolated per
|
|
29
|
+
* 'market' for Morpho and Euler (isolated health: per Morpho market, per Euler EVC sub-account). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account.
|
|
30
30
|
*/
|
|
31
31
|
export const RebalanceTargetPreviewHealthFactorScope = {
|
|
32
32
|
Market: "market",
|
|
33
33
|
Account: "account",
|
|
34
34
|
} as const;
|
|
35
35
|
/**
|
|
36
|
-
* 'market' for Morpho (isolated per
|
|
36
|
+
* 'market' for Morpho and Euler (isolated health: per Morpho market, per Euler EVC sub-account). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account.
|
|
37
37
|
*/
|
|
38
38
|
export type RebalanceTargetPreviewHealthFactorScope = ClosedEnum<
|
|
39
39
|
typeof RebalanceTargetPreviewHealthFactorScope
|
|
@@ -60,15 +60,26 @@ export type RebalanceTargetPreview = {
|
|
|
60
60
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
61
61
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
62
62
|
*
|
|
63
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
64
|
-
* ``/v2/credit/looped_positions
|
|
65
|
-
* which rejects EULER with a 422.
|
|
63
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
64
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
66
65
|
*/
|
|
67
66
|
protocol: CreditProtocol;
|
|
68
67
|
/**
|
|
69
68
|
* Morpho only: the bytes32 market id of this position.
|
|
70
69
|
*/
|
|
71
70
|
marketId?: string | null | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Euler only: the EVC sub-account (0-255) this position lives in — the id the request named, or the one the plan resolved when the target omitted it. Feed it back to /v2/credit/unloop and match it on /v2/credit/looped_positions.
|
|
73
|
+
*/
|
|
74
|
+
subAccountId?: number | null | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Euler only: the EVK vault holding the collateral (echoes the request target).
|
|
77
|
+
*/
|
|
78
|
+
collateralVault?: string | null | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Euler only: the EVK controller vault the debt is owed to (echoes the request target).
|
|
81
|
+
*/
|
|
82
|
+
borrowVault?: string | null | undefined;
|
|
72
83
|
/**
|
|
73
84
|
* Collateral token address (echoes the request target; joins against /v2/credit/looped_positions).
|
|
74
85
|
*/
|
|
@@ -110,7 +121,7 @@ export type RebalanceTargetPreview = {
|
|
|
110
121
|
*/
|
|
111
122
|
resultingHealthFactor: string;
|
|
112
123
|
/**
|
|
113
|
-
* 'market' for Morpho (isolated per
|
|
124
|
+
* 'market' for Morpho and Euler (isolated health: per Morpho market, per Euler EVC sub-account). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account.
|
|
114
125
|
*/
|
|
115
126
|
healthFactorScope: RebalanceTargetPreviewHealthFactorScope;
|
|
116
127
|
/**
|
|
@@ -132,6 +143,9 @@ export const RebalanceTargetPreview$inboundSchema: z.ZodType<
|
|
|
132
143
|
> = z.object({
|
|
133
144
|
protocol: CreditProtocol$inboundSchema,
|
|
134
145
|
market_id: z.nullable(z.string()).optional(),
|
|
146
|
+
sub_account_id: z.nullable(z.number().int()).optional(),
|
|
147
|
+
collateral_vault: z.nullable(z.string()).optional(),
|
|
148
|
+
borrow_vault: z.nullable(z.string()).optional(),
|
|
135
149
|
collateral_token: z.string(),
|
|
136
150
|
borrow_token: z.string(),
|
|
137
151
|
direction: RebalanceDirection$inboundSchema,
|
|
@@ -147,6 +161,9 @@ export const RebalanceTargetPreview$inboundSchema: z.ZodType<
|
|
|
147
161
|
}).transform((v) => {
|
|
148
162
|
return remap$(v, {
|
|
149
163
|
"market_id": "marketId",
|
|
164
|
+
"sub_account_id": "subAccountId",
|
|
165
|
+
"collateral_vault": "collateralVault",
|
|
166
|
+
"borrow_vault": "borrowVault",
|
|
150
167
|
"collateral_token": "collateralToken",
|
|
151
168
|
"borrow_token": "borrowToken",
|
|
152
169
|
"unloop_legs": "unloopLegs",
|