@compass-labs/api-sdk 2.2.109 → 2.2.111
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/creditloopresponse.d.ts +4 -0
- package/dist/commonjs/models/components/creditloopresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditloopresponse.js +2 -0
- package/dist/commonjs/models/components/creditloopresponse.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/morpholendingmarket.d.ts +16 -0
- package/dist/commonjs/models/components/morpholendingmarket.d.ts.map +1 -1
- package/dist/commonjs/models/components/morpholendingmarket.js +8 -0
- package/dist/commonjs/models/components/morpholendingmarket.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/creditloopresponse.d.ts +4 -0
- package/dist/esm/models/components/creditloopresponse.d.ts.map +1 -1
- package/dist/esm/models/components/creditloopresponse.js +2 -0
- package/dist/esm/models/components/creditloopresponse.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/morpholendingmarket.d.ts +16 -0
- package/dist/esm/models/components/morpholendingmarket.d.ts.map +1 -1
- package/dist/esm/models/components/morpholendingmarket.js +8 -0
- package/dist/esm/models/components/morpholendingmarket.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/creditloopresponse.md +1 -0
- 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/morpholendingmarket.md +4 -0
- 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 +139 -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/creditloopresponse.ts +6 -0
- 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/morpholendingmarket.ts +24 -0
- package/src/models/components/rebalancetarget.ts +23 -3
- package/src/models/components/rebalancetargetpreview.ts +23 -6
|
@@ -13198,6 +13198,18 @@
|
|
|
13198
13198
|
],
|
|
13199
13199
|
"description": "Projected end state, computed on guaranteed swap floors. Null only on pricing='firm' preview responses whose target the firm venue cannot serve: no leg was priced on any venue, and the response carries the coverage advisory (max_firm_multiplier) alone."
|
|
13200
13200
|
},
|
|
13201
|
+
"pt_maturity": {
|
|
13202
|
+
"anyOf": [
|
|
13203
|
+
{
|
|
13204
|
+
"type": "string"
|
|
13205
|
+
},
|
|
13206
|
+
{
|
|
13207
|
+
"type": "null"
|
|
13208
|
+
}
|
|
13209
|
+
],
|
|
13210
|
+
"title": "Pt Maturity",
|
|
13211
|
+
"description": "Maturity of the Pendle principal token supplied as collateral, ISO-8601 UTC. Present only for principal-token collateral, whose yield is fixed until this date; after it the position can be unwound (by redemption at par) but not increased."
|
|
13212
|
+
},
|
|
13201
13213
|
"swap_provider": {
|
|
13202
13214
|
"type": "string",
|
|
13203
13215
|
"enum": [
|
|
@@ -13366,7 +13378,7 @@
|
|
|
13366
13378
|
"MORPHO"
|
|
13367
13379
|
],
|
|
13368
13380
|
"title": "CreditProtocol",
|
|
13369
|
-
"description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path; markets are named by token\nsymbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32\n``market_id``. ``EULER`` identifies Euler V2 markets by their EVK\n``collateral_vault`` + ``borrow_vault`` addresses and supports isolated\nper-sub-account positions (``sub_account_id``).\n\nDeployment is per chain, so a valid protocol can still 422 on a given chain:\nAAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the\nchain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM\n(where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.\n\nAll three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
13381
|
+
"description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path; markets are named by token\nsymbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32\n``market_id``. ``EULER`` identifies Euler V2 markets by their EVK\n``collateral_vault`` + ``borrow_vault`` addresses and supports isolated\nper-sub-account positions (``sub_account_id``).\n\nDeployment is per chain, so a valid protocol can still 422 on a given chain:\nAAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the\nchain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM\n(where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.\n\nAll three support ``/v2/credit/loop``, ``/v2/credit/unloop``,\n``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``."
|
|
13370
13382
|
},
|
|
13371
13383
|
"CreditRebalancePreview": {
|
|
13372
13384
|
"properties": {
|
|
@@ -18679,6 +18691,55 @@
|
|
|
18679
18691
|
"title": "Loan Intrinsic Apy",
|
|
18680
18692
|
"description": "What the LOAN token earns inside its own price, in percentage, trailing 7 days. Debt owed in such a token grows by this on top of borrow_apy \u2014 a borrower's true cost is their sum. Null means unmeasured, NOT zero."
|
|
18681
18693
|
},
|
|
18694
|
+
"collateral_yield_kind": {
|
|
18695
|
+
"anyOf": [
|
|
18696
|
+
{
|
|
18697
|
+
"type": "string",
|
|
18698
|
+
"const": "fixed"
|
|
18699
|
+
},
|
|
18700
|
+
{
|
|
18701
|
+
"type": "null"
|
|
18702
|
+
}
|
|
18703
|
+
],
|
|
18704
|
+
"title": "Collateral Yield Kind",
|
|
18705
|
+
"description": "Set to 'fixed' when collateral_intrinsic_apy is locked in until a maturity date rather than measured over a trailing window, as it is for a principal token. Clients should label such a rate as fixed to maturity instead of a 7-day average. Absent for every other market."
|
|
18706
|
+
},
|
|
18707
|
+
"pt_maturity": {
|
|
18708
|
+
"anyOf": [
|
|
18709
|
+
{
|
|
18710
|
+
"type": "string"
|
|
18711
|
+
},
|
|
18712
|
+
{
|
|
18713
|
+
"type": "null"
|
|
18714
|
+
}
|
|
18715
|
+
],
|
|
18716
|
+
"title": "Pt Maturity",
|
|
18717
|
+
"description": "Maturity date of the principal-token collateral, ISO-8601 UTC. Present only on principal-token markets."
|
|
18718
|
+
},
|
|
18719
|
+
"pt_expired": {
|
|
18720
|
+
"anyOf": [
|
|
18721
|
+
{
|
|
18722
|
+
"type": "boolean"
|
|
18723
|
+
},
|
|
18724
|
+
{
|
|
18725
|
+
"type": "null"
|
|
18726
|
+
}
|
|
18727
|
+
],
|
|
18728
|
+
"title": "Pt Expired",
|
|
18729
|
+
"description": "Whether the principal-token collateral has passed its maturity. Matured markets stay listed so open positions can still be unwound, so clients should use this to disable opening rather than to hide the row. Present only on principal-token markets."
|
|
18730
|
+
},
|
|
18731
|
+
"pt_loopable": {
|
|
18732
|
+
"anyOf": [
|
|
18733
|
+
{
|
|
18734
|
+
"type": "boolean"
|
|
18735
|
+
},
|
|
18736
|
+
{
|
|
18737
|
+
"type": "null"
|
|
18738
|
+
}
|
|
18739
|
+
],
|
|
18740
|
+
"title": "Pt Loopable",
|
|
18741
|
+
"description": "Whether a NEW loop may be opened on this principal-token market. False once the market is matured or too close to maturity to earn back a loop's entry cost. Computed server-side, so clients need no copy of the threshold. Present only on principal-token markets."
|
|
18742
|
+
},
|
|
18682
18743
|
"utilization": {
|
|
18683
18744
|
"type": "string",
|
|
18684
18745
|
"title": "Utilization",
|
|
@@ -23081,7 +23142,7 @@
|
|
|
23081
23142
|
"properties": {
|
|
23082
23143
|
"protocol": {
|
|
23083
23144
|
"$ref": "#/components/schemas/CreditProtocol",
|
|
23084
|
-
"description": "Lending protocol of this position: AAVE or
|
|
23145
|
+
"description": "Lending protocol of this position: AAVE, MORPHO or EULER.",
|
|
23085
23146
|
"example": "AAVE"
|
|
23086
23147
|
},
|
|
23087
23148
|
"market_id": {
|
|
@@ -23096,6 +23157,44 @@
|
|
|
23096
23157
|
"title": "Market Id",
|
|
23097
23158
|
"description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
|
|
23098
23159
|
},
|
|
23160
|
+
"collateral_vault": {
|
|
23161
|
+
"anyOf": [
|
|
23162
|
+
{
|
|
23163
|
+
"type": "string"
|
|
23164
|
+
},
|
|
23165
|
+
{
|
|
23166
|
+
"type": "null"
|
|
23167
|
+
}
|
|
23168
|
+
],
|
|
23169
|
+
"title": "Collateral Vault",
|
|
23170
|
+
"description": "Euler only: the EVK vault the collateral is supplied to (from /v2/credit/euler_markets). Required when protocol=EULER."
|
|
23171
|
+
},
|
|
23172
|
+
"borrow_vault": {
|
|
23173
|
+
"anyOf": [
|
|
23174
|
+
{
|
|
23175
|
+
"type": "string"
|
|
23176
|
+
},
|
|
23177
|
+
{
|
|
23178
|
+
"type": "null"
|
|
23179
|
+
}
|
|
23180
|
+
],
|
|
23181
|
+
"title": "Borrow Vault",
|
|
23182
|
+
"description": "Euler only: the EVK vault borrowed from (the sub-account's controller). Required when protocol=EULER."
|
|
23183
|
+
},
|
|
23184
|
+
"sub_account_id": {
|
|
23185
|
+
"anyOf": [
|
|
23186
|
+
{
|
|
23187
|
+
"type": "integer",
|
|
23188
|
+
"maximum": 255.0,
|
|
23189
|
+
"minimum": 0.0
|
|
23190
|
+
},
|
|
23191
|
+
{
|
|
23192
|
+
"type": "null"
|
|
23193
|
+
}
|
|
23194
|
+
],
|
|
23195
|
+
"title": "Sub Account Id",
|
|
23196
|
+
"description": "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."
|
|
23197
|
+
},
|
|
23099
23198
|
"collateral_token": {
|
|
23100
23199
|
"type": "string",
|
|
23101
23200
|
"title": "Token",
|
|
@@ -23177,7 +23276,7 @@
|
|
|
23177
23276
|
"properties": {
|
|
23178
23277
|
"protocol": {
|
|
23179
23278
|
"$ref": "#/components/schemas/CreditProtocol",
|
|
23180
|
-
"description": "Lending protocol of this position: AAVE or
|
|
23279
|
+
"description": "Lending protocol of this position: AAVE, MORPHO or EULER."
|
|
23181
23280
|
},
|
|
23182
23281
|
"market_id": {
|
|
23183
23282
|
"anyOf": [
|
|
@@ -23191,6 +23290,42 @@
|
|
|
23191
23290
|
"title": "Market Id",
|
|
23192
23291
|
"description": "Morpho only: the bytes32 market id of this position."
|
|
23193
23292
|
},
|
|
23293
|
+
"sub_account_id": {
|
|
23294
|
+
"anyOf": [
|
|
23295
|
+
{
|
|
23296
|
+
"type": "integer"
|
|
23297
|
+
},
|
|
23298
|
+
{
|
|
23299
|
+
"type": "null"
|
|
23300
|
+
}
|
|
23301
|
+
],
|
|
23302
|
+
"title": "Sub Account Id",
|
|
23303
|
+
"description": "Euler only: the EVC sub-account (0-255) this position lives in \u2014 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."
|
|
23304
|
+
},
|
|
23305
|
+
"collateral_vault": {
|
|
23306
|
+
"anyOf": [
|
|
23307
|
+
{
|
|
23308
|
+
"type": "string"
|
|
23309
|
+
},
|
|
23310
|
+
{
|
|
23311
|
+
"type": "null"
|
|
23312
|
+
}
|
|
23313
|
+
],
|
|
23314
|
+
"title": "Collateral Vault",
|
|
23315
|
+
"description": "Euler only: the EVK vault holding the collateral (echoes the request target)."
|
|
23316
|
+
},
|
|
23317
|
+
"borrow_vault": {
|
|
23318
|
+
"anyOf": [
|
|
23319
|
+
{
|
|
23320
|
+
"type": "string"
|
|
23321
|
+
},
|
|
23322
|
+
{
|
|
23323
|
+
"type": "null"
|
|
23324
|
+
}
|
|
23325
|
+
],
|
|
23326
|
+
"title": "Borrow Vault",
|
|
23327
|
+
"description": "Euler only: the EVK controller vault the debt is owed to (echoes the request target)."
|
|
23328
|
+
},
|
|
23194
23329
|
"collateral_token": {
|
|
23195
23330
|
"type": "string",
|
|
23196
23331
|
"title": "Collateral Token",
|
|
@@ -23255,7 +23390,7 @@
|
|
|
23255
23390
|
"account"
|
|
23256
23391
|
],
|
|
23257
23392
|
"title": "Health Factor Scope",
|
|
23258
|
-
"description": "'market' for Morpho (isolated per
|
|
23393
|
+
"description": "'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."
|
|
23259
23394
|
},
|
|
23260
23395
|
"estimated_max_dust": {
|
|
23261
23396
|
"type": "string",
|
package/package.json
CHANGED
|
@@ -39,9 +39,8 @@ export type AccountSummary = {
|
|
|
39
39
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
40
40
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
41
41
|
*
|
|
42
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
43
|
-
* ``/v2/credit/looped_positions
|
|
44
|
-
* which rejects EULER with a 422.
|
|
42
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
43
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
45
44
|
*/
|
|
46
45
|
protocol?: CreditProtocol | undefined;
|
|
47
46
|
/**
|
|
@@ -42,9 +42,8 @@ export type CollateralPosition = {
|
|
|
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
|
/**
|
|
@@ -65,9 +65,8 @@ export type CreditBorrowParams = {
|
|
|
65
65
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
66
66
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
67
67
|
*
|
|
68
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
69
|
-
* ``/v2/credit/looped_positions
|
|
70
|
-
* which rejects EULER with a 422.
|
|
68
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
69
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
71
70
|
*/
|
|
72
71
|
protocol?: CreditProtocol | undefined;
|
|
73
72
|
/**
|
|
@@ -78,9 +78,8 @@ export type CreditBorrowRequest = {
|
|
|
78
78
|
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
79
79
|
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
80
80
|
*
|
|
81
|
-
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop
|
|
82
|
-
* ``/v2/credit/looped_positions
|
|
83
|
-
* which rejects EULER with a 422.
|
|
81
|
+
* All three support ``/v2/credit/loop``, ``/v2/credit/unloop``,
|
|
82
|
+
* ``/v2/credit/looped_positions`` and ``/v2/credit/rebalance``.
|
|
84
83
|
*/
|
|
85
84
|
protocol?: CreditProtocol | undefined;
|
|
86
85
|
/**
|
|
@@ -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
|
/**
|
|
@@ -51,6 +51,10 @@ export type CreditLoopResponse = {
|
|
|
51
51
|
* Projected end state, computed on guaranteed swap floors. Null only on pricing='firm' preview responses whose target the firm venue cannot serve: no leg was priced on any venue, and the response carries the coverage advisory (max_firm_multiplier) alone.
|
|
52
52
|
*/
|
|
53
53
|
preview: CreditLoopPreview | null;
|
|
54
|
+
/**
|
|
55
|
+
* Maturity of the Pendle principal token supplied as collateral, ISO-8601 UTC. Present only for principal-token collateral, whose yield is fixed until this date; after it the position can be unwound (by redemption at par) but not increased.
|
|
56
|
+
*/
|
|
57
|
+
ptMaturity?: string | null | undefined;
|
|
54
58
|
/**
|
|
55
59
|
* Identifies which route priced the swap leg(s): 'market' — a DEX aggregator (iterative loop across pool liquidity, slippage-bounded floors) — or 'firm' — zero-slippage quotes, one per swap leg, each partially filled at the leg's size (exact fills, zero dust). On preview=true responses 'firm' means the numbers are INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED (under 'auto' a firm build can fall back to market transparently), and `quote_expires_at` is absent on every preview — so neither substitutes for this field.
|
|
56
60
|
*/
|
|
@@ -80,6 +84,7 @@ export const CreditLoopResponse$inboundSchema: z.ZodType<
|
|
|
80
84
|
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
81
85
|
.optional(),
|
|
82
86
|
preview: z.nullable(CreditLoopPreview$inboundSchema),
|
|
87
|
+
pt_maturity: z.nullable(z.string()).optional(),
|
|
83
88
|
swap_provider: CreditLoopResponseSwapProvider$inboundSchema.optional(),
|
|
84
89
|
quote_expires_at: z.nullable(
|
|
85
90
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
@@ -88,6 +93,7 @@ export const CreditLoopResponse$inboundSchema: z.ZodType<
|
|
|
88
93
|
}).transform((v) => {
|
|
89
94
|
return remap$(v, {
|
|
90
95
|
"eip_712": "eip712",
|
|
96
|
+
"pt_maturity": "ptMaturity",
|
|
91
97
|
"swap_provider": "swapProvider",
|
|
92
98
|
"quote_expires_at": "quoteExpiresAt",
|
|
93
99
|
"max_firm_multiplier": "maxFirmMultiplier",
|
|
@@ -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
|
/**
|
|
@@ -68,6 +68,22 @@ export type MorphoLendingMarket = {
|
|
|
68
68
|
* What the LOAN token earns inside its own price, in percentage, trailing 7 days. Debt owed in such a token grows by this on top of borrow_apy — a borrower's true cost is their sum. Null means unmeasured, NOT zero.
|
|
69
69
|
*/
|
|
70
70
|
loanIntrinsicApy?: string | null | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Set to 'fixed' when collateral_intrinsic_apy is locked in until a maturity date rather than measured over a trailing window, as it is for a principal token. Clients should label such a rate as fixed to maturity instead of a 7-day average. Absent for every other market.
|
|
73
|
+
*/
|
|
74
|
+
collateralYieldKind?: "fixed" | null | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Maturity date of the principal-token collateral, ISO-8601 UTC. Present only on principal-token markets.
|
|
77
|
+
*/
|
|
78
|
+
ptMaturity?: string | null | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Whether the principal-token collateral has passed its maturity. Matured markets stay listed so open positions can still be unwound, so clients should use this to disable opening rather than to hide the row. Present only on principal-token markets.
|
|
81
|
+
*/
|
|
82
|
+
ptExpired?: boolean | null | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Whether a NEW loop may be opened on this principal-token market. False once the market is matured or too close to maturity to earn back a loop's entry cost. Computed server-side, so clients need no copy of the threshold. Present only on principal-token markets.
|
|
85
|
+
*/
|
|
86
|
+
ptLoopable?: boolean | null | undefined;
|
|
71
87
|
/**
|
|
72
88
|
* Borrowed share of supplied assets, in percentage 0-100.
|
|
73
89
|
*/
|
|
@@ -118,6 +134,10 @@ export const MorphoLendingMarket$inboundSchema: z.ZodType<
|
|
|
118
134
|
borrow_apy: z.nullable(z.string()).optional(),
|
|
119
135
|
collateral_intrinsic_apy: z.nullable(z.string()).optional(),
|
|
120
136
|
loan_intrinsic_apy: z.nullable(z.string()).optional(),
|
|
137
|
+
collateral_yield_kind: z.nullable(z.literal("fixed")).optional(),
|
|
138
|
+
pt_maturity: z.nullable(z.string()).optional(),
|
|
139
|
+
pt_expired: z.nullable(z.boolean()).optional(),
|
|
140
|
+
pt_loopable: z.nullable(z.boolean()).optional(),
|
|
121
141
|
utilization: z.string(),
|
|
122
142
|
total_supply_assets: z.string(),
|
|
123
143
|
total_borrow_assets: z.string(),
|
|
@@ -138,6 +158,10 @@ export const MorphoLendingMarket$inboundSchema: z.ZodType<
|
|
|
138
158
|
"borrow_apy": "borrowApy",
|
|
139
159
|
"collateral_intrinsic_apy": "collateralIntrinsicApy",
|
|
140
160
|
"loan_intrinsic_apy": "loanIntrinsicApy",
|
|
161
|
+
"collateral_yield_kind": "collateralYieldKind",
|
|
162
|
+
"pt_maturity": "ptMaturity",
|
|
163
|
+
"pt_expired": "ptExpired",
|
|
164
|
+
"pt_loopable": "ptLoopable",
|
|
141
165
|
"total_supply_assets": "totalSupplyAssets",
|
|
142
166
|
"total_borrow_assets": "totalBorrowAssets",
|
|
143
167
|
"available_liquidity": "availableLiquidity",
|
|
@@ -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",
|