@gearbox-protocol/ui-kit 4.5.1 → 4.6.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/cjs/components/base/apy-breakdown-body/apy-breakdown-body.cjs +1 -1
- package/dist/cjs/components/base/apy-breakdown-body/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown.cjs +1 -1
- package/dist/esm/components/base/apy-breakdown-body/apy-breakdown-body.js +70 -45
- package/dist/esm/components/base/apy-breakdown-body/index.js +8 -7
- package/dist/esm/components/base/info-list/info-list.js +14 -13
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +68 -64
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +109 -105
- package/dist/esm/components/compound-apy/compound-apy.js +22 -20
- package/dist/esm/components/graph/graph.js +53 -52
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown.js +92 -79
- package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +5 -0
- package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +3 -1
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +3 -1
- package/dist/types/components/compound-apy/compound-apy.d.ts +3 -1
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown.d.ts +3 -1
- package/package.json +2 -2
|
@@ -1,123 +1,127 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ApyBreakdownBody as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { ApyBreakdownBody as v, formatBreakdownRate as t, ApyBreakdownRow as p, periodMessageId as i, RewardLinks as w, ApyBreakdownDivider as g, BREAKDOWN_DASH as f } from "../apy-breakdown-body/apy-breakdown-body.js";
|
|
3
3
|
import { NoValue as d } from "../../no-value/no-value.js";
|
|
4
|
-
import { PointsIcon as
|
|
5
|
-
import { TokenIcon as
|
|
6
|
-
import { FormattedMessageTyped as
|
|
7
|
-
import { totalApyOf as
|
|
8
|
-
import { PoolApyBreakdownCardTest as
|
|
9
|
-
function
|
|
10
|
-
data:
|
|
11
|
-
period:
|
|
4
|
+
import { PointsIcon as B } from "../../points-icon/points-icon.js";
|
|
5
|
+
import { TokenIcon as I } from "../../token-icon/token-icon.js";
|
|
6
|
+
import { FormattedMessageTyped as r } from "../../typed-intl/index.js";
|
|
7
|
+
import { totalApyOf as h, tokenRewardsOf as C, pointProgramsOf as b } from "../../../utils/internal/apy-breakdown.js";
|
|
8
|
+
import { PoolApyBreakdownCardTest as s } from "./constants.js";
|
|
9
|
+
function z({
|
|
10
|
+
data: o,
|
|
11
|
+
period: l,
|
|
12
|
+
hideRewardLinks: u = !1
|
|
12
13
|
}) {
|
|
13
|
-
const m =
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
14
|
+
const m = o ? h(o) : void 0, c = o?.organicApy, y = o ? C(o) : [], k = o ? b(o) : [];
|
|
15
|
+
return /* @__PURE__ */ a(
|
|
16
|
+
v,
|
|
16
17
|
{
|
|
17
|
-
testId:
|
|
18
|
+
testId: s.root,
|
|
18
19
|
title: /* @__PURE__ */ e(
|
|
19
|
-
|
|
20
|
+
r,
|
|
20
21
|
{
|
|
21
22
|
messageId: i(
|
|
22
|
-
|
|
23
|
+
l,
|
|
23
24
|
"components.poolApyBreakdownCard.title",
|
|
24
25
|
"components.poolApyBreakdownCard.title7d"
|
|
25
26
|
)
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
chip: m == null ? /* @__PURE__ */ e(d, { reason:
|
|
29
|
+
chip: m == null ? /* @__PURE__ */ e(d, { reason: l }) : t(m, !0),
|
|
29
30
|
chipPositive: (m ?? 0) > 0,
|
|
30
|
-
chipTestId:
|
|
31
|
+
chipTestId: s.net,
|
|
31
32
|
children: [
|
|
32
33
|
/* @__PURE__ */ e(
|
|
33
34
|
p,
|
|
34
35
|
{
|
|
35
|
-
valueTestId:
|
|
36
|
+
valueTestId: s.value,
|
|
36
37
|
label: /* @__PURE__ */ e(
|
|
37
|
-
|
|
38
|
+
r,
|
|
38
39
|
{
|
|
39
40
|
messageId: i(
|
|
40
|
-
|
|
41
|
+
l,
|
|
41
42
|
"components.poolApyBreakdownCard.organicApy",
|
|
42
43
|
"components.poolApyBreakdownCard.organicApy7d"
|
|
43
44
|
)
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
|
-
value: c == null ? /* @__PURE__ */ e(d, { reason:
|
|
47
|
+
value: c == null ? /* @__PURE__ */ e(d, { reason: l }) : t(c)
|
|
47
48
|
}
|
|
48
49
|
),
|
|
49
|
-
y.length > 0 ? y.map((
|
|
50
|
+
y.length > 0 ? y.map((n) => /* @__PURE__ */ e(
|
|
50
51
|
p,
|
|
51
52
|
{
|
|
52
|
-
valueTestId:
|
|
53
|
-
label: /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
valueTestId: s.value,
|
|
54
|
+
label: /* @__PURE__ */ a("span", { className: "flex flex-col gap-0.5", children: [
|
|
55
|
+
/* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
56
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
57
|
+
r,
|
|
58
|
+
{
|
|
59
|
+
messageId: i(
|
|
60
|
+
l,
|
|
61
|
+
"components.poolApyBreakdownCard.tokenIncentiveApy",
|
|
62
|
+
"components.poolApyBreakdownCard.tokenIncentiveApy7d"
|
|
63
|
+
),
|
|
64
|
+
values: { symbol: n.token.symbol }
|
|
65
|
+
}
|
|
66
|
+
) }),
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
I,
|
|
69
|
+
{
|
|
70
|
+
token: n.token,
|
|
71
|
+
symbol: n.token.symbol,
|
|
72
|
+
size: 16,
|
|
73
|
+
className: "shrink-0"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
u ? null : /* @__PURE__ */ e(w, { links: n.links })
|
|
74
78
|
] }),
|
|
75
|
-
value: t(
|
|
79
|
+
value: t(n.supplyApr ?? 0)
|
|
76
80
|
},
|
|
77
|
-
`incentive-${
|
|
81
|
+
`incentive-${n.token.address}`
|
|
78
82
|
)) : /* @__PURE__ */ e(
|
|
79
83
|
p,
|
|
80
84
|
{
|
|
81
|
-
valueTestId:
|
|
85
|
+
valueTestId: s.value,
|
|
82
86
|
label: /* @__PURE__ */ e(
|
|
83
|
-
|
|
87
|
+
r,
|
|
84
88
|
{
|
|
85
89
|
messageId: i(
|
|
86
|
-
|
|
90
|
+
l,
|
|
87
91
|
"components.poolApyBreakdownCard.incentiveApy",
|
|
88
92
|
"components.poolApyBreakdownCard.incentiveApy7d"
|
|
89
93
|
)
|
|
90
94
|
}
|
|
91
95
|
),
|
|
92
|
-
value:
|
|
96
|
+
value: o == null ? /* @__PURE__ */ e(d, { reason: l }) : t(0)
|
|
93
97
|
}
|
|
94
98
|
),
|
|
95
|
-
k.length > 0 ? /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */ e(
|
|
97
|
-
k.map((
|
|
99
|
+
k.length > 0 ? /* @__PURE__ */ a(A, { children: [
|
|
100
|
+
/* @__PURE__ */ e(g, {}),
|
|
101
|
+
k.map((n) => /* @__PURE__ */ e(
|
|
98
102
|
p,
|
|
99
103
|
{
|
|
100
|
-
valueTestId:
|
|
101
|
-
label: /* @__PURE__ */
|
|
104
|
+
valueTestId: s.points,
|
|
105
|
+
label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
102
106
|
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
103
|
-
|
|
107
|
+
r,
|
|
104
108
|
{
|
|
105
109
|
messageId: "components.yieldBreakdown.programPoints",
|
|
106
|
-
values: { name:
|
|
110
|
+
values: { name: n.name }
|
|
107
111
|
}
|
|
108
112
|
) }),
|
|
109
113
|
/* @__PURE__ */ e(
|
|
110
|
-
|
|
114
|
+
B,
|
|
111
115
|
{
|
|
112
|
-
reward: { name:
|
|
116
|
+
reward: { name: n.name, type: n.id },
|
|
113
117
|
size: 16,
|
|
114
118
|
className: "shrink-0"
|
|
115
119
|
}
|
|
116
120
|
)
|
|
117
121
|
] }),
|
|
118
|
-
value:
|
|
122
|
+
value: n.multiplier != null ? `${n.multiplier}×` : f
|
|
119
123
|
},
|
|
120
|
-
|
|
124
|
+
n.id
|
|
121
125
|
))
|
|
122
126
|
] }) : null
|
|
123
127
|
]
|
|
@@ -125,6 +129,6 @@ function D({
|
|
|
125
129
|
);
|
|
126
130
|
}
|
|
127
131
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
z as PoolApyBreakdownCard,
|
|
133
|
+
s as PoolApyBreakdownCardTest
|
|
130
134
|
};
|
|
@@ -1,129 +1,133 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { calcNetStrategyApy as M, calcEffectiveBorrowApy as
|
|
3
|
-
import { breakdownRateValue as P, ApyBreakdownBody as
|
|
4
|
-
import { NoValue as
|
|
5
|
-
import { PointsIcon as
|
|
6
|
-
import { TokenIcon as
|
|
1
|
+
import { jsxs as y, jsx as o, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { calcNetStrategyApy as M, calcEffectiveBorrowApy as O } from "@gearbox-protocol/sdk/onchain";
|
|
3
|
+
import { breakdownRateValue as P, ApyBreakdownBody as S, formatBreakdownRate as m, ApyBreakdownRow as k, periodMessageId as g, RewardLinks as E, ApyBreakdownDivider as j, BREAKDOWN_DASH as z } from "../apy-breakdown-body/apy-breakdown-body.js";
|
|
4
|
+
import { NoValue as I } from "../../no-value/no-value.js";
|
|
5
|
+
import { PointsIcon as F } from "../../points-icon/points-icon.js";
|
|
6
|
+
import { TokenIcon as V } from "../../token-icon/token-icon.js";
|
|
7
7
|
import { FormattedMessageTyped as i } from "../../typed-intl/index.js";
|
|
8
|
-
import { formatLeverageExact as p, formatLeverage as
|
|
9
|
-
import { totalApyOf as
|
|
10
|
-
import { StrategyApyBreakdownCardTest as
|
|
11
|
-
function
|
|
12
|
-
const { borrowApyAvg7D:
|
|
13
|
-
return
|
|
14
|
-
borrowApy:
|
|
8
|
+
import { formatLeverageExact as p, formatLeverage as H } from "../../../utils/format-leverage.js";
|
|
9
|
+
import { totalApyOf as K, positiveTokenRewardsOf as W, pointProgramsOf as Y } from "../../../utils/internal/apy-breakdown.js";
|
|
10
|
+
import { StrategyApyBreakdownCardTest as n } from "./constants.js";
|
|
11
|
+
function _(c) {
|
|
12
|
+
const { borrowApyAvg7D: e, quotaRateAvg7D: r, liquidationThreshold: a } = c;
|
|
13
|
+
return e === void 0 || r === void 0 ? null : {
|
|
14
|
+
borrowApy: e,
|
|
15
15
|
quotaRate: r,
|
|
16
|
-
liquidationThreshold:
|
|
16
|
+
liquidationThreshold: a
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
return
|
|
19
|
+
function G(c, e, r) {
|
|
20
|
+
const a = P(c), v = r - e * a;
|
|
21
|
+
return v > 0 && e > 0 ? a + Math.ceil(v / e * 100) / 100 : a;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function le({
|
|
24
24
|
data: c,
|
|
25
|
-
leverage:
|
|
25
|
+
leverage: e,
|
|
26
26
|
showFormula: r = !1,
|
|
27
|
-
period:
|
|
27
|
+
period: a,
|
|
28
|
+
hideRewardLinks: v = !1
|
|
28
29
|
}) {
|
|
29
|
-
const
|
|
30
|
+
const l = _(c), s = l && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, B = l !== null && s !== void 0, h = B && l && s ? {
|
|
30
31
|
organicApy: M(
|
|
31
|
-
|
|
32
|
+
l,
|
|
32
33
|
s.organicApy,
|
|
33
|
-
|
|
34
|
+
e
|
|
34
35
|
),
|
|
35
36
|
totalApy: M(
|
|
36
|
-
|
|
37
|
+
l,
|
|
37
38
|
s.totalApy ?? s.organicApy,
|
|
38
|
-
|
|
39
|
+
e
|
|
39
40
|
),
|
|
40
41
|
...s.rewards ? { rewards: s.rewards } : {}
|
|
41
|
-
} : null, d =
|
|
42
|
+
} : null, d = B && l ? O(l, e) : null, u = h === null ? null : K(h), R = u === null || d === null ? null : u + d, $ = s ? W(s) : [], x = s ? Y(s) : [], T = $.map((t) => ({
|
|
42
43
|
reward: t,
|
|
43
|
-
value: Math.round(
|
|
44
|
-
})),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
) : void 0,
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
44
|
+
value: Math.round(e * (t.supplyApr ?? 0))
|
|
45
|
+
})), A = R === null ? null : R - T.reduce((t, b) => t + b.value, 0), N = A !== null && e > 0 ? A / e : void 0, C = l && d !== null && e > 0 ? (d - l.borrowApy * (e - 1)) / e : void 0, D = Number(p(e)), w = d === null ? void 0 : P(d), f = l && C !== void 0 && w !== void 0 ? G(
|
|
46
|
+
l.borrowApy + C,
|
|
47
|
+
D,
|
|
48
|
+
w
|
|
49
|
+
) : void 0, L = f !== void 0 && w !== void 0 ? D * f - w : void 0;
|
|
50
|
+
return /* @__PURE__ */ y(
|
|
51
|
+
S,
|
|
51
52
|
{
|
|
52
|
-
testId:
|
|
53
|
-
title: /* @__PURE__ */
|
|
53
|
+
testId: n.root,
|
|
54
|
+
title: /* @__PURE__ */ o(
|
|
54
55
|
i,
|
|
55
56
|
{
|
|
56
|
-
messageId:
|
|
57
|
-
|
|
57
|
+
messageId: g(
|
|
58
|
+
a,
|
|
58
59
|
"components.yieldBreakdown.titleNetAtLeverage",
|
|
59
60
|
"components.yieldBreakdown.titleNetAtLeverage7d"
|
|
60
61
|
),
|
|
61
|
-
values: { leverage:
|
|
62
|
+
values: { leverage: H(e) }
|
|
62
63
|
}
|
|
63
64
|
),
|
|
64
|
-
chip: u === null ? /* @__PURE__ */
|
|
65
|
+
chip: u === null ? /* @__PURE__ */ o(I, { reason: a }) : m(u, !0),
|
|
65
66
|
chipPositive: (u ?? 0) > 0,
|
|
66
|
-
chipTestId:
|
|
67
|
+
chipTestId: n.net,
|
|
67
68
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
69
|
+
/* @__PURE__ */ o(
|
|
70
|
+
k,
|
|
70
71
|
{
|
|
71
|
-
testId:
|
|
72
|
-
valueTestId:
|
|
73
|
-
captionTestId:
|
|
74
|
-
label: /* @__PURE__ */
|
|
72
|
+
testId: n.collateral,
|
|
73
|
+
valueTestId: n.value,
|
|
74
|
+
captionTestId: n.caption,
|
|
75
|
+
label: /* @__PURE__ */ o(
|
|
75
76
|
i,
|
|
76
77
|
{
|
|
77
|
-
messageId:
|
|
78
|
-
|
|
78
|
+
messageId: g(
|
|
79
|
+
a,
|
|
79
80
|
"components.yieldBreakdown.collateralApy",
|
|
80
81
|
"components.yieldBreakdown.collateralApy7d"
|
|
81
82
|
)
|
|
82
83
|
}
|
|
83
84
|
),
|
|
84
|
-
value:
|
|
85
|
-
subtext: r &&
|
|
85
|
+
value: A === null ? /* @__PURE__ */ o(I, { reason: a }) : m(A),
|
|
86
|
+
subtext: r && N !== void 0 ? /* @__PURE__ */ o(
|
|
86
87
|
i,
|
|
87
88
|
{
|
|
88
89
|
messageId: "components.strategyApyBreakdownCard.formula",
|
|
89
90
|
values: {
|
|
90
|
-
leverage: p(
|
|
91
|
-
base: m(
|
|
91
|
+
leverage: p(e),
|
|
92
|
+
base: m(N)
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
) : void 0
|
|
95
96
|
}
|
|
96
97
|
),
|
|
97
|
-
T.map(({ reward: t, value:
|
|
98
|
-
|
|
98
|
+
T.map(({ reward: t, value: b }) => /* @__PURE__ */ o(
|
|
99
|
+
k,
|
|
99
100
|
{
|
|
100
|
-
valueTestId:
|
|
101
|
-
captionTestId:
|
|
102
|
-
label: /* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
valueTestId: n.value,
|
|
102
|
+
captionTestId: n.caption,
|
|
103
|
+
label: /* @__PURE__ */ y("span", { className: "flex flex-col gap-0.5", children: [
|
|
104
|
+
/* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
105
|
+
/* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
|
|
106
|
+
i,
|
|
107
|
+
{
|
|
108
|
+
messageId: "components.apyParts.extraAPY",
|
|
109
|
+
values: { symbol: t.token.symbol }
|
|
110
|
+
}
|
|
111
|
+
) }),
|
|
112
|
+
/* @__PURE__ */ o(
|
|
113
|
+
V,
|
|
114
|
+
{
|
|
115
|
+
token: t.token,
|
|
116
|
+
symbol: t.token.symbol,
|
|
117
|
+
size: 16,
|
|
118
|
+
className: "shrink-0"
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] }),
|
|
122
|
+
v ? null : /* @__PURE__ */ o(E, { links: t.links })
|
|
119
123
|
] }),
|
|
120
|
-
value: m(
|
|
121
|
-
subtext: r ? /* @__PURE__ */
|
|
124
|
+
value: m(b),
|
|
125
|
+
subtext: r ? /* @__PURE__ */ o(
|
|
122
126
|
i,
|
|
123
127
|
{
|
|
124
128
|
messageId: "components.strategyApyBreakdownCard.formula",
|
|
125
129
|
values: {
|
|
126
|
-
leverage: p(
|
|
130
|
+
leverage: p(e),
|
|
127
131
|
base: m(t.supplyApr ?? 0)
|
|
128
132
|
}
|
|
129
133
|
}
|
|
@@ -131,54 +135,54 @@ function ao({
|
|
|
131
135
|
},
|
|
132
136
|
`incentive-${t.token.address}-${t.supplyApr ?? 0}`
|
|
133
137
|
)),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
138
|
+
/* @__PURE__ */ o(
|
|
139
|
+
k,
|
|
136
140
|
{
|
|
137
141
|
muted: !0,
|
|
138
|
-
testId:
|
|
139
|
-
valueTestId:
|
|
140
|
-
captionTestId:
|
|
141
|
-
label: /* @__PURE__ */
|
|
142
|
+
testId: n.borrow,
|
|
143
|
+
valueTestId: n.value,
|
|
144
|
+
captionTestId: n.caption,
|
|
145
|
+
label: /* @__PURE__ */ o(
|
|
142
146
|
i,
|
|
143
147
|
{
|
|
144
|
-
messageId:
|
|
145
|
-
|
|
148
|
+
messageId: g(
|
|
149
|
+
a,
|
|
146
150
|
"components.yieldBreakdown.borrowRate",
|
|
147
151
|
"components.yieldBreakdown.borrowRate7d"
|
|
148
152
|
)
|
|
149
153
|
}
|
|
150
154
|
),
|
|
151
|
-
value: d === null ? /* @__PURE__ */
|
|
152
|
-
subtext: r &&
|
|
155
|
+
value: d === null ? /* @__PURE__ */ o(I, { reason: a }) : m(d),
|
|
156
|
+
subtext: r && f !== void 0 && L !== void 0 ? /* @__PURE__ */ o(
|
|
153
157
|
i,
|
|
154
158
|
{
|
|
155
159
|
messageId: "components.strategyApyBreakdownCard.borrowFormula",
|
|
156
160
|
values: {
|
|
157
|
-
leverage: p(
|
|
158
|
-
totalRate: `${
|
|
159
|
-
borrowRate: `${Math.abs(
|
|
161
|
+
leverage: p(e),
|
|
162
|
+
totalRate: `${f.toFixed(2)}%`,
|
|
163
|
+
borrowRate: `${Math.abs(L).toFixed(2)}%`
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
) : void 0
|
|
163
167
|
}
|
|
164
168
|
),
|
|
165
|
-
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
x.length > 0 ? /* @__PURE__ */ y(q, { children: [
|
|
170
|
+
/* @__PURE__ */ o(j, {}),
|
|
171
|
+
x.map((t) => /* @__PURE__ */ o(
|
|
172
|
+
k,
|
|
169
173
|
{
|
|
170
|
-
valueTestId:
|
|
171
|
-
captionTestId:
|
|
172
|
-
label: /* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
+
valueTestId: n.points,
|
|
175
|
+
captionTestId: n.caption,
|
|
176
|
+
label: /* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
177
|
+
/* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
|
|
174
178
|
i,
|
|
175
179
|
{
|
|
176
180
|
messageId: "components.yieldBreakdown.programPoints",
|
|
177
181
|
values: { name: t.name }
|
|
178
182
|
}
|
|
179
183
|
) }),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
184
|
+
/* @__PURE__ */ o(
|
|
185
|
+
F,
|
|
182
186
|
{
|
|
183
187
|
reward: { name: t.name, type: t.id },
|
|
184
188
|
size: 16,
|
|
@@ -186,13 +190,13 @@ function ao({
|
|
|
186
190
|
}
|
|
187
191
|
)
|
|
188
192
|
] }),
|
|
189
|
-
value: t.multiplier != null ? `${p(t.multiplier *
|
|
190
|
-
subtext: r && t.multiplier != null ? /* @__PURE__ */
|
|
193
|
+
value: t.multiplier != null ? `${p(t.multiplier * e)}×` : z,
|
|
194
|
+
subtext: r && t.multiplier != null ? /* @__PURE__ */ o(
|
|
191
195
|
i,
|
|
192
196
|
{
|
|
193
197
|
messageId: "components.strategyApyBreakdownCard.formula",
|
|
194
198
|
values: {
|
|
195
|
-
leverage: p(
|
|
199
|
+
leverage: p(e),
|
|
196
200
|
base: p(t.multiplier)
|
|
197
201
|
}
|
|
198
202
|
}
|
|
@@ -206,6 +210,6 @@ function ao({
|
|
|
206
210
|
);
|
|
207
211
|
}
|
|
208
212
|
export {
|
|
209
|
-
|
|
210
|
-
|
|
213
|
+
le as StrategyApyBreakdownCard,
|
|
214
|
+
n as StrategyApyBreakdownCardTest
|
|
211
215
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import { NoValue as
|
|
4
|
-
import { YieldBreakdownTooltip as
|
|
5
|
-
import { cn as
|
|
2
|
+
import { useId as x } from "react";
|
|
3
|
+
import { NoValue as C } from "../no-value/no-value.js";
|
|
4
|
+
import { YieldBreakdownTooltip as I } from "../yield-breakdown-tooltip/yield-breakdown.js";
|
|
5
|
+
import { cn as k } from "../../utils/cn.js";
|
|
6
6
|
import "@gearbox-protocol/sdk/onchain";
|
|
7
|
-
import { formatCompactPercent as
|
|
7
|
+
import { formatCompactPercent as P } from "../../utils/internal/format-percent.js";
|
|
8
8
|
import "../../utils/z-index.js";
|
|
9
|
-
import { totalApyOf as
|
|
10
|
-
import { bpsToPercent as
|
|
9
|
+
import { totalApyOf as A, positiveTokenRewardsOf as O, pointProgramsOf as F } from "../../utils/internal/apy-breakdown.js";
|
|
10
|
+
import { bpsToPercent as N } from "../../utils/internal/bps-to-percent.js";
|
|
11
11
|
const l = 14;
|
|
12
|
-
function
|
|
13
|
-
const t = `additional-incentives-${
|
|
12
|
+
function T() {
|
|
13
|
+
const t = `additional-incentives-${x().replace(/:/g, "")}`;
|
|
14
14
|
return /* @__PURE__ */ n(
|
|
15
15
|
"svg",
|
|
16
16
|
{
|
|
@@ -60,9 +60,9 @@ function N() {
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
function c(t) {
|
|
63
|
-
return t == null ? !1 :
|
|
63
|
+
return t == null ? !1 : O(t).length > 0 || F(t).length > 0;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Z({
|
|
66
66
|
apy: t,
|
|
67
67
|
maxLeverage: p,
|
|
68
68
|
collateralApy: r,
|
|
@@ -71,19 +71,20 @@ function V({
|
|
|
71
71
|
decimals: a = 2,
|
|
72
72
|
tooltip: f = !0,
|
|
73
73
|
period: h,
|
|
74
|
+
hideRewardLinks: u,
|
|
74
75
|
className: o
|
|
75
76
|
}) {
|
|
76
77
|
if (!t)
|
|
77
|
-
return /* @__PURE__ */ e(
|
|
78
|
-
const i =
|
|
79
|
-
const
|
|
80
|
-
return /* @__PURE__ */ n("div", { className:
|
|
81
|
-
/* @__PURE__ */ e("span", { className: "inline-flex items-center", children:
|
|
82
|
-
|
|
78
|
+
return /* @__PURE__ */ e(C, {});
|
|
79
|
+
const i = A(t), g = c(t) || c(r), w = f && i >= 1, s = () => {
|
|
80
|
+
const v = P(N(i), a);
|
|
81
|
+
return /* @__PURE__ */ n("div", { className: k("inline-flex items-center gap-1.5", o), children: [
|
|
82
|
+
/* @__PURE__ */ e("span", { className: "inline-flex items-center", children: v }),
|
|
83
|
+
g ? /* @__PURE__ */ e(T, {}) : null
|
|
83
84
|
] });
|
|
84
85
|
};
|
|
85
|
-
return
|
|
86
|
-
|
|
86
|
+
return w ? /* @__PURE__ */ e(
|
|
87
|
+
I,
|
|
87
88
|
{
|
|
88
89
|
supplyApy: t,
|
|
89
90
|
maxLeverage: p,
|
|
@@ -91,11 +92,12 @@ function V({
|
|
|
91
92
|
borrowApy: d,
|
|
92
93
|
quotaRate: m,
|
|
93
94
|
period: h,
|
|
95
|
+
hideRewardLinks: u,
|
|
94
96
|
className: o,
|
|
95
97
|
children: s()
|
|
96
98
|
}
|
|
97
99
|
) : s();
|
|
98
100
|
}
|
|
99
101
|
export {
|
|
100
|
-
|
|
102
|
+
Z as CompoundAPY
|
|
101
103
|
};
|