@compass-labs/api-sdk 2.2.101 → 2.2.102
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/funcs/creditCreditBorrow.d.ts +1 -1
- package/dist/commonjs/funcs/creditCreditBorrow.js +1 -1
- package/dist/commonjs/funcs/creditCreditLoop.d.ts +8 -22
- package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditLoop.js +8 -22
- package/dist/commonjs/funcs/creditCreditLoop.js.map +1 -1
- package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts +8 -7
- package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditLoopedPositions.js +8 -7
- package/dist/commonjs/funcs/creditCreditLoopedPositions.js.map +1 -1
- package/dist/commonjs/funcs/creditCreditRebalance.d.ts +11 -34
- package/dist/commonjs/funcs/creditCreditRebalance.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditRebalance.js +11 -34
- package/dist/commonjs/funcs/creditCreditRebalance.js.map +1 -1
- package/dist/commonjs/funcs/creditCreditRepay.d.ts +1 -1
- package/dist/commonjs/funcs/creditCreditRepay.js +1 -1
- package/dist/commonjs/funcs/creditCreditUnloop.d.ts +7 -38
- package/dist/commonjs/funcs/creditCreditUnloop.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditUnloop.js +7 -38
- package/dist/commonjs/funcs/creditCreditUnloop.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/accountsummary.d.ts +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +27 -14
- package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditlooprequest.js +1 -1
- package/dist/commonjs/models/components/creditlooprequest.js.map +1 -1
- package/dist/commonjs/models/components/creditloopresponse.d.ts +5 -5
- package/dist/commonjs/models/components/creditloopresponse.js +1 -1
- package/dist/commonjs/models/components/creditprotocol.d.ts +36 -10
- package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditprotocol.js +18 -5
- package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.d.ts +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +23 -10
- package/dist/commonjs/models/components/creditunlooprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditunlooprequest.js +1 -1
- package/dist/commonjs/models/components/creditunlooprequest.js.map +1 -1
- package/dist/commonjs/models/components/creditunloopresponse.d.ts +5 -5
- package/dist/commonjs/models/components/creditunloopresponse.js +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +18 -5
- package/dist/commonjs/models/components/rebalancetarget.d.ts.map +1 -1
- package/dist/commonjs/models/components/rebalancetarget.js.map +1 -1
- package/dist/commonjs/models/components/rebalancetargetpreview.d.ts +18 -5
- package/dist/commonjs/models/components/rebalancetargetpreview.d.ts.map +1 -1
- package/dist/commonjs/models/components/rebalancetargetpreview.js.map +1 -1
- package/dist/commonjs/models/components/swapinfo.d.ts +2 -2
- package/dist/commonjs/sdk/credit.d.ts +44 -111
- package/dist/commonjs/sdk/credit.d.ts.map +1 -1
- package/dist/commonjs/sdk/credit.js +44 -111
- package/dist/commonjs/sdk/credit.js.map +1 -1
- package/dist/esm/funcs/creditCreditBorrow.d.ts +1 -1
- package/dist/esm/funcs/creditCreditBorrow.js +1 -1
- package/dist/esm/funcs/creditCreditLoop.d.ts +8 -22
- package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditLoop.js +8 -22
- package/dist/esm/funcs/creditCreditLoop.js.map +1 -1
- package/dist/esm/funcs/creditCreditLoopedPositions.d.ts +8 -7
- package/dist/esm/funcs/creditCreditLoopedPositions.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditLoopedPositions.js +8 -7
- package/dist/esm/funcs/creditCreditLoopedPositions.js.map +1 -1
- package/dist/esm/funcs/creditCreditRebalance.d.ts +11 -34
- package/dist/esm/funcs/creditCreditRebalance.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditRebalance.js +11 -34
- package/dist/esm/funcs/creditCreditRebalance.js.map +1 -1
- package/dist/esm/funcs/creditCreditRepay.d.ts +1 -1
- package/dist/esm/funcs/creditCreditRepay.js +1 -1
- package/dist/esm/funcs/creditCreditUnloop.d.ts +7 -38
- package/dist/esm/funcs/creditCreditUnloop.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditUnloop.js +7 -38
- package/dist/esm/funcs/creditCreditUnloop.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/accountsummary.d.ts +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +27 -14
- package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditlooprequest.js +1 -1
- package/dist/esm/models/components/creditlooprequest.js.map +1 -1
- package/dist/esm/models/components/creditloopresponse.d.ts +5 -5
- package/dist/esm/models/components/creditloopresponse.js +1 -1
- package/dist/esm/models/components/creditprotocol.d.ts +36 -10
- package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/esm/models/components/creditprotocol.js +18 -5
- package/dist/esm/models/components/creditprotocol.js.map +1 -1
- package/dist/esm/models/components/creditrepayparams.d.ts +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +23 -10
- package/dist/esm/models/components/creditunlooprequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditunlooprequest.js +1 -1
- package/dist/esm/models/components/creditunlooprequest.js.map +1 -1
- package/dist/esm/models/components/creditunloopresponse.d.ts +5 -5
- package/dist/esm/models/components/creditunloopresponse.js +1 -1
- package/dist/esm/models/components/creditwithdrawparams.d.ts +18 -5
- 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 +18 -5
- 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 +18 -5
- 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 +18 -5
- package/dist/esm/models/components/rebalancetarget.d.ts.map +1 -1
- package/dist/esm/models/components/rebalancetarget.js.map +1 -1
- package/dist/esm/models/components/rebalancetargetpreview.d.ts +18 -5
- package/dist/esm/models/components/rebalancetargetpreview.d.ts.map +1 -1
- package/dist/esm/models/components/rebalancetargetpreview.js.map +1 -1
- package/dist/esm/models/components/swapinfo.d.ts +2 -2
- package/dist/esm/sdk/credit.d.ts +44 -111
- package/dist/esm/sdk/credit.d.ts.map +1 -1
- package/dist/esm/sdk/credit.js +44 -111
- package/dist/esm/sdk/credit.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/creditlooprequestchain.md +1 -1
- package/docs/models/components/creditlooprequestinitialcollateralamount.md +1 -1
- package/docs/models/components/creditlooprequestloantovalue.md +1 -1
- package/docs/models/components/creditloopresponse.md +8 -8
- package/docs/models/components/creditloopresponseswapprovider.md +1 -1
- package/docs/models/components/creditprotocol.md +18 -5
- 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/creditunlooprequestchain.md +1 -1
- package/docs/models/components/creditunloopresponse.md +8 -8
- package/docs/models/components/creditunloopresponseswapprovider.md +1 -1
- package/docs/models/components/creditwithdrawparams.md +9 -9
- package/docs/models/components/debtposition.md +16 -16
- package/docs/models/components/loopedposition.md +14 -14
- package/docs/models/components/rebalancetarget.md +10 -10
- package/docs/models/components/rebalancetargetpreview.md +16 -16
- package/docs/models/components/swapinfo.md +10 -10
- package/docs/sdks/credit/README.md +40 -107
- package/openapi_prepped_for_speakeasy.json +26 -26
- package/package.json +1 -1
- package/src/funcs/creditCreditBorrow.ts +1 -1
- package/src/funcs/creditCreditLoop.ts +8 -22
- package/src/funcs/creditCreditLoopedPositions.ts +8 -7
- package/src/funcs/creditCreditRebalance.ts +11 -34
- package/src/funcs/creditCreditRepay.ts +1 -1
- package/src/funcs/creditCreditUnloop.ts +7 -38
- package/src/lib/config.ts +2 -2
- package/src/models/components/accountsummary.ts +18 -5
- package/src/models/components/collateralposition.ts +18 -5
- package/src/models/components/creditborrowparams.ts +18 -5
- package/src/models/components/creditborrowrequest.ts +18 -5
- package/src/models/components/creditenablecollateralparams.ts +18 -5
- package/src/models/components/creditlooprequest.ts +27 -14
- package/src/models/components/creditloopresponse.ts +5 -5
- package/src/models/components/creditprotocol.ts +36 -10
- package/src/models/components/creditrepayparams.ts +18 -5
- package/src/models/components/creditrepayrequest.ts +18 -5
- package/src/models/components/creditsupplyparams.ts +18 -5
- package/src/models/components/creditunlooprequest.ts +23 -10
- package/src/models/components/creditunloopresponse.ts +5 -5
- package/src/models/components/creditwithdrawparams.ts +18 -5
- package/src/models/components/debtposition.ts +18 -5
- package/src/models/components/loopedposition.ts +18 -5
- package/src/models/components/rebalancetarget.ts +18 -5
- package/src/models/components/rebalancetargetpreview.ts +18 -5
- package/src/models/components/swapinfo.ts +2 -2
- package/src/sdk/credit.ts +44 -111
|
@@ -29,11 +29,24 @@ export type CreditEnableCollateralParams = {
|
|
|
29
29
|
* @remarks
|
|
30
30
|
*
|
|
31
31
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
32
|
-
* field) keep hitting the unchanged Aave code path
|
|
33
|
-
* Blue lending markets by their bytes32
|
|
34
|
-
* V2 markets by their EVK
|
|
35
|
-
*
|
|
36
|
-
*
|
|
32
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
33
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
34
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
35
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
36
|
+
* per-sub-account positions (``sub_account_id``).
|
|
37
|
+
*
|
|
38
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
39
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
40
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
41
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
42
|
+
*
|
|
43
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
44
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
45
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
46
|
+
* silently absent there rather than an error, so read it from
|
|
47
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
48
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
49
|
+
* emitted.)
|
|
37
50
|
*/
|
|
38
51
|
protocol?: CreditProtocol | undefined;
|
|
39
52
|
/**
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./creditprotocol.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Blockchain network.
|
|
14
|
+
* Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
|
|
15
15
|
*/
|
|
16
16
|
export const CreditLoopRequestChain = {
|
|
17
17
|
Arbitrum: "arbitrum",
|
|
@@ -22,12 +22,12 @@ export const CreditLoopRequestChain = {
|
|
|
22
22
|
Tempo: "tempo",
|
|
23
23
|
} as const;
|
|
24
24
|
/**
|
|
25
|
-
* Blockchain network.
|
|
25
|
+
* Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
|
|
26
26
|
*/
|
|
27
27
|
export type CreditLoopRequestChain = ClosedEnum<typeof CreditLoopRequestChain>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Collateral (in token units)
|
|
30
|
+
* Collateral (in token units) that the Credit Account must ALREADY hold when this is called — the loop never pulls from the owner's wallet mid-transaction. Fund the account first via /v2/credit/transfer (action=DEPOSIT).
|
|
31
31
|
*/
|
|
32
32
|
export type CreditLoopRequestInitialCollateralAmount = number | string;
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ export type CreditLoopRequestInitialCollateralAmount = number | string;
|
|
|
37
37
|
export type CreditLoopRequestMultiplier = number | string;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
|
|
40
|
+
* Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin; Euler's borrow LTV for the collateral vault); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
|
|
41
41
|
*/
|
|
42
42
|
export type CreditLoopRequestLoanToValue = number | string;
|
|
43
43
|
|
|
@@ -74,7 +74,7 @@ export type CreditLoopRequest = {
|
|
|
74
74
|
*/
|
|
75
75
|
owner: string;
|
|
76
76
|
/**
|
|
77
|
-
* Blockchain network.
|
|
77
|
+
* Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
|
|
78
78
|
*/
|
|
79
79
|
chain: CreditLoopRequestChain;
|
|
80
80
|
/**
|
|
@@ -83,11 +83,24 @@ export type CreditLoopRequest = {
|
|
|
83
83
|
* @remarks
|
|
84
84
|
*
|
|
85
85
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
86
|
-
* field) keep hitting the unchanged Aave code path
|
|
87
|
-
* Blue lending markets by their bytes32
|
|
88
|
-
* V2 markets by their EVK
|
|
89
|
-
*
|
|
90
|
-
*
|
|
86
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
87
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
88
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
89
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
90
|
+
* per-sub-account positions (``sub_account_id``).
|
|
91
|
+
*
|
|
92
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
93
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
94
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
95
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
96
|
+
*
|
|
97
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
98
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
99
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
100
|
+
* silently absent there rather than an error, so read it from
|
|
101
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
102
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
103
|
+
* emitted.)
|
|
91
104
|
*/
|
|
92
105
|
protocol?: CreditProtocol | undefined;
|
|
93
106
|
/**
|
|
@@ -115,7 +128,7 @@ export type CreditLoopRequest = {
|
|
|
115
128
|
*/
|
|
116
129
|
borrowToken: string;
|
|
117
130
|
/**
|
|
118
|
-
* Collateral (in token units)
|
|
131
|
+
* Collateral (in token units) that the Credit Account must ALREADY hold when this is called — the loop never pulls from the owner's wallet mid-transaction. Fund the account first via /v2/credit/transfer (action=DEPOSIT).
|
|
119
132
|
*/
|
|
120
133
|
initialCollateralAmount: number | string;
|
|
121
134
|
/**
|
|
@@ -123,7 +136,7 @@ export type CreditLoopRequest = {
|
|
|
123
136
|
*/
|
|
124
137
|
multiplier: number | string;
|
|
125
138
|
/**
|
|
126
|
-
* Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
|
|
139
|
+
* Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin; Euler's borrow LTV for the collateral vault); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
|
|
127
140
|
*/
|
|
128
141
|
loanToValue: number | string;
|
|
129
142
|
/**
|
|
@@ -131,7 +144,7 @@ export type CreditLoopRequest = {
|
|
|
131
144
|
*/
|
|
132
145
|
maxSlippagePercent?: number | string | undefined;
|
|
133
146
|
/**
|
|
134
|
-
* Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated).
|
|
147
|
+
* Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated). Both tokens must belong to the category or the build returns a 422. On Hyperlend (chain=hyperevm) category 1 is the HYPE-correlated set covering wstHYPE and WHYPE.
|
|
135
148
|
*/
|
|
136
149
|
emodeCategory?: number | null | undefined;
|
|
137
150
|
/**
|
|
@@ -139,7 +152,7 @@ export type CreditLoopRequest = {
|
|
|
139
152
|
*/
|
|
140
153
|
gasSponsorship?: boolean | undefined;
|
|
141
154
|
/**
|
|
142
|
-
* If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null)
|
|
155
|
+
* If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent transaction: on a pair no firm provider covers, and under pricing=market, the call still falls through to the aggregator and returns a signable transaction. How the estimate is priced follows `pricing`: on a firm-covered pair under 'auto' or 'firm' it is computed from the firm provider's live price levels (indicative); otherwise swap legs are priced by the default aggregator. Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
|
|
143
156
|
*/
|
|
144
157
|
preview?: boolean | undefined;
|
|
145
158
|
/**
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./unsignedtransaction.js";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses a firm value 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.
|
|
26
26
|
*/
|
|
27
27
|
export const CreditLoopResponseSwapProvider = {
|
|
28
28
|
OneInch: "one_inch",
|
|
29
29
|
Bebop: "bebop",
|
|
30
30
|
} as const;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses a firm value 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.
|
|
33
33
|
*/
|
|
34
34
|
export type CreditLoopResponseSwapProvider = ClosedEnum<
|
|
35
35
|
typeof CreditLoopResponseSwapProvider
|
|
@@ -40,7 +40,7 @@ export type CreditLoopResponseSwapProvider = ClosedEnum<
|
|
|
40
40
|
*/
|
|
41
41
|
export type CreditLoopResponse = {
|
|
42
42
|
/**
|
|
43
|
-
* Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — except firm-priced previews (preview=true
|
|
43
|
+
* Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — except firm-priced previews (preview=true on a firm-priced build), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet.
|
|
44
44
|
*/
|
|
45
45
|
transaction?: UnsignedTransaction | null | undefined;
|
|
46
46
|
/**
|
|
@@ -52,11 +52,11 @@ export type CreditLoopResponse = {
|
|
|
52
52
|
*/
|
|
53
53
|
preview: CreditLoopPreview | null;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses a firm value 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
56
|
*/
|
|
57
57
|
swapProvider?: CreditLoopResponseSwapProvider | undefined;
|
|
58
58
|
/**
|
|
59
|
-
* Deadline of the firm swap quotes (the earliest across the loop's swap legs) — sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable
|
|
59
|
+
* Deadline of the firm swap quotes (the earliest across the loop's swap legs) — sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable firm-priced builds; null on previews (no quote is spent for a preview).
|
|
60
60
|
*/
|
|
61
61
|
quoteExpiresAt?: Date | null | undefined;
|
|
62
62
|
/**
|
|
@@ -11,11 +11,24 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
11
11
|
* @remarks
|
|
12
12
|
*
|
|
13
13
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
14
|
-
* field) keep hitting the unchanged Aave code path
|
|
15
|
-
* Blue lending markets by their bytes32
|
|
16
|
-
* V2 markets by their EVK
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
15
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
16
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
17
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
18
|
+
* per-sub-account positions (``sub_account_id``).
|
|
19
|
+
*
|
|
20
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
21
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
22
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
23
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
24
|
+
*
|
|
25
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
26
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
27
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
28
|
+
* silently absent there rather than an error, so read it from
|
|
29
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
30
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
31
|
+
* emitted.)
|
|
19
32
|
*/
|
|
20
33
|
export const CreditProtocol = {
|
|
21
34
|
Aave: "AAVE",
|
|
@@ -28,11 +41,24 @@ export const CreditProtocol = {
|
|
|
28
41
|
* @remarks
|
|
29
42
|
*
|
|
30
43
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
31
|
-
* field) keep hitting the unchanged Aave code path
|
|
32
|
-
* Blue lending markets by their bytes32
|
|
33
|
-
* V2 markets by their EVK
|
|
34
|
-
*
|
|
35
|
-
*
|
|
44
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
45
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
46
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
47
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
48
|
+
* per-sub-account positions (``sub_account_id``).
|
|
49
|
+
*
|
|
50
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
51
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
52
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
53
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
54
|
+
*
|
|
55
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
56
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
57
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
58
|
+
* silently absent there rather than an error, so read it from
|
|
59
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
60
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
61
|
+
* emitted.)
|
|
36
62
|
*/
|
|
37
63
|
export type CreditProtocol = ClosedEnum<typeof CreditProtocol>;
|
|
38
64
|
|
|
@@ -45,11 +45,24 @@ export type CreditRepayParams = {
|
|
|
45
45
|
* @remarks
|
|
46
46
|
*
|
|
47
47
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
48
|
-
* field) keep hitting the unchanged Aave code path
|
|
49
|
-
* Blue lending markets by their bytes32
|
|
50
|
-
* V2 markets by their EVK
|
|
51
|
-
*
|
|
52
|
-
*
|
|
48
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
49
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
50
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
51
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
52
|
+
* per-sub-account positions (``sub_account_id``).
|
|
53
|
+
*
|
|
54
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
55
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
56
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
57
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
58
|
+
*
|
|
59
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
60
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
61
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
62
|
+
* silently absent there rather than an error, so read it from
|
|
63
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
64
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
65
|
+
* emitted.)
|
|
53
66
|
*/
|
|
54
67
|
protocol?: CreditProtocol | undefined;
|
|
55
68
|
/**
|
|
@@ -62,11 +62,24 @@ export type CreditRepayRequest = {
|
|
|
62
62
|
* @remarks
|
|
63
63
|
*
|
|
64
64
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
65
|
-
* field) keep hitting the unchanged Aave code path
|
|
66
|
-
* Blue lending markets by their bytes32
|
|
67
|
-
* V2 markets by their EVK
|
|
68
|
-
*
|
|
69
|
-
*
|
|
65
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
66
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
67
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
68
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
69
|
+
* per-sub-account positions (``sub_account_id``).
|
|
70
|
+
*
|
|
71
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
72
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
73
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
74
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
75
|
+
*
|
|
76
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
77
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
78
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
79
|
+
* silently absent there rather than an error, so read it from
|
|
80
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
81
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
82
|
+
* emitted.)
|
|
70
83
|
*/
|
|
71
84
|
protocol?: CreditProtocol | undefined;
|
|
72
85
|
/**
|
|
@@ -33,11 +33,24 @@ export type CreditSupplyParams = {
|
|
|
33
33
|
* @remarks
|
|
34
34
|
*
|
|
35
35
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
36
|
-
* field) keep hitting the unchanged Aave code path
|
|
37
|
-
* Blue lending markets by their bytes32
|
|
38
|
-
* V2 markets by their EVK
|
|
39
|
-
*
|
|
40
|
-
*
|
|
36
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
37
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
38
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
39
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
40
|
+
* per-sub-account positions (``sub_account_id``).
|
|
41
|
+
*
|
|
42
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
43
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
44
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
45
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
46
|
+
*
|
|
47
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
48
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
49
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
50
|
+
* silently absent there rather than an error, so read it from
|
|
51
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
52
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
53
|
+
* emitted.)
|
|
41
54
|
*/
|
|
42
55
|
protocol?: CreditProtocol | undefined;
|
|
43
56
|
/**
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./creditprotocol.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Blockchain network.
|
|
14
|
+
* Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
|
|
15
15
|
*/
|
|
16
16
|
export const CreditUnloopRequestChain = {
|
|
17
17
|
Arbitrum: "arbitrum",
|
|
@@ -22,7 +22,7 @@ export const CreditUnloopRequestChain = {
|
|
|
22
22
|
Tempo: "tempo",
|
|
23
23
|
} as const;
|
|
24
24
|
/**
|
|
25
|
-
* Blockchain network.
|
|
25
|
+
* Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
|
|
26
26
|
*/
|
|
27
27
|
export type CreditUnloopRequestChain = ClosedEnum<
|
|
28
28
|
typeof CreditUnloopRequestChain
|
|
@@ -66,7 +66,7 @@ export type CreditUnloopRequest = {
|
|
|
66
66
|
*/
|
|
67
67
|
owner: string;
|
|
68
68
|
/**
|
|
69
|
-
* Blockchain network.
|
|
69
|
+
* Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
|
|
70
70
|
*/
|
|
71
71
|
chain: CreditUnloopRequestChain;
|
|
72
72
|
/**
|
|
@@ -75,11 +75,24 @@ export type CreditUnloopRequest = {
|
|
|
75
75
|
* @remarks
|
|
76
76
|
*
|
|
77
77
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
78
|
-
* field) keep hitting the unchanged Aave code path
|
|
79
|
-
* Blue lending markets by their bytes32
|
|
80
|
-
* V2 markets by their EVK
|
|
81
|
-
*
|
|
82
|
-
*
|
|
78
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
79
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
80
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
81
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
82
|
+
* per-sub-account positions (``sub_account_id``).
|
|
83
|
+
*
|
|
84
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
85
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
86
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
87
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
88
|
+
*
|
|
89
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
90
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
91
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
92
|
+
* silently absent there rather than an error, so read it from
|
|
93
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
94
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
95
|
+
* emitted.)
|
|
83
96
|
*/
|
|
84
97
|
protocol?: CreditProtocol | undefined;
|
|
85
98
|
/**
|
|
@@ -115,7 +128,7 @@ export type CreditUnloopRequest = {
|
|
|
115
128
|
*/
|
|
116
129
|
maxSlippagePercent?: number | string | undefined;
|
|
117
130
|
/**
|
|
118
|
-
* If the target cannot be reached in one transaction (
|
|
131
|
+
* If the target cannot be reached in one transaction, return the maximum-progress plan (preview.fully_unwound=false) instead of a 400. This can happen because every withdrawal is sized to keep the health factor at or above 1.02 at that step, so a position opened very close to its liquidation threshold runs out of headroom before the target is met. A second unloop call, now from a much lower leverage, finishes the job.
|
|
119
132
|
*/
|
|
120
133
|
allowPartial?: boolean | undefined;
|
|
121
134
|
/**
|
|
@@ -123,7 +136,7 @@ export type CreditUnloopRequest = {
|
|
|
123
136
|
*/
|
|
124
137
|
gasSponsorship?: boolean | undefined;
|
|
125
138
|
/**
|
|
126
|
-
* If true, build a display estimate only — no single-use firm quote is ever spent. On a firm-covered unwind (pricing 'auto' or 'firm') the numbers are firm-INDICATIVE, priced off the firm
|
|
139
|
+
* If true, build a display estimate only — no single-use firm quote is ever spent. NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent transaction: on an unwind no firm provider covers, and under pricing=market, the call still falls through to the aggregator and returns a signable transaction. On a firm-covered unwind (pricing 'auto' or 'firm') the numbers are firm-INDICATIVE, priced off the firm provider's live maker levels; otherwise they are market-priced with slippage-bounded floors. Under pricing='firm' a preview no firm provider can serve returns the advisory alone (preview=null + firm_available). Set it on every parameter-exploration call and omit it only on the build the user is about to sign.
|
|
127
140
|
*/
|
|
128
141
|
preview?: boolean | undefined;
|
|
129
142
|
/**
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./unsignedtransaction.js";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Identifies which route priced the swap leg(s): a DEX AGGREGATOR (pool liquidity, slippage-bounded floors) or a FIRM provider (quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses a firm value 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.
|
|
26
26
|
*/
|
|
27
27
|
export const CreditUnloopResponseSwapProvider = {
|
|
28
28
|
OneInch: "one_inch",
|
|
29
29
|
Bebop: "bebop",
|
|
30
30
|
} as const;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Identifies which route priced the swap leg(s): a DEX AGGREGATOR (pool liquidity, slippage-bounded floors) or a FIRM provider (quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses a firm value 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.
|
|
33
33
|
*/
|
|
34
34
|
export type CreditUnloopResponseSwapProvider = ClosedEnum<
|
|
35
35
|
typeof CreditUnloopResponseSwapProvider
|
|
@@ -40,7 +40,7 @@ export type CreditUnloopResponseSwapProvider = ClosedEnum<
|
|
|
40
40
|
*/
|
|
41
41
|
export type CreditUnloopResponse = {
|
|
42
42
|
/**
|
|
43
|
-
* Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — except firm-priced previews (preview=true
|
|
43
|
+
* Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — except firm-priced previews (preview=true on a firm-priced build), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet.
|
|
44
44
|
*/
|
|
45
45
|
transaction?: UnsignedTransaction | null | undefined;
|
|
46
46
|
/**
|
|
@@ -52,11 +52,11 @@ export type CreditUnloopResponse = {
|
|
|
52
52
|
*/
|
|
53
53
|
preview: CreditUnloopPreview | null;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Identifies which route priced the swap leg(s): a DEX AGGREGATOR (pool liquidity, slippage-bounded floors) or a FIRM provider (quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses a firm value 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
56
|
*/
|
|
57
57
|
swapProvider?: CreditUnloopResponseSwapProvider | undefined;
|
|
58
58
|
/**
|
|
59
|
-
* Deadline of the firm swap quotes (the earliest across the unwind's swap legs) — sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable
|
|
59
|
+
* Deadline of the firm swap quotes (the earliest across the unwind's swap legs) — sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable firm-priced builds; null on previews (no quote is spent for a preview).
|
|
60
60
|
*/
|
|
61
61
|
quoteExpiresAt?: Date | null | undefined;
|
|
62
62
|
/**
|
|
@@ -33,11 +33,24 @@ export type CreditWithdrawParams = {
|
|
|
33
33
|
* @remarks
|
|
34
34
|
*
|
|
35
35
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
36
|
-
* field) keep hitting the unchanged Aave code path
|
|
37
|
-
* Blue lending markets by their bytes32
|
|
38
|
-
* V2 markets by their EVK
|
|
39
|
-
*
|
|
40
|
-
*
|
|
36
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
37
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
38
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
39
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
40
|
+
* per-sub-account positions (``sub_account_id``).
|
|
41
|
+
*
|
|
42
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
43
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
44
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
45
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
46
|
+
*
|
|
47
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
48
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
49
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
50
|
+
* silently absent there rather than an error, so read it from
|
|
51
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
52
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
53
|
+
* emitted.)
|
|
41
54
|
*/
|
|
42
55
|
protocol?: CreditProtocol | undefined;
|
|
43
56
|
/**
|
|
@@ -31,11 +31,24 @@ export type DebtPosition = {
|
|
|
31
31
|
* @remarks
|
|
32
32
|
*
|
|
33
33
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
34
|
-
* field) keep hitting the unchanged Aave code path
|
|
35
|
-
* Blue lending markets by their bytes32
|
|
36
|
-
* V2 markets by their EVK
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
35
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
36
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
37
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
38
|
+
* per-sub-account positions (``sub_account_id``).
|
|
39
|
+
*
|
|
40
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
41
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
42
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
43
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
44
|
+
*
|
|
45
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
46
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
47
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
48
|
+
* silently absent there rather than an error, so read it from
|
|
49
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
50
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
51
|
+
* emitted.)
|
|
39
52
|
*/
|
|
40
53
|
protocol?: CreditProtocol | undefined;
|
|
41
54
|
/**
|
|
@@ -47,11 +47,24 @@ export type LoopedPosition = {
|
|
|
47
47
|
* @remarks
|
|
48
48
|
*
|
|
49
49
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
50
|
-
* field) keep hitting the unchanged Aave code path
|
|
51
|
-
* Blue lending markets by their bytes32
|
|
52
|
-
* V2 markets by their EVK
|
|
53
|
-
*
|
|
54
|
-
*
|
|
50
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
51
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
52
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
53
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
54
|
+
* per-sub-account positions (``sub_account_id``).
|
|
55
|
+
*
|
|
56
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
57
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
58
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
59
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
60
|
+
*
|
|
61
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
62
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
63
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
64
|
+
* silently absent there rather than an error, so read it from
|
|
65
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
66
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
67
|
+
* emitted.)
|
|
55
68
|
*/
|
|
56
69
|
protocol: CreditProtocol;
|
|
57
70
|
/**
|
|
@@ -40,11 +40,24 @@ export type RebalanceTarget = {
|
|
|
40
40
|
* @remarks
|
|
41
41
|
*
|
|
42
42
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
43
|
-
* field) keep hitting the unchanged Aave code path
|
|
44
|
-
* Blue lending markets by their bytes32
|
|
45
|
-
* V2 markets by their EVK
|
|
46
|
-
*
|
|
47
|
-
*
|
|
43
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
44
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
45
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
46
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
47
|
+
* per-sub-account positions (``sub_account_id``).
|
|
48
|
+
*
|
|
49
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
50
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
51
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
52
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
53
|
+
*
|
|
54
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
55
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
56
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
57
|
+
* silently absent there rather than an error, so read it from
|
|
58
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
59
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
60
|
+
* emitted.)
|
|
48
61
|
*/
|
|
49
62
|
protocol?: CreditProtocol | undefined;
|
|
50
63
|
/**
|
|
@@ -49,11 +49,24 @@ export type RebalanceTargetPreview = {
|
|
|
49
49
|
* @remarks
|
|
50
50
|
*
|
|
51
51
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
52
|
-
* field) keep hitting the unchanged Aave code path
|
|
53
|
-
* Blue lending markets by their bytes32
|
|
54
|
-
* V2 markets by their EVK
|
|
55
|
-
*
|
|
56
|
-
*
|
|
52
|
+
* field) keep hitting the unchanged Aave code path; markets are named by token
|
|
53
|
+
* symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
|
|
54
|
+
* ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
|
|
55
|
+
* ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
|
|
56
|
+
* per-sub-account positions (``sub_account_id``).
|
|
57
|
+
*
|
|
58
|
+
* Deployment is per chain, so a valid protocol can still 422 on a given chain:
|
|
59
|
+
* AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
|
|
60
|
+
* chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
|
|
61
|
+
* (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
|
|
62
|
+
*
|
|
63
|
+
* All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
|
|
64
|
+
* NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
|
|
65
|
+
* ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
|
|
66
|
+
* silently absent there rather than an error, so read it from
|
|
67
|
+
* ``/v2/credit/positions`` instead. (EULER still appears in the
|
|
68
|
+
* ``looped_positions`` response enum because this enum is shared; it is never
|
|
69
|
+
* emitted.)
|
|
57
70
|
*/
|
|
58
71
|
protocol: CreditProtocol;
|
|
59
72
|
/**
|