@compass-labs/api-sdk 2.2.80 → 2.2.81-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/funcs/creditCreditLoop.d.ts +4 -1
- package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditLoop.js +4 -1
- package/dist/commonjs/funcs/creditCreditLoop.js.map +1 -1
- package/dist/commonjs/funcs/creditCreditRebalance.d.ts +6 -0
- package/dist/commonjs/funcs/creditCreditRebalance.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditRebalance.js +6 -0
- package/dist/commonjs/funcs/creditCreditRebalance.js.map +1 -1
- package/dist/commonjs/funcs/creditCreditUnloop.d.ts +5 -0
- package/dist/commonjs/funcs/creditCreditUnloop.d.ts.map +1 -1
- package/dist/commonjs/funcs/creditCreditUnloop.js +5 -0
- package/dist/commonjs/funcs/creditCreditUnloop.js.map +1 -1
- package/dist/commonjs/sdk/credit.d.ts +15 -1
- package/dist/commonjs/sdk/credit.d.ts.map +1 -1
- package/dist/commonjs/sdk/credit.js +15 -1
- package/dist/commonjs/sdk/credit.js.map +1 -1
- package/dist/esm/funcs/creditCreditLoop.d.ts +4 -1
- package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditLoop.js +4 -1
- package/dist/esm/funcs/creditCreditLoop.js.map +1 -1
- package/dist/esm/funcs/creditCreditRebalance.d.ts +6 -0
- package/dist/esm/funcs/creditCreditRebalance.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditRebalance.js +6 -0
- package/dist/esm/funcs/creditCreditRebalance.js.map +1 -1
- package/dist/esm/funcs/creditCreditUnloop.d.ts +5 -0
- package/dist/esm/funcs/creditCreditUnloop.d.ts.map +1 -1
- package/dist/esm/funcs/creditCreditUnloop.js +5 -0
- package/dist/esm/funcs/creditCreditUnloop.js.map +1 -1
- package/dist/esm/sdk/credit.d.ts +15 -1
- package/dist/esm/sdk/credit.d.ts.map +1 -1
- package/dist/esm/sdk/credit.js +15 -1
- package/dist/esm/sdk/credit.js.map +1 -1
- package/docs/sdks/credit/README.md +15 -1
- package/openapi_prepped_for_speakeasy.json +3 -3
- package/package.json +1 -1
- package/src/funcs/creditCreditLoop.ts +4 -1
- package/src/funcs/creditCreditRebalance.ts +6 -0
- package/src/funcs/creditCreditUnloop.ts +5 -0
- package/src/sdk/credit.ts +15 -1
|
@@ -21,7 +21,10 @@ import { Result } from "../types/fp.js";
|
|
|
21
21
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
22
22
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
23
23
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
24
|
-
* raise max_slippage_percent.
|
|
24
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
25
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
26
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
27
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
25
28
|
*
|
|
26
29
|
* The Credit Account must already hold initial_collateral_amount of
|
|
27
30
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditLoop.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditLoop.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,O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
|
@@ -60,7 +60,10 @@ const async_js_1 = require("../types/async.js");
|
|
|
60
60
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
61
61
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
62
62
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
63
|
-
* raise max_slippage_percent.
|
|
63
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
64
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
65
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
66
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
64
67
|
*
|
|
65
68
|
* The Credit Account must already hold initial_collateral_amount of
|
|
66
69
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditLoop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditLoop.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"creditCreditLoop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditLoop.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDH,4CAuBC;AApED,sDAAiD;AACjD,4CAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAC3C,0EAA4D;AAS5D,kEAAoD;AAGpD,gDAAwD;AAGxD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,gBAAgB,CAC9B,MAAyB,EACzB,OAAqC,EACrC,OAAwB;IAexB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAyB,EACzB,OAAqC,EACrC,OAAwB;IAkBxB,MAAM,MAAM,GAAG,IA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,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE;KAC/C,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAY5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,gCAAgC,CAAC,EACxD,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -38,6 +38,12 @@ import { Result } from "../types/fp.js";
|
|
|
38
38
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
39
39
|
* one account-level health factor, which the preview reports.
|
|
40
40
|
*
|
|
41
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
42
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
43
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
44
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
45
|
+
* tolerance).
|
|
46
|
+
*
|
|
41
47
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
42
48
|
* current book via /v2/credit/looped_positions.
|
|
43
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditRebalance.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditRebalance.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"creditCreditRebalance.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditRebalance.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,sBAAsB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,uBAAuB,EAChC,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -77,6 +77,12 @@ const async_js_1 = require("../types/async.js");
|
|
|
77
77
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
78
78
|
* one account-level health factor, which the preview reports.
|
|
79
79
|
*
|
|
80
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
81
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
82
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
83
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
84
|
+
* tolerance).
|
|
85
|
+
*
|
|
80
86
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
81
87
|
* current book via /v2/credit/looped_positions.
|
|
82
88
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditRebalance.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditRebalance.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"creditCreditRebalance.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditRebalance.ts"],"names":[],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AAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -33,6 +33,11 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
34
34
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
35
35
|
*
|
|
36
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
37
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
38
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
39
|
+
* (fully_unwound=false) — it never fails the call.
|
|
40
|
+
*
|
|
36
41
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
37
42
|
* open loops via /v2/credit/looped_positions.
|
|
38
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditUnloop.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditUnloop.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"creditCreditUnloop.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditUnloop.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,oBAAoB,EAC7B,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -72,6 +72,11 @@ const async_js_1 = require("../types/async.js");
|
|
|
72
72
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
73
73
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
74
74
|
*
|
|
75
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
76
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
77
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
78
|
+
* (fully_unwound=false) — it never fails the call.
|
|
79
|
+
*
|
|
75
80
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
76
81
|
* open loops via /v2/credit/looped_positions.
|
|
77
82
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditUnloop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditUnloop.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"creditCreditUnloop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditUnloop.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DH,gDAuBC;AA/ED,sDAAiD;AACjD,4CAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAC3C,0EAA4D;AAS5D,kEAAoD;AAGpD,gDAAwD;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,SAAgB,kBAAkB,CAChC,MAAyB,EACzB,OAAuC,EACvC,OAAwB;IAexB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAyB,EACzB,OAAuC,EACvC,OAAwB;IAkBxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,kCAAkC,CAAC,KAAK,CAAC,KAAK,CAAC,EACrE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,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AC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,kCAAkC,CAAC,EAC1D,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -102,7 +102,10 @@ export declare class Credit extends ClientSDK {
|
|
|
102
102
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
103
103
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
104
104
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
105
|
-
* raise max_slippage_percent.
|
|
105
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
106
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
107
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
108
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
106
109
|
*
|
|
107
110
|
* The Credit Account must already hold initial_collateral_amount of
|
|
108
111
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -134,6 +137,11 @@ export declare class Credit extends ClientSDK {
|
|
|
134
137
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
135
138
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
136
139
|
*
|
|
140
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
141
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
142
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
143
|
+
* (fully_unwound=false) — it never fails the call.
|
|
144
|
+
*
|
|
137
145
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
138
146
|
* open loops via /v2/credit/looped_positions.
|
|
139
147
|
*/
|
|
@@ -168,6 +176,12 @@ export declare class Credit extends ClientSDK {
|
|
|
168
176
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
169
177
|
* one account-level health factor, which the preview reports.
|
|
170
178
|
*
|
|
179
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
180
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
181
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
182
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
183
|
+
* tolerance).
|
|
184
|
+
*
|
|
171
185
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
172
186
|
* current book via /v2/credit/looped_positions.
|
|
173
187
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,MAAO,SAAQ,SAAS;IACnC;;;;;;;;OAQG;IACG,eAAe,CACnB,OAAO,EAAE,UAAU,CAAC,wBAAwB,EAC5C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAQ9C;;;;;;;;OAQG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,OAA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oB,CAAC;IAQ3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACG,eAAe,CACnB,OAAO,EAAE,UAAU,CAAC,sBAAsB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAQ9C;;;;;;;;;;;;;;;OAeG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAQ7C;;;;;;;;;;;;;OAaG;IACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;;;;;;;OAQG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAO5C"}
|
|
@@ -134,7 +134,10 @@ class Credit extends sdks_js_1.ClientSDK {
|
|
|
134
134
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
135
135
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
136
136
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
137
|
-
* raise max_slippage_percent.
|
|
137
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
138
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
139
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
140
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
138
141
|
*
|
|
139
142
|
* The Credit Account must already hold initial_collateral_amount of
|
|
140
143
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -168,6 +171,11 @@ class Credit extends sdks_js_1.ClientSDK {
|
|
|
168
171
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
169
172
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
170
173
|
*
|
|
174
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
175
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
176
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
177
|
+
* (fully_unwound=false) — it never fails the call.
|
|
178
|
+
*
|
|
171
179
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
172
180
|
* open loops via /v2/credit/looped_positions.
|
|
173
181
|
*/
|
|
@@ -204,6 +212,12 @@ class Credit extends sdks_js_1.ClientSDK {
|
|
|
204
212
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
205
213
|
* one account-level health factor, which the preview reports.
|
|
206
214
|
*
|
|
215
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
216
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
217
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
218
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
219
|
+
* tolerance).
|
|
220
|
+
*
|
|
207
221
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
208
222
|
* current book via /v2/credit/looped_positions.
|
|
209
223
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.js","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8EAAwE;AACxE,0EAAoE;AACpE,0EAAoE;AACpE,wFAAkF;AAClF,sFAAgF;AAChF,sEAAgE;AAChE,4FAAsF;AACtF,wFAAkF;AAClF,gFAA0E;AAC1E,gFAA0E;AAC1E,wEAAkE;AAClE,8EAAwE;AACxE,0EAAoE;AACpE,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,MAAO,SAAQ,mBAAS;IACnC;;;;;;;;OAQG;IACH,KAAK,CAAC,eAAe,CACnB,OAA4C,EAC5C,OAAwB;QAExB,OAAO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wB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AApWD,wBAoWC"}
|
|
@@ -21,7 +21,10 @@ import { Result } from "../types/fp.js";
|
|
|
21
21
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
22
22
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
23
23
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
24
|
-
* raise max_slippage_percent.
|
|
24
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
25
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
26
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
27
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
25
28
|
*
|
|
26
29
|
* The Credit Account must already hold initial_collateral_amount of
|
|
27
30
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditLoop.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditLoop.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BA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rB,CACF,CAMA"}
|
|
@@ -24,7 +24,10 @@ import { APIPromise } from "../types/async.js";
|
|
|
24
24
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
25
25
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
26
26
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
27
|
-
* raise max_slippage_percent.
|
|
27
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
28
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
29
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
30
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
28
31
|
*
|
|
29
32
|
* The Credit Account must already hold initial_collateral_amount of
|
|
30
33
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditLoop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditLoop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAS5D,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxD
|
|
1
|
+
{"version":3,"file":"creditCreditLoop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditLoop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,O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EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -38,6 +38,12 @@ import { Result } from "../types/fp.js";
|
|
|
38
38
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
39
39
|
* one account-level health factor, which the preview reports.
|
|
40
40
|
*
|
|
41
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
42
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
43
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
44
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
45
|
+
* tolerance).
|
|
46
|
+
*
|
|
41
47
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
42
48
|
* current book via /v2/credit/looped_positions.
|
|
43
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditRebalance.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditRebalance.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAA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B,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -41,6 +41,12 @@ import { APIPromise } from "../types/async.js";
|
|
|
41
41
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
42
42
|
* one account-level health factor, which the preview reports.
|
|
43
43
|
*
|
|
44
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
45
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
46
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
47
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
48
|
+
* tolerance).
|
|
49
|
+
*
|
|
44
50
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
45
51
|
* current book via /v2/credit/looped_positions.
|
|
46
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditRebalance.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditRebalance.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAS5D,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxD
|
|
1
|
+
{"version":3,"file":"creditCreditRebalance.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditRebalance.ts"],"names":[],"mappings":"AAAA;;GAEG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AAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -33,6 +33,11 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
34
34
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
35
35
|
*
|
|
36
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
37
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
38
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
39
|
+
* (fully_unwound=false) — it never fails the call.
|
|
40
|
+
*
|
|
36
41
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
37
42
|
* open loops via /v2/credit/looped_positions.
|
|
38
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditUnloop.d.ts","sourceRoot":"","sources":["../../../src/funcs/creditCreditUnloop.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAM/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,C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AAkB,CACrB,CACF,CAMA"}
|
|
@@ -36,6 +36,11 @@ import { APIPromise } from "../types/async.js";
|
|
|
36
36
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
37
37
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
38
38
|
*
|
|
39
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
40
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
41
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
42
|
+
* (fully_unwound=false) — it never fails the call.
|
|
43
|
+
*
|
|
39
44
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
40
45
|
* open loops via /v2/credit/looped_positions.
|
|
41
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditCreditUnloop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditUnloop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAS5D,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxD
|
|
1
|
+
{"version":3,"file":"creditCreditUnloop.js","sourceRoot":"","sources":["../../../src/funcs/creditCreditUnloop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,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C,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/esm/sdk/credit.d.ts
CHANGED
|
@@ -102,7 +102,10 @@ export declare class Credit extends ClientSDK {
|
|
|
102
102
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
103
103
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
104
104
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
105
|
-
* raise max_slippage_percent.
|
|
105
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
106
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
107
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
108
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
106
109
|
*
|
|
107
110
|
* The Credit Account must already hold initial_collateral_amount of
|
|
108
111
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -134,6 +137,11 @@ export declare class Credit extends ClientSDK {
|
|
|
134
137
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
135
138
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
136
139
|
*
|
|
140
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
141
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
142
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
143
|
+
* (fully_unwound=false) — it never fails the call.
|
|
144
|
+
*
|
|
137
145
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
138
146
|
* open loops via /v2/credit/looped_positions.
|
|
139
147
|
*/
|
|
@@ -168,6 +176,12 @@ export declare class Credit extends ClientSDK {
|
|
|
168
176
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
169
177
|
* one account-level health factor, which the preview reports.
|
|
170
178
|
*
|
|
179
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
180
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
181
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
182
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
183
|
+
* tolerance).
|
|
184
|
+
*
|
|
171
185
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
172
186
|
* current book via /v2/credit/looped_positions.
|
|
173
187
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,MAAO,SAAQ,SAAS;IACnC;;;;;;;;OAQG;IACG,eAAe,CACnB,OAAO,EAAE,UAAU,CAAC,wBAAwB,EAC5C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAQ9C;;;;;;;;OAQG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAQ7C;;;;;;;;;;;;OAYG;IACG,qBAAqB,CACzB,OAAO,EAAE,UAAU,CAAC,8BAA8B,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC;IAQpD;;;;;;;;;;OAUG;IACG,kBAAkB,CACtB,OAAO,EAAE,U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AO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAQ7C;;;;;;;;;;;;;OAaG;IACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;;;;;;;OAQG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAO5C"}
|
package/dist/esm/sdk/credit.js
CHANGED
|
@@ -131,7 +131,10 @@ export class Credit extends ClientSDK {
|
|
|
131
131
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
132
132
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
133
133
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
134
|
-
* raise max_slippage_percent.
|
|
134
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
135
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
136
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
137
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
135
138
|
*
|
|
136
139
|
* The Credit Account must already hold initial_collateral_amount of
|
|
137
140
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -165,6 +168,11 @@ export class Credit extends ClientSDK {
|
|
|
165
168
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
166
169
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
167
170
|
*
|
|
171
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
172
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
173
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
174
|
+
* (fully_unwound=false) — it never fails the call.
|
|
175
|
+
*
|
|
168
176
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
169
177
|
* open loops via /v2/credit/looped_positions.
|
|
170
178
|
*/
|
|
@@ -201,6 +209,12 @@ export class Credit extends ClientSDK {
|
|
|
201
209
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
202
210
|
* one account-level health factor, which the preview reports.
|
|
203
211
|
*
|
|
212
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
213
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
214
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
215
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
216
|
+
* tolerance).
|
|
217
|
+
*
|
|
204
218
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
205
219
|
* current book via /v2/credit/looped_positions.
|
|
206
220
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.js","sourceRoot":"","sources":["../../../src/sdk/credit.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CA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OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,kBAAkB,CACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,KAAK,CAAC,eAAe,CACnB,OAA0C,EAC1C,OAAwB;QAExB,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,oBAAoB,CACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,iBAAiB,CAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,kBAAkB,CACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -613,7 +613,10 @@ slippage tolerance can never break a later step; any positive surplus stays
|
|
|
613
613
|
in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
614
614
|
Very large loops relative to pool depth can still exceed the slippage
|
|
615
615
|
tolerance through their own cumulative price impact — size accordingly or
|
|
616
|
-
raise max_slippage_percent.
|
|
616
|
+
raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
617
|
+
the swap router's minimum routable size; when it does the loop simply ends
|
|
618
|
+
early on that supply — the achieved multiplier is still guaranteed within
|
|
619
|
+
0.5% of the request or the call returns a clean 400.
|
|
617
620
|
|
|
618
621
|
The Credit Account must already hold initial_collateral_amount of
|
|
619
622
|
collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -730,6 +733,11 @@ the maximum single-transaction progress (preview.fully_unwound=false), then
|
|
|
730
733
|
call unloop again to finish. Very large unwinds relative to pool depth can
|
|
731
734
|
still exceed the slippage tolerance through their own cumulative price impact.
|
|
732
735
|
|
|
736
|
+
Positions are unwound as far as the swap router can route; a residual below
|
|
737
|
+
the router's minimum routable size is either repaid directly from the Credit
|
|
738
|
+
Account's idle balance (a true full close) or reported honestly in the preview
|
|
739
|
+
(fully_unwound=false) — it never fails the call.
|
|
740
|
+
|
|
733
741
|
For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
734
742
|
open loops via /v2/credit/looped_positions.
|
|
735
743
|
|
|
@@ -845,6 +853,12 @@ into two calls. Every deleveraging step keeps the health factor ≥ 1.02 and
|
|
|
845
853
|
every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
846
854
|
one account-level health factor, which the preview reports.
|
|
847
855
|
|
|
856
|
+
Dust tails and routing swaps below the swap router's minimum routable size do
|
|
857
|
+
not fail the call: a releasing target that cannot fully unwind returns its
|
|
858
|
+
honest residual in the preview, and an unroutable routing swap is skipped
|
|
859
|
+
(its uncovered amount only 422s the rebalance if it breaches the funding
|
|
860
|
+
tolerance).
|
|
861
|
+
|
|
848
862
|
For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
849
863
|
current book via /v2/credit/looped_positions.
|
|
850
864
|
|
|
@@ -6270,7 +6270,7 @@
|
|
|
6270
6270
|
"Credit"
|
|
6271
6271
|
],
|
|
6272
6272
|
"summary": "Open a leveraged loop",
|
|
6273
|
-
"description": "Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.\n\nRepeatedly supplies collateral, borrows at the requested loan-to-value, and\nswaps the borrow back to collateral. Each iteration's supply uses the swap's\nGUARANTEED minimum output (enforced on-chain), so a fill anywhere within the\nslippage tolerance can never break a later step; any positive surplus stays\nin the Credit Account (the preview reports the bound as estimated_max_dust).\nVery large loops relative to pool depth can still exceed the slippage\ntolerance through their own cumulative price impact \u2014 size accordingly or\nraise max_slippage_percent.\n\nThe Credit Account must already hold initial_collateral_amount of\ncollateral_token. For protocol=MORPHO pass a market_id from\n/v2/credit/morpho_markets.",
|
|
6273
|
+
"description": "Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.\n\nRepeatedly supplies collateral, borrows at the requested loan-to-value, and\nswaps the borrow back to collateral. Each iteration's supply uses the swap's\nGUARANTEED minimum output (enforced on-chain), so a fill anywhere within the\nslippage tolerance can never break a later step; any positive surplus stays\nin the Credit Account (the preview reports the bound as estimated_max_dust).\nVery large loops relative to pool depth can still exceed the slippage\ntolerance through their own cumulative price impact \u2014 size accordingly or\nraise max_slippage_percent. Conversely, the geometric tail can shrink below\nthe swap router's minimum routable size; when it does the loop simply ends\nearly on that supply \u2014 the achieved multiplier is still guaranteed within\n0.5% of the request or the call returns a clean 400.\n\nThe Credit Account must already hold initial_collateral_amount of\ncollateral_token. For protocol=MORPHO pass a market_id from\n/v2/credit/morpho_markets.",
|
|
6274
6274
|
"operationId": "v2_credit_loop",
|
|
6275
6275
|
"requestBody": {
|
|
6276
6276
|
"content": {
|
|
@@ -6313,7 +6313,7 @@
|
|
|
6313
6313
|
"Credit"
|
|
6314
6314
|
],
|
|
6315
6315
|
"summary": "Unwind a leveraged loop",
|
|
6316
|
-
"description": "Unwind an Aave or Morpho loop in ONE atomic transaction.\n\nRepeatedly withdraws collateral, swaps it to the borrow token at a GUARANTEED\nminimum output (enforced on-chain), and repays. The floor discipline means a\nswap filling anywhere within the slippage tolerance can never break a later\nstep; any positive surplus stays in the Credit Account as borrow-token dust\n(the preview reports the bound as estimated_max_dust).\n\nOmit target_multiplier for a full close: the debt is cleared exactly \u2014\naccrued interest included \u2014 and the pair collateral is returned to the Credit\nAccount. Pass 1 to clear the debt but keep the collateral supplied, or a value\nabove 1 to delever to that multiplier (it must be below the position's current\nmultiplier).\n\nEach withdrawal is sized to keep the position's health factor \u2265 1.02 at that\nstep, so a position opened very close to the liquidation threshold may need\nmore than one transaction to fully close \u2014 set allow_partial=true to return\nthe maximum single-transaction progress (preview.fully_unwound=false), then\ncall unloop again to finish. Very large unwinds relative to pool depth can\nstill exceed the slippage tolerance through their own cumulative price impact.\n\nFor protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect\nopen loops via /v2/credit/looped_positions.",
|
|
6316
|
+
"description": "Unwind an Aave or Morpho loop in ONE atomic transaction.\n\nRepeatedly withdraws collateral, swaps it to the borrow token at a GUARANTEED\nminimum output (enforced on-chain), and repays. The floor discipline means a\nswap filling anywhere within the slippage tolerance can never break a later\nstep; any positive surplus stays in the Credit Account as borrow-token dust\n(the preview reports the bound as estimated_max_dust).\n\nOmit target_multiplier for a full close: the debt is cleared exactly \u2014\naccrued interest included \u2014 and the pair collateral is returned to the Credit\nAccount. Pass 1 to clear the debt but keep the collateral supplied, or a value\nabove 1 to delever to that multiplier (it must be below the position's current\nmultiplier).\n\nEach withdrawal is sized to keep the position's health factor \u2265 1.02 at that\nstep, so a position opened very close to the liquidation threshold may need\nmore than one transaction to fully close \u2014 set allow_partial=true to return\nthe maximum single-transaction progress (preview.fully_unwound=false), then\ncall unloop again to finish. Very large unwinds relative to pool depth can\nstill exceed the slippage tolerance through their own cumulative price impact.\n\nPositions are unwound as far as the swap router can route; a residual below\nthe router's minimum routable size is either repaid directly from the Credit\nAccount's idle balance (a true full close) or reported honestly in the preview\n(fully_unwound=false) \u2014 it never fails the call.\n\nFor protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect\nopen loops via /v2/credit/looped_positions.",
|
|
6317
6317
|
"operationId": "v2_credit_unloop",
|
|
6318
6318
|
"requestBody": {
|
|
6319
6319
|
"content": {
|
|
@@ -6356,7 +6356,7 @@
|
|
|
6356
6356
|
"Credit"
|
|
6357
6357
|
],
|
|
6358
6358
|
"summary": "Rebalance the leveraged credit book",
|
|
6359
|
-
"description": "Rebalance the leveraged credit book in ONE atomic transaction.\n\nList only the positions to change \u2014 anything not named is left untouched;\nremove a position with close=true. Each target states an end state:\ntarget_equity_usd (net USD committed) \u00d7 target_multiplier.\n\nReleasing targets run first (each unwind/delever frees tokens into the Credit\nAccount), the freed tokens are then routed by swaps at a GUARANTEED minimum\noutput (enforced on-chain), and consuming targets run last \u2014 so moving a\nlevered position between markets, token pairs, or protocols (Aave \u2194 Morpho) is\nsimply a close plus an open in the same transaction.\n\nNet book growth is funded from the Credit Account's existing idle balance \u2014\nfund it first via /v2/credit/transfer; a net release stays in the Credit\nAccount as idle balance. Any swap surplus above the guaranteed floors also\nstays in the Credit Account (preview.estimated_max_dust) \u2014 recoverable, never\nlost.\n\nA book already at its target returns transaction: null with the preview \u2014 the\ncall is idempotent and safe to drive from a converge-to-target loop.\n\nA rebalance too large for one transaction is rejected with a 422 \u2014 split it\ninto two calls. Every deleveraging step keeps the health factor \u2265 1.02 and\nevery leveraging step respects the protocol's borrow limits; Aave targets share\none account-level health factor, which the preview reports.\n\nFor protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the\ncurrent book via /v2/credit/looped_positions.",
|
|
6359
|
+
"description": "Rebalance the leveraged credit book in ONE atomic transaction.\n\nList only the positions to change \u2014 anything not named is left untouched;\nremove a position with close=true. Each target states an end state:\ntarget_equity_usd (net USD committed) \u00d7 target_multiplier.\n\nReleasing targets run first (each unwind/delever frees tokens into the Credit\nAccount), the freed tokens are then routed by swaps at a GUARANTEED minimum\noutput (enforced on-chain), and consuming targets run last \u2014 so moving a\nlevered position between markets, token pairs, or protocols (Aave \u2194 Morpho) is\nsimply a close plus an open in the same transaction.\n\nNet book growth is funded from the Credit Account's existing idle balance \u2014\nfund it first via /v2/credit/transfer; a net release stays in the Credit\nAccount as idle balance. Any swap surplus above the guaranteed floors also\nstays in the Credit Account (preview.estimated_max_dust) \u2014 recoverable, never\nlost.\n\nA book already at its target returns transaction: null with the preview \u2014 the\ncall is idempotent and safe to drive from a converge-to-target loop.\n\nA rebalance too large for one transaction is rejected with a 422 \u2014 split it\ninto two calls. Every deleveraging step keeps the health factor \u2265 1.02 and\nevery leveraging step respects the protocol's borrow limits; Aave targets share\none account-level health factor, which the preview reports.\n\nDust tails and routing swaps below the swap router's minimum routable size do\nnot fail the call: a releasing target that cannot fully unwind returns its\nhonest residual in the preview, and an unroutable routing swap is skipped\n(its uncovered amount only 422s the rebalance if it breaches the funding\ntolerance).\n\nFor protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the\ncurrent book via /v2/credit/looped_positions.",
|
|
6360
6360
|
"operationId": "v2_credit_rebalance",
|
|
6361
6361
|
"requestBody": {
|
|
6362
6362
|
"content": {
|
package/package.json
CHANGED
|
@@ -39,7 +39,10 @@ import { Result } from "../types/fp.js";
|
|
|
39
39
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
40
40
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
41
41
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
42
|
-
* raise max_slippage_percent.
|
|
42
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
43
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
44
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
45
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
43
46
|
*
|
|
44
47
|
* The Credit Account must already hold initial_collateral_amount of
|
|
45
48
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -56,6 +56,12 @@ import { Result } from "../types/fp.js";
|
|
|
56
56
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
57
57
|
* one account-level health factor, which the preview reports.
|
|
58
58
|
*
|
|
59
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
60
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
61
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
62
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
63
|
+
* tolerance).
|
|
64
|
+
*
|
|
59
65
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
60
66
|
* current book via /v2/credit/looped_positions.
|
|
61
67
|
*/
|
|
@@ -51,6 +51,11 @@ import { Result } from "../types/fp.js";
|
|
|
51
51
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
52
52
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
53
53
|
*
|
|
54
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
55
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
56
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
57
|
+
* (fully_unwound=false) — it never fails the call.
|
|
58
|
+
*
|
|
54
59
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
55
60
|
* open loops via /v2/credit/looped_positions.
|
|
56
61
|
*/
|
package/src/sdk/credit.ts
CHANGED
|
@@ -191,7 +191,10 @@ export class Credit extends ClientSDK {
|
|
|
191
191
|
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
192
192
|
* Very large loops relative to pool depth can still exceed the slippage
|
|
193
193
|
* tolerance through their own cumulative price impact — size accordingly or
|
|
194
|
-
* raise max_slippage_percent.
|
|
194
|
+
* raise max_slippage_percent. Conversely, the geometric tail can shrink below
|
|
195
|
+
* the swap router's minimum routable size; when it does the loop simply ends
|
|
196
|
+
* early on that supply — the achieved multiplier is still guaranteed within
|
|
197
|
+
* 0.5% of the request or the call returns a clean 400.
|
|
195
198
|
*
|
|
196
199
|
* The Credit Account must already hold initial_collateral_amount of
|
|
197
200
|
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
@@ -233,6 +236,11 @@ export class Credit extends ClientSDK {
|
|
|
233
236
|
* call unloop again to finish. Very large unwinds relative to pool depth can
|
|
234
237
|
* still exceed the slippage tolerance through their own cumulative price impact.
|
|
235
238
|
*
|
|
239
|
+
* Positions are unwound as far as the swap router can route; a residual below
|
|
240
|
+
* the router's minimum routable size is either repaid directly from the Credit
|
|
241
|
+
* Account's idle balance (a true full close) or reported honestly in the preview
|
|
242
|
+
* (fully_unwound=false) — it never fails the call.
|
|
243
|
+
*
|
|
236
244
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
|
|
237
245
|
* open loops via /v2/credit/looped_positions.
|
|
238
246
|
*/
|
|
@@ -277,6 +285,12 @@ export class Credit extends ClientSDK {
|
|
|
277
285
|
* every leveraging step respects the protocol's borrow limits; Aave targets share
|
|
278
286
|
* one account-level health factor, which the preview reports.
|
|
279
287
|
*
|
|
288
|
+
* Dust tails and routing swaps below the swap router's minimum routable size do
|
|
289
|
+
* not fail the call: a releasing target that cannot fully unwind returns its
|
|
290
|
+
* honest residual in the preview, and an unroutable routing swap is skipped
|
|
291
|
+
* (its uncovered amount only 422s the rebalance if it breaches the funding
|
|
292
|
+
* tolerance).
|
|
293
|
+
*
|
|
280
294
|
* For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
|
|
281
295
|
* current book via /v2/credit/looped_positions.
|
|
282
296
|
*/
|