@compass-labs/api-sdk 2.2.93-rc.0 → 2.2.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/models/components/creditlooppreview.d.ts +4 -0
- package/dist/commonjs/models/components/creditlooppreview.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditlooppreview.js +2 -0
- package/dist/commonjs/models/components/creditlooppreview.js.map +1 -1
- package/dist/commonjs/models/components/looplegpreview.d.ts +4 -0
- package/dist/commonjs/models/components/looplegpreview.d.ts.map +1 -1
- package/dist/commonjs/models/components/looplegpreview.js +2 -0
- package/dist/commonjs/models/components/looplegpreview.js.map +1 -1
- package/dist/esm/models/components/creditlooppreview.d.ts +4 -0
- package/dist/esm/models/components/creditlooppreview.d.ts.map +1 -1
- package/dist/esm/models/components/creditlooppreview.js +2 -0
- package/dist/esm/models/components/creditlooppreview.js.map +1 -1
- package/dist/esm/models/components/looplegpreview.d.ts +4 -0
- package/dist/esm/models/components/looplegpreview.d.ts.map +1 -1
- package/dist/esm/models/components/looplegpreview.js +2 -0
- package/dist/esm/models/components/looplegpreview.js.map +1 -1
- package/docs/models/components/creditlooppreview.md +12 -10
- package/docs/models/components/creditloopresponse.md +1 -0
- package/docs/models/components/looplegpreview.md +6 -5
- package/openapi_prepped_for_speakeasy.json +19 -1
- package/package.json +1 -1
- package/src/models/components/creditlooppreview.ts +6 -0
- package/src/models/components/looplegpreview.ts +6 -0
|
@@ -34,6 +34,10 @@ export type CreditLoopPreview = {
|
|
|
34
34
|
* Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote − guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost.
|
|
35
35
|
*/
|
|
36
36
|
estimatedMaxDust: string;
|
|
37
|
+
/**
|
|
38
|
+
* Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact — the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero.
|
|
39
|
+
*/
|
|
40
|
+
estimatedSwapCost: string;
|
|
37
41
|
/**
|
|
38
42
|
* Per-iteration breakdown.
|
|
39
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditlooppreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,
|
|
1
|
+
{"version":3,"file":"creditlooppreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,CAqBP,CAAC;AAEH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAMxD"}
|
|
@@ -51,6 +51,7 @@ exports.CreditLoopPreview$inboundSchema = z.object({
|
|
|
51
51
|
projected_ltv: z.string(),
|
|
52
52
|
projected_health_factor: z.string(),
|
|
53
53
|
estimated_max_dust: z.string(),
|
|
54
|
+
estimated_swap_cost: z.string(),
|
|
54
55
|
legs: z.array(looplegpreview_js_1.LoopLegPreview$inboundSchema).optional(),
|
|
55
56
|
}).transform((v) => {
|
|
56
57
|
return (0, primitives_js_1.remap)(v, {
|
|
@@ -60,6 +61,7 @@ exports.CreditLoopPreview$inboundSchema = z.object({
|
|
|
60
61
|
"projected_ltv": "projectedLtv",
|
|
61
62
|
"projected_health_factor": "projectedHealthFactor",
|
|
62
63
|
"estimated_max_dust": "estimatedMaxDust",
|
|
64
|
+
"estimated_swap_cost": "estimatedSwapCost",
|
|
63
65
|
});
|
|
64
66
|
});
|
|
65
67
|
function creditLoopPreviewFromJSON(jsonString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditlooppreview.js","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"creditlooppreview.js","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFH,8DAQC;AAvFD,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AAGjD,2DAG6B;AA4C7B,gBAAgB;AACH,QAAA,+BAA+B,GAIxC,CAAC,CAAC,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC5B,yBAAyB,EAAE,CAAC,CAAC,MAAM,EAAE;IACrC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IACnC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,gDAA4B,CAAC,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,2BAA2B,EAAE,yBAAyB;QACtD,gBAAgB,EAAE,eAAe;QACjC,qBAAqB,EAAE,oBAAoB;QAC3C,eAAe,EAAE,cAAc;QAC/B,yBAAyB,EAAE,uBAAuB;QAClD,oBAAoB,EAAE,kBAAkB;QACxC,qBAAqB,EAAE,mBAAmB;KAC3C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAgB,yBAAyB,CACvC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,uCAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC3D,+CAA+C,CAChD,CAAC;AACJ,CAAC"}
|
|
@@ -17,6 +17,10 @@ export type LoopLegPreview = {
|
|
|
17
17
|
* Guaranteed swap output (collateral units) — the next iteration's supply. Enforced on-chain by the swap's minimum-return.
|
|
18
18
|
*/
|
|
19
19
|
minSwapOut?: string | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Quoted swap output (collateral units) before the slippage floor is applied. Only min_swap_out is guaranteed on-chain; the gap between the two is the adverse-slippage tolerance, bounded by max_slippage_percent, not a surplus that is certain to arrive. Whatever the fill actually delivers above min_swap_out stays in the account, and estimated_max_dust is the upper bound on that.
|
|
22
|
+
*/
|
|
23
|
+
expectedSwapOut?: string | null | undefined;
|
|
20
24
|
};
|
|
21
25
|
/** @internal */
|
|
22
26
|
export declare const LoopLegPreview$inboundSchema: z.ZodType<LoopLegPreview, z.ZodTypeDef, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"looplegpreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"looplegpreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,OAAO,CAClD,cAAc,EACd,CAAC,CAAC,UAAU,EACZ,OAAO,CAaP,CAAC;AAEH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAMrD"}
|
|
@@ -46,11 +46,13 @@ exports.LoopLegPreview$inboundSchema = z.object({
|
|
|
46
46
|
supply_amount: z.nullable(z.string()),
|
|
47
47
|
borrow_amount: z.nullable(z.string()).optional(),
|
|
48
48
|
min_swap_out: z.nullable(z.string()).optional(),
|
|
49
|
+
expected_swap_out: z.nullable(z.string()).optional(),
|
|
49
50
|
}).transform((v) => {
|
|
50
51
|
return (0, primitives_js_1.remap)(v, {
|
|
51
52
|
"supply_amount": "supplyAmount",
|
|
52
53
|
"borrow_amount": "borrowAmount",
|
|
53
54
|
"min_swap_out": "minSwapOut",
|
|
55
|
+
"expected_swap_out": "expectedSwapOut",
|
|
54
56
|
});
|
|
55
57
|
});
|
|
56
58
|
function loopLegPreviewFromJSON(jsonString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"looplegpreview.js","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"looplegpreview.js","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,wDAQC;AAvDD,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AA0BjD,gBAAgB;AACH,QAAA,4BAA4B,GAIrC,CAAC,CAAC,MAAM,CAAC;IACX,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,iBAAiB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,eAAe,EAAE,cAAc;QAC/B,eAAe,EAAE,cAAc;QAC/B,cAAc,EAAE,YAAY;QAC5B,mBAAmB,EAAE,iBAAiB;KACvC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAgB,sBAAsB,CACpC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAA4B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACxD,4CAA4C,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -34,6 +34,10 @@ export type CreditLoopPreview = {
|
|
|
34
34
|
* Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote − guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost.
|
|
35
35
|
*/
|
|
36
36
|
estimatedMaxDust: string;
|
|
37
|
+
/**
|
|
38
|
+
* Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact — the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero.
|
|
39
|
+
*/
|
|
40
|
+
estimatedSwapCost: string;
|
|
37
41
|
/**
|
|
38
42
|
* Per-iteration breakdown.
|
|
39
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditlooppreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,
|
|
1
|
+
{"version":3,"file":"creditlooppreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,CAqBP,CAAC;AAEH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAMxD"}
|
|
@@ -14,6 +14,7 @@ export const CreditLoopPreview$inboundSchema = z.object({
|
|
|
14
14
|
projected_ltv: z.string(),
|
|
15
15
|
projected_health_factor: z.string(),
|
|
16
16
|
estimated_max_dust: z.string(),
|
|
17
|
+
estimated_swap_cost: z.string(),
|
|
17
18
|
legs: z.array(LoopLegPreview$inboundSchema).optional(),
|
|
18
19
|
}).transform((v) => {
|
|
19
20
|
return remap$(v, {
|
|
@@ -23,6 +24,7 @@ export const CreditLoopPreview$inboundSchema = z.object({
|
|
|
23
24
|
"projected_ltv": "projectedLtv",
|
|
24
25
|
"projected_health_factor": "projectedHealthFactor",
|
|
25
26
|
"estimated_max_dust": "estimatedMaxDust",
|
|
27
|
+
"estimated_swap_cost": "estimatedSwapCost",
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
export function creditLoopPreviewFromJSON(jsonString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditlooppreview.js","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"creditlooppreview.js","sourceRoot":"","sources":["../../../../src/models/components/creditlooppreview.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAEL,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AA4C7B,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAIxC,CAAC,CAAC,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC5B,yBAAyB,EAAE,CAAC,CAAC,MAAM,EAAE;IACrC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IACnC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,2BAA2B,EAAE,yBAAyB;QACtD,gBAAgB,EAAE,eAAe;QACjC,qBAAqB,EAAE,oBAAoB;QAC3C,eAAe,EAAE,cAAc;QAC/B,yBAAyB,EAAE,uBAAuB;QAClD,oBAAoB,EAAE,kBAAkB;QACxC,qBAAqB,EAAE,mBAAmB;KAC3C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CACvC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,+BAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC3D,+CAA+C,CAChD,CAAC;AACJ,CAAC"}
|
|
@@ -17,6 +17,10 @@ export type LoopLegPreview = {
|
|
|
17
17
|
* Guaranteed swap output (collateral units) — the next iteration's supply. Enforced on-chain by the swap's minimum-return.
|
|
18
18
|
*/
|
|
19
19
|
minSwapOut?: string | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Quoted swap output (collateral units) before the slippage floor is applied. Only min_swap_out is guaranteed on-chain; the gap between the two is the adverse-slippage tolerance, bounded by max_slippage_percent, not a surplus that is certain to arrive. Whatever the fill actually delivers above min_swap_out stays in the account, and estimated_max_dust is the upper bound on that.
|
|
22
|
+
*/
|
|
23
|
+
expectedSwapOut?: string | null | undefined;
|
|
20
24
|
};
|
|
21
25
|
/** @internal */
|
|
22
26
|
export declare const LoopLegPreview$inboundSchema: z.ZodType<LoopLegPreview, z.ZodTypeDef, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"looplegpreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"looplegpreview.d.ts","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,OAAO,CAClD,cAAc,EACd,CAAC,CAAC,UAAU,EACZ,OAAO,CAaP,CAAC;AAEH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAMrD"}
|
|
@@ -9,11 +9,13 @@ export const LoopLegPreview$inboundSchema = z.object({
|
|
|
9
9
|
supply_amount: z.nullable(z.string()),
|
|
10
10
|
borrow_amount: z.nullable(z.string()).optional(),
|
|
11
11
|
min_swap_out: z.nullable(z.string()).optional(),
|
|
12
|
+
expected_swap_out: z.nullable(z.string()).optional(),
|
|
12
13
|
}).transform((v) => {
|
|
13
14
|
return remap$(v, {
|
|
14
15
|
"supply_amount": "supplyAmount",
|
|
15
16
|
"borrow_amount": "borrowAmount",
|
|
16
17
|
"min_swap_out": "minSwapOut",
|
|
18
|
+
"expected_swap_out": "expectedSwapOut",
|
|
17
19
|
});
|
|
18
20
|
});
|
|
19
21
|
export function loopLegPreviewFromJSON(jsonString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"looplegpreview.js","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"looplegpreview.js","sourceRoot":"","sources":["../../../../src/models/components/looplegpreview.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA0BjD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAIrC,CAAC,CAAC,MAAM,CAAC;IACX,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,iBAAiB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,eAAe,EAAE,cAAc;QAC/B,eAAe,EAAE,cAAc;QAC/B,cAAc,EAAE,YAAY;QAC5B,mBAAmB,EAAE,iBAAiB;KACvC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,sBAAsB,CACpC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,4BAA4B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACxD,4CAA4C,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -15,19 +15,21 @@ let value: CreditLoopPreview = {
|
|
|
15
15
|
projectedLtv: "<value>",
|
|
16
16
|
projectedHealthFactor: "<value>",
|
|
17
17
|
estimatedMaxDust: "<value>",
|
|
18
|
+
estimatedSwapCost: "<value>",
|
|
18
19
|
legs: [],
|
|
19
20
|
};
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
## Fields
|
|
23
24
|
|
|
24
|
-
| Field
|
|
25
|
-
|
|
|
26
|
-
| `iterations`
|
|
27
|
-
| `totalCollateralSupplied`
|
|
28
|
-
| `totalBorrowed`
|
|
29
|
-
| `achievedMultiplier`
|
|
30
|
-
| `projectedLtv`
|
|
31
|
-
| `projectedHealthFactor`
|
|
32
|
-
| `estimatedMaxDust`
|
|
33
|
-
| `
|
|
25
|
+
| Field | Type | Required | Description | Example |
|
|
26
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| `iterations` | *number* | :heavy_check_mark: | Number of loop iterations bundled. | |
|
|
28
|
+
| `totalCollateralSupplied` | *string* | :heavy_check_mark: | Guaranteed minimum total collateral supplied (token units); actual can only be higher (swap fills above the floor become dust). | |
|
|
29
|
+
| `totalBorrowed` | *string* | :heavy_check_mark: | Total loan tokens borrowed across iterations. | |
|
|
30
|
+
| `achievedMultiplier` | *string* | :heavy_check_mark: | Guaranteed leverage floor: total_collateral_supplied / initial_collateral_amount. | |
|
|
31
|
+
| `projectedLtv` | *string* | :heavy_check_mark: | Projected end loan-to-value in percent, at the sizing oracle prices. | |
|
|
32
|
+
| `projectedHealthFactor` | *string* | :heavy_check_mark: | Projected health factor (liquidation threshold / projected LTV). Below 1 would be liquidatable — the request is rejected long before that. | |
|
|
33
|
+
| `estimatedMaxDust` | *string* | :heavy_check_mark: | Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote − guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost. | |
|
|
34
|
+
| `estimatedSwapCost` | *string* | :heavy_check_mark: | Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact — the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero. | |
|
|
35
|
+
| `legs` | [components.LoopLegPreview](../../models/components/looplegpreview.md)[] | :heavy_minus_sign: | Per-iteration breakdown. | [] |
|
|
@@ -14,8 +14,9 @@ let value: LoopLegPreview = {
|
|
|
14
14
|
|
|
15
15
|
## Fields
|
|
16
16
|
|
|
17
|
-
| Field
|
|
18
|
-
|
|
|
19
|
-
| `supplyAmount`
|
|
20
|
-
| `borrowAmount`
|
|
21
|
-
| `minSwapOut`
|
|
17
|
+
| Field | Type | Required | Description |
|
|
18
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
19
|
+
| `supplyAmount` | *string* | :heavy_check_mark: | Collateral supplied this iteration (token units). |
|
|
20
|
+
| `borrowAmount` | *string* | :heavy_minus_sign: | Loan borrowed this iteration; null on the final supply-only iteration. |
|
|
21
|
+
| `minSwapOut` | *string* | :heavy_minus_sign: | Guaranteed swap output (collateral units) — the next iteration's supply. Enforced on-chain by the swap's minimum-return. |
|
|
22
|
+
| `expectedSwapOut` | *string* | :heavy_minus_sign: | Quoted swap output (collateral units) before the slippage floor is applied. Only min_swap_out is guaranteed on-chain; the gap between the two is the adverse-slippage tolerance, bounded by max_slippage_percent, not a surplus that is certain to arrive. Whatever the fill actually delivers above min_swap_out stays in the account, and estimated_max_dust is the upper bound on that. |
|
|
@@ -13047,6 +13047,11 @@
|
|
|
13047
13047
|
"title": "Estimated Max Dust",
|
|
13048
13048
|
"description": "Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote \u2212 guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost."
|
|
13049
13049
|
},
|
|
13050
|
+
"estimated_swap_cost": {
|
|
13051
|
+
"type": "string",
|
|
13052
|
+
"title": "Estimated Swap Cost",
|
|
13053
|
+
"description": "Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact \u2014 the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero."
|
|
13054
|
+
},
|
|
13050
13055
|
"legs": {
|
|
13051
13056
|
"items": {
|
|
13052
13057
|
"$ref": "#/components/schemas/LoopLegPreview"
|
|
@@ -13066,7 +13071,8 @@
|
|
|
13066
13071
|
"achieved_multiplier",
|
|
13067
13072
|
"projected_ltv",
|
|
13068
13073
|
"projected_health_factor",
|
|
13069
|
-
"estimated_max_dust"
|
|
13074
|
+
"estimated_max_dust",
|
|
13075
|
+
"estimated_swap_cost"
|
|
13070
13076
|
],
|
|
13071
13077
|
"title": "CreditLoopPreview",
|
|
13072
13078
|
"description": "Projected end state of the loop, computed on GUARANTEED swap floors."
|
|
@@ -16670,6 +16676,18 @@
|
|
|
16670
16676
|
],
|
|
16671
16677
|
"title": "Min Swap Out",
|
|
16672
16678
|
"description": "Guaranteed swap output (collateral units) \u2014 the next iteration's supply. Enforced on-chain by the swap's minimum-return."
|
|
16679
|
+
},
|
|
16680
|
+
"expected_swap_out": {
|
|
16681
|
+
"anyOf": [
|
|
16682
|
+
{
|
|
16683
|
+
"type": "string"
|
|
16684
|
+
},
|
|
16685
|
+
{
|
|
16686
|
+
"type": "null"
|
|
16687
|
+
}
|
|
16688
|
+
],
|
|
16689
|
+
"title": "Expected Swap Out",
|
|
16690
|
+
"description": "Quoted swap output (collateral units) before the slippage floor is applied. Only min_swap_out is guaranteed on-chain; the gap between the two is the adverse-slippage tolerance, bounded by max_slippage_percent, not a surplus that is certain to arrive. Whatever the fill actually delivers above min_swap_out stays in the account, and estimated_max_dust is the upper bound on that."
|
|
16673
16691
|
}
|
|
16674
16692
|
},
|
|
16675
16693
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -44,6 +44,10 @@ export type CreditLoopPreview = {
|
|
|
44
44
|
* Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote − guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost.
|
|
45
45
|
*/
|
|
46
46
|
estimatedMaxDust: string;
|
|
47
|
+
/**
|
|
48
|
+
* Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact — the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero.
|
|
49
|
+
*/
|
|
50
|
+
estimatedSwapCost: string;
|
|
47
51
|
/**
|
|
48
52
|
* Per-iteration breakdown.
|
|
49
53
|
*/
|
|
@@ -63,6 +67,7 @@ export const CreditLoopPreview$inboundSchema: z.ZodType<
|
|
|
63
67
|
projected_ltv: z.string(),
|
|
64
68
|
projected_health_factor: z.string(),
|
|
65
69
|
estimated_max_dust: z.string(),
|
|
70
|
+
estimated_swap_cost: z.string(),
|
|
66
71
|
legs: z.array(LoopLegPreview$inboundSchema).optional(),
|
|
67
72
|
}).transform((v) => {
|
|
68
73
|
return remap$(v, {
|
|
@@ -72,6 +77,7 @@ export const CreditLoopPreview$inboundSchema: z.ZodType<
|
|
|
72
77
|
"projected_ltv": "projectedLtv",
|
|
73
78
|
"projected_health_factor": "projectedHealthFactor",
|
|
74
79
|
"estimated_max_dust": "estimatedMaxDust",
|
|
80
|
+
"estimated_swap_cost": "estimatedSwapCost",
|
|
75
81
|
});
|
|
76
82
|
});
|
|
77
83
|
|
|
@@ -24,6 +24,10 @@ export type LoopLegPreview = {
|
|
|
24
24
|
* Guaranteed swap output (collateral units) — the next iteration's supply. Enforced on-chain by the swap's minimum-return.
|
|
25
25
|
*/
|
|
26
26
|
minSwapOut?: string | null | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Quoted swap output (collateral units) before the slippage floor is applied. Only min_swap_out is guaranteed on-chain; the gap between the two is the adverse-slippage tolerance, bounded by max_slippage_percent, not a surplus that is certain to arrive. Whatever the fill actually delivers above min_swap_out stays in the account, and estimated_max_dust is the upper bound on that.
|
|
29
|
+
*/
|
|
30
|
+
expectedSwapOut?: string | null | undefined;
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
/** @internal */
|
|
@@ -35,11 +39,13 @@ export const LoopLegPreview$inboundSchema: z.ZodType<
|
|
|
35
39
|
supply_amount: z.nullable(z.string()),
|
|
36
40
|
borrow_amount: z.nullable(z.string()).optional(),
|
|
37
41
|
min_swap_out: z.nullable(z.string()).optional(),
|
|
42
|
+
expected_swap_out: z.nullable(z.string()).optional(),
|
|
38
43
|
}).transform((v) => {
|
|
39
44
|
return remap$(v, {
|
|
40
45
|
"supply_amount": "supplyAmount",
|
|
41
46
|
"borrow_amount": "borrowAmount",
|
|
42
47
|
"min_swap_out": "minSwapOut",
|
|
48
|
+
"expected_swap_out": "expectedSwapOut",
|
|
43
49
|
});
|
|
44
50
|
});
|
|
45
51
|
|