@gearbox-protocol/ui-kit 4.0.0-next.76 → 4.0.0-next.78
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/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/base/apy-breakdown-body/apy-breakdown-body.js +43 -39
- package/dist/esm/components/base/apy-breakdown-body/index.js +7 -6
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +110 -105
- package/dist/esm/locale/en.json.js +4 -4
- package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +3 -2
- package/dist/types/components/base/values/position-type-badge.d.ts +1 -1
- package/dist/types/components/base/values/scalars.d.ts +3 -8
- package/dist/types/locale/en.json.d.ts +4 -4
- package/dist/types/utils/format-pnl.d.ts +0 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../../../utils/cn.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../../../utils/cn.cjs"),i=require("../../../utils/internal/bps-to-percent.cjs"),c="—",u="400px";function x(t,n,s){return t==="7d"?s:n}function m(t,n=!1){const s=i.bpsToPercent(t),a=`${Math.abs(s).toFixed(2)}%`;return n&&s<0?`−${a}`:a}function f(t){return Number(Math.abs(i.bpsToPercent(t)).toFixed(2))}function p({title:t,chip:n,chipPositive:s=!1,chipTestId:a,children:r,testId:d}){return e.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4","data-testid":d,children:[e.jsxs("div",{className:"flex min-h-6 items-center justify-between gap-3",children:[e.jsx("span",{className:"min-w-0 text-base font-semibold leading-5 text-foreground",children:t}),e.jsx("span",{className:o.cn("shrink-0 rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",s?"bg-success/20 text-success":"bg-muted text-muted-foreground"),"data-testid":a,children:n})]}),e.jsx("div",{className:"flex flex-col gap-3",children:r})]})}function b({label:t,value:n,subtext:s,muted:a=!1,testId:r,valueTestId:d,captionTestId:l}){return e.jsxs("div",{className:"flex items-start justify-between gap-3","data-testid":r,children:[e.jsx("span",{className:o.cn("min-w-0 text-sm font-semibold leading-5",a?"text-muted-foreground":"text-foreground"),children:t}),e.jsxs("span",{className:"flex shrink-0 flex-col items-end",children:[e.jsx("span",{className:o.cn("text-sm font-semibold leading-5 tabular-nums",a?"text-muted-foreground":"text-foreground"),"data-testid":d,children:n}),s!=null?e.jsx("span",{className:"text-xs leading-4 text-muted-foreground","data-testid":l,children:s}):null]})]})}function g(){return e.jsx("div",{className:"h-px w-full bg-divider"})}exports.APY_BREAKDOWN_TOOLTIP_WIDTH=u;exports.ApyBreakdownBody=p;exports.ApyBreakdownDivider=g;exports.ApyBreakdownRow=b;exports.BREAKDOWN_DASH=c;exports.breakdownRateValue=f;exports.formatBreakdownRate=m;exports.periodMessageId=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apy-breakdown-body.cjs");exports.APY_BREAKDOWN_TOOLTIP_WIDTH=e.APY_BREAKDOWN_TOOLTIP_WIDTH;exports.ApyBreakdownBody=e.ApyBreakdownBody;exports.ApyBreakdownDivider=e.ApyBreakdownDivider;exports.ApyBreakdownRow=e.ApyBreakdownRow;exports.BREAKDOWN_DASH=e.BREAKDOWN_DASH;exports.formatBreakdownRate=e.formatBreakdownRate;exports.periodMessageId=e.periodMessageId;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apy-breakdown-body.cjs");exports.APY_BREAKDOWN_TOOLTIP_WIDTH=e.APY_BREAKDOWN_TOOLTIP_WIDTH;exports.ApyBreakdownBody=e.ApyBreakdownBody;exports.ApyBreakdownDivider=e.ApyBreakdownDivider;exports.ApyBreakdownRow=e.ApyBreakdownRow;exports.BREAKDOWN_DASH=e.BREAKDOWN_DASH;exports.breakdownRateValue=e.breakdownRateValue;exports.formatBreakdownRate=e.formatBreakdownRate;exports.periodMessageId=e.periodMessageId;
|
package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("@gearbox-protocol/sdk/onchain"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),v=require("../../no-value/no-value.cjs"),M=require("../../points-icon/points-icon.cjs"),h=require("../../token-icon/token-icon.cjs"),i=require("../../typed-intl/index.cjs"),p=require("../../../utils/format-leverage.cjs"),B=require("../../../utils/internal/apy-breakdown.cjs"),r=require("./constants.cjs");function q(y){const{borrowApyAvg7D:t,quotaRateAvg7D:l,liquidationThreshold:s}=y;return t===void 0||l===void 0?null:{borrowApy:t,quotaRate:l,liquidationThreshold:s}}function N(y,t,l){const s=o.breakdownRateValue(y),n=l-t*s;return n>0&&t>0?s+Math.ceil(n/t*100)/100:s}function L({data:y,leverage:t,showFormula:l=!1,period:s}){const n=q(y),d=n&&y.collateralApyAvg7D?y.collateralApyAvg7D:void 0,x=n!==null&&d!==void 0,T=x&&n&&d?{organicApy:k.calcNetStrategyApy(n,d.organicApy,t),totalApy:k.calcNetStrategyApy(n,d.totalApy??d.organicApy,t),...d.rewards?{rewards:d.rewards}:{}}:null,c=x&&n?k.calcEffectiveBorrowApy(n,t):null,u=T===null?null:B.totalApyOf(T),b=u===null||c===null?null:u+c,_=d?B.positiveTokenRewardsOf(d):[],f=d?B.pointProgramsOf(d):[],I=_.map(a=>({reward:a,value:Math.round(t*(a.supplyApr??0))})),m=b===null?null:b-I.reduce((a,A)=>a+A.value,0),j=m!==null&&t>0?m/t:void 0,R=n&&c!==null&&t>0?(c-n.borrowApy*(t-1))/t:void 0,C=Number(p.formatLeverageExact(t)),w=c===null?void 0:o.breakdownRateValue(c),g=n&&R!==void 0&&w!==void 0?N(n.borrowApy+R,C,w):void 0,S=g!==void 0&&w!==void 0?C*g-w:void 0;return e.jsxs(o.ApyBreakdownBody,{testId:r.StrategyApyBreakdownCardTest.root,title:e.jsx(i.FormattedMessageTyped,{messageId:o.periodMessageId(s,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:p.formatLeverage(t)}}),chip:u===null?e.jsx(v.NoValue,{reason:s}):o.formatBreakdownRate(u,!0),chipPositive:(u??0)>0,chipTestId:r.StrategyApyBreakdownCardTest.net,children:[e.jsx(o.ApyBreakdownRow,{testId:r.StrategyApyBreakdownCardTest.collateral,valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsx(i.FormattedMessageTyped,{messageId:o.periodMessageId(s,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:m===null?e.jsx(v.NoValue,{reason:s}):o.formatBreakdownRate(m),subtext:l&&j!==void 0?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:p.formatLeverageExact(t),base:o.formatBreakdownRate(j)}}):void 0}),I.map(({reward:a,value:A})=>e.jsx(o.ApyBreakdownRow,{valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(i.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:a.token.symbol}})}),e.jsx(h.TokenIcon,{token:a.token,symbol:a.token.symbol,size:16,className:"shrink-0"})]}),value:o.formatBreakdownRate(A),subtext:l?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:p.formatLeverageExact(t),base:o.formatBreakdownRate(a.supplyApr??0)}}):void 0},`incentive-${a.token.address}-${a.supplyApr??0}`)),e.jsx(o.ApyBreakdownRow,{muted:!0,testId:r.StrategyApyBreakdownCardTest.borrow,valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsx(i.FormattedMessageTyped,{messageId:o.periodMessageId(s,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:c===null?e.jsx(v.NoValue,{reason:s}):o.formatBreakdownRate(c),subtext:l&&g!==void 0&&S!==void 0?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.borrowFormula",values:{leverage:p.formatLeverageExact(t),totalRate:`${g.toFixed(2)}%`,borrowRate:`${Math.abs(S).toFixed(2)}%`}}):void 0}),f.length>0?e.jsxs(e.Fragment,{children:[e.jsx(o.ApyBreakdownDivider,{}),f.map(a=>e.jsx(o.ApyBreakdownRow,{valueTestId:r.StrategyApyBreakdownCardTest.points,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(i.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:a.name}})}),e.jsx(M.PointsIcon,{reward:{name:a.name,type:a.id},size:16,className:"shrink-0"})]}),value:a.multiplier!=null?`${p.formatLeverageExact(a.multiplier*t)}×`:o.BREAKDOWN_DASH,subtext:l&&a.multiplier!=null?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:p.formatLeverageExact(t),base:p.formatLeverageExact(a.multiplier)}}):void 0},a.id))]}):null]})}exports.StrategyApyBreakdownCardTest=r.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={"errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no open Positions. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.sdkStatus.connecting":"Connecting…","components.sdkStatus.connected":"Connected","components.sdkStatus.disconnected":"Not connected","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.tipWindow.title":"Tip","components.value.accruing":"Averaged data is still being computed and will be available shortly.","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.totalAPY":"Overall APY","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.titleNetAtLeverage7d":"Net APY (7d) at {leverage}× Leverage","components.yieldBreakdown.titleNet":"Net APY","components.yieldBreakdown.titleNet7d":"Net APY (7d)","components.yieldBreakdown.collateralApy":"Collateral APY","components.yieldBreakdown.collateralApy7d":"Collateral APY (7d)","components.yieldBreakdown.baseApy":"Base APY","components.yieldBreakdown.baseApy7d":"Base APY (7d)","components.yieldBreakdown.incentive":"Incentive","components.yieldBreakdown.incentiveApy":"Incentive APY","components.yieldBreakdown.incentiveApy7d":"Incentive APY (7d)","components.yieldBreakdown.borrowRate":"Borrow Rate","components.yieldBreakdown.borrowRate7d":"Borrow Rate (7d)","components.yieldBreakdown.programPoints":"{name} Points","components.yieldBreakdown.points":"Points","components.openCopyButtons.copy":"Copy to clipboard","components.openCopyButtons.explorer":"View in explorer","components.poolAssetsTable.asset":"Name","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap Utilization","components.poolAssetsTable.capBelowExposure.tip":"The curator has lowered the cap below current exposure. Exposure cannot be increased.","components.poolTable.line.rwa.tip":"This is RWA market.","components.strategiesTable.line.name.disabled":"This
|
|
1
|
+
"use strict";const e={"errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no open Positions. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.sdkStatus.connecting":"Connecting…","components.sdkStatus.connected":"Connected","components.sdkStatus.disconnected":"Not connected","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.tipWindow.title":"Tip","components.value.accruing":"Averaged data is still being computed and will be available shortly.","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.totalAPY":"Overall APY","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.titleNetAtLeverage7d":"Net APY (7d) at {leverage}× Leverage","components.yieldBreakdown.titleNet":"Net APY","components.yieldBreakdown.titleNet7d":"Net APY (7d)","components.yieldBreakdown.collateralApy":"Collateral APY","components.yieldBreakdown.collateralApy7d":"Collateral APY (7d)","components.yieldBreakdown.baseApy":"Base APY","components.yieldBreakdown.baseApy7d":"Base APY (7d)","components.yieldBreakdown.incentive":"Incentive","components.yieldBreakdown.incentiveApy":"Incentive APY","components.yieldBreakdown.incentiveApy7d":"Incentive APY (7d)","components.yieldBreakdown.borrowRate":"Borrow Rate","components.yieldBreakdown.borrowRate7d":"Borrow Rate (7d)","components.yieldBreakdown.programPoints":"{name} Points","components.yieldBreakdown.points":"Points","components.openCopyButtons.copy":"Copy to clipboard","components.openCopyButtons.explorer":"View in explorer","components.poolAssetsTable.asset":"Name","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap Utilization","components.poolAssetsTable.capBelowExposure.tip":"The curator has lowered the cap below current exposure. Exposure cannot be increased.","components.poolTable.line.rwa.tip":"This is RWA market.","components.strategiesTable.line.name.disabled":"This Leverage Opportunity is currently not available","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This Leverage Opportunity is available on RWA market.","dialogs.common.review":"Review","components.amountInput.max":"Max","components.amountInput.label":"Amount","components.amountInput.balance":"Balance","components.amountInput.selectToken":"Select token","components.amountInput.inputTitle":"Token Amount","components.leverageInput.label":"Leverage","components.leverageInput.reset":"Reset","components.leverageInput.available":"Available Leverage","components.healthFactorBlock.label":"Health Factor","components.healthFactorBlock.tip":"Health Factor is a numeric representation of your Position 'health'. If your health factor drops below 1 or close to it, you might be liquidated.","components.liquidationPriceBlock.label":"Liquidation Price","components.liquidationPriceBlock.tip":"The asset price at which the Position's health factor would reach 1 and become eligible for liquidation.","components.timeToLiquidationBlock.label":"Time to Liquidation","components.timeToLiquidationBlock.tip":"Time to liquidation estimates how long the Position can stay open if prices remain constant and no yield is earned—only accounting for borrow interest accrual.","components.historyChart.error":"Couldn't load chart data","components.historyChart.empty":"No data","components.positionTypeBadge.pool":"Lend","components.positionTypeBadge.strategy":"Leverage","components.positionTypeBadge.liquidation":"Liquidation","components.positionStatusBadge.active":"Active","components.positionStatusBadge.repaid":"Repaid","components.titleMeta.unknownCurator":"Curator","components.moreAccordion.more":"More details","components.moreAccordion.less":"Less details","components.poolApyBreakdownCard.title":"Net APY","components.poolApyBreakdownCard.title7d":"Net APY (7d)","components.poolApyBreakdownCard.organicApy":"Base APY","components.poolApyBreakdownCard.organicApy7d":"Base APY (7d)","components.poolApyBreakdownCard.incentiveApy":"Incentive APY","components.poolApyBreakdownCard.incentiveApy7d":"Incentive APY (7d)","components.poolApyBreakdownCard.tokenIncentiveApy":"{symbol} Incentive APY","components.poolApyBreakdownCard.tokenIncentiveApy7d":"{symbol} Incentive APY (7d)","components.strategyApyBreakdownCard.formula":"{leverage} × {base}","components.strategyApyBreakdownCard.borrowFormula":"{leverage} × {totalRate} − {borrowRate}","components.leveragePresetChips.label":"Leverage:","components.liquidationParamsTable.lt":"Liquidation Threshold","components.liquidationParamsTable.penalty":"Liquidation Discount","components.liquidationParamsTable.premium":"Liquidation Premium","components.liquidationParamsTable.fee":"Liquidation Fee","components.borrowRateBlock.label":"Borrow Rate","components.borrowRateBlock.tip":"Borrow rate is displayed for your entire Position size in total. You can reduce it in quota management.","components.borrowRateBlock.description":"Your borrow rate consists of the Base Rate plus the Quota Rates for every asset separately.","components.borrowRateBlock.baseRate":"Base Rate for Debt","components.borrowRateBlock.normalization":"Rates Normalization","components.borrowRateBlock.normalization.tip":"Borrowers pay {quota} and {utilization}, which have a different base. Therefore, the total borrow rate value is normalized by Position value or Debt amount.","components.transactionConfirm.previewLoading":"Parsing transaction…","components.transactionConfirm.previewErrorTitle":"Preview error"};module.exports=e;
|
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { bpsToPercent as
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as i } from "../../../utils/cn.js";
|
|
3
|
+
import { bpsToPercent as l } from "../../../utils/internal/bps-to-percent.js";
|
|
4
4
|
const x = "—", p = "400px";
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function b(e, n, t) {
|
|
6
|
+
return e === "7d" ? t : n;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return n &&
|
|
8
|
+
function g(e, n = !1) {
|
|
9
|
+
const t = l(e), s = `${Math.abs(t).toFixed(2)}%`;
|
|
10
|
+
return n && t < 0 ? `−${s}` : s;
|
|
11
11
|
}
|
|
12
|
-
function h({
|
|
13
|
-
|
|
12
|
+
function h(e) {
|
|
13
|
+
return Number(Math.abs(l(e)).toFixed(2));
|
|
14
|
+
}
|
|
15
|
+
function N({
|
|
16
|
+
title: e,
|
|
14
17
|
chip: n,
|
|
15
|
-
chipPositive:
|
|
18
|
+
chipPositive: t = !1,
|
|
16
19
|
chipTestId: s,
|
|
17
20
|
children: r,
|
|
18
21
|
testId: o
|
|
19
22
|
}) {
|
|
20
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ d(
|
|
21
24
|
"div",
|
|
22
25
|
{
|
|
23
26
|
className: "flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4",
|
|
24
27
|
"data-testid": o,
|
|
25
28
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ d("div", { className: "flex min-h-6 items-center justify-between gap-3", children: [
|
|
30
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 text-base font-semibold leading-5 text-foreground", children: e }),
|
|
31
|
+
/* @__PURE__ */ a(
|
|
29
32
|
"span",
|
|
30
33
|
{
|
|
31
|
-
className:
|
|
34
|
+
className: i(
|
|
32
35
|
"shrink-0 rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
|
|
33
|
-
|
|
36
|
+
t ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
|
|
34
37
|
),
|
|
35
38
|
"data-testid": s,
|
|
36
39
|
children: n
|
|
37
40
|
}
|
|
38
41
|
)
|
|
39
42
|
] }),
|
|
40
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: r })
|
|
41
44
|
]
|
|
42
45
|
}
|
|
43
46
|
);
|
|
44
47
|
}
|
|
45
|
-
function
|
|
46
|
-
label:
|
|
48
|
+
function w({
|
|
49
|
+
label: e,
|
|
47
50
|
value: n,
|
|
48
|
-
subtext:
|
|
51
|
+
subtext: t,
|
|
49
52
|
muted: s = !1,
|
|
50
53
|
testId: r,
|
|
51
54
|
valueTestId: o,
|
|
52
|
-
captionTestId:
|
|
55
|
+
captionTestId: c
|
|
53
56
|
}) {
|
|
54
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ d(
|
|
55
58
|
"div",
|
|
56
59
|
{
|
|
57
60
|
className: "flex items-start justify-between gap-3",
|
|
58
61
|
"data-testid": r,
|
|
59
62
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ a(
|
|
61
64
|
"span",
|
|
62
65
|
{
|
|
63
|
-
className:
|
|
66
|
+
className: i(
|
|
64
67
|
"min-w-0 text-sm font-semibold leading-5",
|
|
65
68
|
s ? "text-muted-foreground" : "text-foreground"
|
|
66
69
|
),
|
|
67
|
-
children:
|
|
70
|
+
children: e
|
|
68
71
|
}
|
|
69
72
|
),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ d("span", { className: "flex shrink-0 flex-col items-end", children: [
|
|
74
|
+
/* @__PURE__ */ a(
|
|
72
75
|
"span",
|
|
73
76
|
{
|
|
74
|
-
className:
|
|
77
|
+
className: i(
|
|
75
78
|
"text-sm font-semibold leading-5 tabular-nums",
|
|
76
79
|
s ? "text-muted-foreground" : "text-foreground"
|
|
77
80
|
),
|
|
@@ -79,12 +82,12 @@ function N({
|
|
|
79
82
|
children: n
|
|
80
83
|
}
|
|
81
84
|
),
|
|
82
|
-
|
|
85
|
+
t != null ? /* @__PURE__ */ a(
|
|
83
86
|
"span",
|
|
84
87
|
{
|
|
85
88
|
className: "text-xs leading-4 text-muted-foreground",
|
|
86
|
-
"data-testid":
|
|
87
|
-
children:
|
|
89
|
+
"data-testid": c,
|
|
90
|
+
children: t
|
|
88
91
|
}
|
|
89
92
|
) : null
|
|
90
93
|
] })
|
|
@@ -92,15 +95,16 @@ function N({
|
|
|
92
95
|
}
|
|
93
96
|
);
|
|
94
97
|
}
|
|
95
|
-
function
|
|
96
|
-
return /* @__PURE__ */
|
|
98
|
+
function y() {
|
|
99
|
+
return /* @__PURE__ */ a("div", { className: "h-px w-full bg-divider" });
|
|
97
100
|
}
|
|
98
101
|
export {
|
|
99
102
|
p as APY_BREAKDOWN_TOOLTIP_WIDTH,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
N as ApyBreakdownBody,
|
|
104
|
+
y as ApyBreakdownDivider,
|
|
105
|
+
w as ApyBreakdownRow,
|
|
103
106
|
x as BREAKDOWN_DASH,
|
|
104
|
-
|
|
105
|
-
g as
|
|
107
|
+
h as breakdownRateValue,
|
|
108
|
+
g as formatBreakdownRate,
|
|
109
|
+
b as periodMessageId
|
|
106
110
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { APY_BREAKDOWN_TOOLTIP_WIDTH as
|
|
1
|
+
import { APY_BREAKDOWN_TOOLTIP_WIDTH as a, ApyBreakdownBody as r, ApyBreakdownDivider as d, ApyBreakdownRow as A, BREAKDOWN_DASH as B, breakdownRateValue as w, formatBreakdownRate as k, periodMessageId as n } from "./apy-breakdown-body.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
a as APY_BREAKDOWN_TOOLTIP_WIDTH,
|
|
4
|
+
r as ApyBreakdownBody,
|
|
5
|
+
d as ApyBreakdownDivider,
|
|
6
6
|
A as ApyBreakdownRow,
|
|
7
7
|
B as BREAKDOWN_DASH,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
w as breakdownRateValue,
|
|
9
|
+
k as formatBreakdownRate,
|
|
10
|
+
n as periodMessageId
|
|
10
11
|
};
|
|
@@ -1,199 +1,204 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { calcNetStrategyApy as
|
|
3
|
-
import {
|
|
4
|
-
import { NoValue as
|
|
5
|
-
import { PointsIcon as
|
|
6
|
-
import { TokenIcon as
|
|
7
|
-
import { FormattedMessageTyped as
|
|
8
|
-
import { formatLeverageExact as
|
|
9
|
-
import { totalApyOf as
|
|
10
|
-
import { StrategyApyBreakdownCardTest as
|
|
11
|
-
function
|
|
12
|
-
const { borrowApyAvg7D:
|
|
13
|
-
return
|
|
14
|
-
borrowApy:
|
|
15
|
-
quotaRate:
|
|
16
|
-
liquidationThreshold:
|
|
1
|
+
import { jsxs as w, jsx as e, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { calcNetStrategyApy as M, calcEffectiveBorrowApy as q } from "@gearbox-protocol/sdk/onchain";
|
|
3
|
+
import { breakdownRateValue as P, ApyBreakdownBody as O, formatBreakdownRate as m, ApyBreakdownRow as b, periodMessageId as k, ApyBreakdownDivider as S, BREAKDOWN_DASH as E } from "../apy-breakdown-body/apy-breakdown-body.js";
|
|
4
|
+
import { NoValue as g } from "../../no-value/no-value.js";
|
|
5
|
+
import { PointsIcon as j } from "../../points-icon/points-icon.js";
|
|
6
|
+
import { TokenIcon as z } from "../../token-icon/token-icon.js";
|
|
7
|
+
import { FormattedMessageTyped as i } from "../../typed-intl/index.js";
|
|
8
|
+
import { formatLeverageExact as p, formatLeverage as F } from "../../../utils/format-leverage.js";
|
|
9
|
+
import { totalApyOf as V, positiveTokenRewardsOf as H, pointProgramsOf as K } from "../../../utils/internal/apy-breakdown.js";
|
|
10
|
+
import { StrategyApyBreakdownCardTest as l } from "./constants.js";
|
|
11
|
+
function W(c) {
|
|
12
|
+
const { borrowApyAvg7D: o, quotaRateAvg7D: r, liquidationThreshold: n } = c;
|
|
13
|
+
return o === void 0 || r === void 0 ? null : {
|
|
14
|
+
borrowApy: o,
|
|
15
|
+
quotaRate: r,
|
|
16
|
+
liquidationThreshold: n
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function Y(c, o, r) {
|
|
20
|
+
const n = P(c), a = r - o * n;
|
|
21
|
+
return a > 0 && o > 0 ? n + Math.ceil(a / o * 100) / 100 : n;
|
|
22
|
+
}
|
|
23
|
+
function ao({
|
|
24
|
+
data: c,
|
|
25
|
+
leverage: o,
|
|
26
|
+
showFormula: r = !1,
|
|
27
|
+
period: n
|
|
24
28
|
}) {
|
|
25
|
-
const a =
|
|
26
|
-
organicApy:
|
|
29
|
+
const a = W(c), s = a && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, I = a !== null && s !== void 0, B = I && a && s ? {
|
|
30
|
+
organicApy: M(
|
|
27
31
|
a,
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
s.organicApy,
|
|
33
|
+
o
|
|
30
34
|
),
|
|
31
|
-
totalApy:
|
|
35
|
+
totalApy: M(
|
|
32
36
|
a,
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
s.totalApy ?? s.organicApy,
|
|
38
|
+
o
|
|
35
39
|
),
|
|
36
|
-
...
|
|
37
|
-
} : null,
|
|
38
|
-
reward:
|
|
39
|
-
value: Math.round(
|
|
40
|
-
})), y =
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
...s.rewards ? { rewards: s.rewards } : {}
|
|
41
|
+
} : null, d = I && a ? q(a, o) : null, u = B === null ? null : V(B), h = u === null || d === null ? null : u + d, L = s ? H(s) : [], R = s ? K(s) : [], T = L.map((t) => ({
|
|
42
|
+
reward: t,
|
|
43
|
+
value: Math.round(o * (t.supplyApr ?? 0))
|
|
44
|
+
})), y = h === null ? null : h - T.reduce((t, f) => t + f.value, 0), x = y !== null && o > 0 ? y / o : void 0, N = a && d !== null && o > 0 ? (d - a.borrowApy * (o - 1)) / o : void 0, C = Number(p(o)), v = d === null ? void 0 : P(d), A = a && N !== void 0 && v !== void 0 ? Y(
|
|
45
|
+
a.borrowApy + N,
|
|
46
|
+
C,
|
|
47
|
+
v
|
|
48
|
+
) : void 0, D = A !== void 0 && v !== void 0 ? C * A - v : void 0;
|
|
49
|
+
return /* @__PURE__ */ w(
|
|
50
|
+
O,
|
|
43
51
|
{
|
|
44
|
-
testId:
|
|
52
|
+
testId: l.root,
|
|
45
53
|
title: /* @__PURE__ */ e(
|
|
46
|
-
|
|
54
|
+
i,
|
|
47
55
|
{
|
|
48
|
-
messageId:
|
|
49
|
-
|
|
56
|
+
messageId: k(
|
|
57
|
+
n,
|
|
50
58
|
"components.yieldBreakdown.titleNetAtLeverage",
|
|
51
59
|
"components.yieldBreakdown.titleNetAtLeverage7d"
|
|
52
60
|
),
|
|
53
|
-
values: { leverage:
|
|
61
|
+
values: { leverage: F(o) }
|
|
54
62
|
}
|
|
55
63
|
),
|
|
56
|
-
chip: u === null ? /* @__PURE__ */ e(
|
|
64
|
+
chip: u === null ? /* @__PURE__ */ e(g, { reason: n }) : m(u, !0),
|
|
57
65
|
chipPositive: (u ?? 0) > 0,
|
|
58
|
-
chipTestId:
|
|
66
|
+
chipTestId: l.net,
|
|
59
67
|
children: [
|
|
60
68
|
/* @__PURE__ */ e(
|
|
61
|
-
|
|
69
|
+
b,
|
|
62
70
|
{
|
|
63
|
-
testId:
|
|
64
|
-
valueTestId:
|
|
65
|
-
captionTestId:
|
|
71
|
+
testId: l.collateral,
|
|
72
|
+
valueTestId: l.value,
|
|
73
|
+
captionTestId: l.caption,
|
|
66
74
|
label: /* @__PURE__ */ e(
|
|
67
|
-
|
|
75
|
+
i,
|
|
68
76
|
{
|
|
69
|
-
messageId:
|
|
70
|
-
|
|
77
|
+
messageId: k(
|
|
78
|
+
n,
|
|
71
79
|
"components.yieldBreakdown.collateralApy",
|
|
72
80
|
"components.yieldBreakdown.collateralApy7d"
|
|
73
81
|
)
|
|
74
82
|
}
|
|
75
83
|
),
|
|
76
|
-
value: y === null ? /* @__PURE__ */ e(
|
|
77
|
-
subtext:
|
|
78
|
-
|
|
84
|
+
value: y === null ? /* @__PURE__ */ e(g, { reason: n }) : m(y),
|
|
85
|
+
subtext: r && x !== void 0 ? /* @__PURE__ */ e(
|
|
86
|
+
i,
|
|
79
87
|
{
|
|
80
88
|
messageId: "components.strategyApyBreakdownCard.formula",
|
|
81
89
|
values: {
|
|
82
|
-
leverage:
|
|
83
|
-
base:
|
|
90
|
+
leverage: p(o),
|
|
91
|
+
base: m(x)
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
94
|
) : void 0
|
|
87
95
|
}
|
|
88
96
|
),
|
|
89
|
-
T.map(({ reward:
|
|
90
|
-
|
|
97
|
+
T.map(({ reward: t, value: f }) => /* @__PURE__ */ e(
|
|
98
|
+
b,
|
|
91
99
|
{
|
|
92
|
-
valueTestId:
|
|
93
|
-
captionTestId:
|
|
94
|
-
label: /* @__PURE__ */
|
|
100
|
+
valueTestId: l.value,
|
|
101
|
+
captionTestId: l.caption,
|
|
102
|
+
label: /* @__PURE__ */ w("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
95
103
|
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
96
|
-
|
|
104
|
+
i,
|
|
97
105
|
{
|
|
98
106
|
messageId: "components.apyParts.extraAPY",
|
|
99
|
-
values: { symbol:
|
|
107
|
+
values: { symbol: t.token.symbol }
|
|
100
108
|
}
|
|
101
109
|
) }),
|
|
102
110
|
/* @__PURE__ */ e(
|
|
103
|
-
|
|
111
|
+
z,
|
|
104
112
|
{
|
|
105
|
-
token:
|
|
106
|
-
symbol:
|
|
113
|
+
token: t.token,
|
|
114
|
+
symbol: t.token.symbol,
|
|
107
115
|
size: 16,
|
|
108
116
|
className: "shrink-0"
|
|
109
117
|
}
|
|
110
118
|
)
|
|
111
119
|
] }),
|
|
112
|
-
value:
|
|
113
|
-
subtext:
|
|
114
|
-
|
|
120
|
+
value: m(f),
|
|
121
|
+
subtext: r ? /* @__PURE__ */ e(
|
|
122
|
+
i,
|
|
115
123
|
{
|
|
116
124
|
messageId: "components.strategyApyBreakdownCard.formula",
|
|
117
125
|
values: {
|
|
118
|
-
leverage:
|
|
119
|
-
base:
|
|
126
|
+
leverage: p(o),
|
|
127
|
+
base: m(t.supplyApr ?? 0)
|
|
120
128
|
}
|
|
121
129
|
}
|
|
122
130
|
) : void 0
|
|
123
131
|
},
|
|
124
|
-
`incentive-${
|
|
132
|
+
`incentive-${t.token.address}-${t.supplyApr ?? 0}`
|
|
125
133
|
)),
|
|
126
134
|
/* @__PURE__ */ e(
|
|
127
|
-
|
|
135
|
+
b,
|
|
128
136
|
{
|
|
129
137
|
muted: !0,
|
|
130
|
-
testId:
|
|
131
|
-
valueTestId:
|
|
132
|
-
captionTestId:
|
|
138
|
+
testId: l.borrow,
|
|
139
|
+
valueTestId: l.value,
|
|
140
|
+
captionTestId: l.caption,
|
|
133
141
|
label: /* @__PURE__ */ e(
|
|
134
|
-
|
|
142
|
+
i,
|
|
135
143
|
{
|
|
136
|
-
messageId:
|
|
137
|
-
|
|
144
|
+
messageId: k(
|
|
145
|
+
n,
|
|
138
146
|
"components.yieldBreakdown.borrowRate",
|
|
139
147
|
"components.yieldBreakdown.borrowRate7d"
|
|
140
148
|
)
|
|
141
149
|
}
|
|
142
150
|
),
|
|
143
|
-
value:
|
|
144
|
-
subtext:
|
|
145
|
-
|
|
151
|
+
value: d === null ? /* @__PURE__ */ e(g, { reason: n }) : m(d),
|
|
152
|
+
subtext: r && A !== void 0 && D !== void 0 ? /* @__PURE__ */ e(
|
|
153
|
+
i,
|
|
146
154
|
{
|
|
147
155
|
messageId: "components.strategyApyBreakdownCard.borrowFormula",
|
|
148
156
|
values: {
|
|
149
|
-
leverage:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
// the caption is not the sum of two figures it also printed.
|
|
153
|
-
totalRate: i(a.borrowApy + x),
|
|
154
|
-
borrowRate: i(a.borrowApy)
|
|
157
|
+
leverage: p(o),
|
|
158
|
+
totalRate: `${A.toFixed(2)}%`,
|
|
159
|
+
borrowRate: `${Math.abs(D).toFixed(2)}%`
|
|
155
160
|
}
|
|
156
161
|
}
|
|
157
162
|
) : void 0
|
|
158
163
|
}
|
|
159
164
|
),
|
|
160
|
-
|
|
161
|
-
/* @__PURE__ */ e(
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
R.length > 0 ? /* @__PURE__ */ w($, { children: [
|
|
166
|
+
/* @__PURE__ */ e(S, {}),
|
|
167
|
+
R.map((t) => /* @__PURE__ */ e(
|
|
168
|
+
b,
|
|
164
169
|
{
|
|
165
|
-
valueTestId:
|
|
166
|
-
captionTestId:
|
|
167
|
-
label: /* @__PURE__ */
|
|
170
|
+
valueTestId: l.points,
|
|
171
|
+
captionTestId: l.caption,
|
|
172
|
+
label: /* @__PURE__ */ w("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
168
173
|
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
169
|
-
|
|
174
|
+
i,
|
|
170
175
|
{
|
|
171
176
|
messageId: "components.yieldBreakdown.programPoints",
|
|
172
|
-
values: { name:
|
|
177
|
+
values: { name: t.name }
|
|
173
178
|
}
|
|
174
179
|
) }),
|
|
175
180
|
/* @__PURE__ */ e(
|
|
176
|
-
|
|
181
|
+
j,
|
|
177
182
|
{
|
|
178
|
-
reward: { name:
|
|
183
|
+
reward: { name: t.name, type: t.id },
|
|
179
184
|
size: 16,
|
|
180
185
|
className: "shrink-0"
|
|
181
186
|
}
|
|
182
187
|
)
|
|
183
188
|
] }),
|
|
184
|
-
value:
|
|
185
|
-
subtext:
|
|
186
|
-
|
|
189
|
+
value: t.multiplier != null ? `${p(t.multiplier * o)}×` : E,
|
|
190
|
+
subtext: r && t.multiplier != null ? /* @__PURE__ */ e(
|
|
191
|
+
i,
|
|
187
192
|
{
|
|
188
193
|
messageId: "components.strategyApyBreakdownCard.formula",
|
|
189
194
|
values: {
|
|
190
|
-
leverage:
|
|
191
|
-
base:
|
|
195
|
+
leverage: p(o),
|
|
196
|
+
base: p(t.multiplier)
|
|
192
197
|
}
|
|
193
198
|
}
|
|
194
199
|
) : void 0
|
|
195
200
|
},
|
|
196
|
-
|
|
201
|
+
t.id
|
|
197
202
|
))
|
|
198
203
|
] }) : null
|
|
199
204
|
]
|
|
@@ -201,6 +206,6 @@ function U({
|
|
|
201
206
|
);
|
|
202
207
|
}
|
|
203
208
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
ao as StrategyApyBreakdownCard,
|
|
210
|
+
l as StrategyApyBreakdownCardTest
|
|
206
211
|
};
|
|
@@ -43,9 +43,9 @@ const e = {
|
|
|
43
43
|
"components.poolAssetsTable.capUtilization": "Cap Utilization",
|
|
44
44
|
"components.poolAssetsTable.capBelowExposure.tip": "The curator has lowered the cap below current exposure. Exposure cannot be increased.",
|
|
45
45
|
"components.poolTable.line.rwa.tip": "This is RWA market.",
|
|
46
|
-
"components.strategiesTable.line.name.disabled": "This
|
|
46
|
+
"components.strategiesTable.line.name.disabled": "This Leverage Opportunity is currently not available",
|
|
47
47
|
"components.strategiesTable.line.rwa": "RWA",
|
|
48
|
-
"components.strategiesTable.line.rwa.tip": "This
|
|
48
|
+
"components.strategiesTable.line.rwa.tip": "This Leverage Opportunity is available on RWA market.",
|
|
49
49
|
"dialogs.common.review": "Review",
|
|
50
50
|
"components.amountInput.max": "Max",
|
|
51
51
|
"components.amountInput.label": "Amount",
|
|
@@ -63,8 +63,8 @@ const e = {
|
|
|
63
63
|
"components.timeToLiquidationBlock.tip": "Time to liquidation estimates how long the Position can stay open if prices remain constant and no yield is earned—only accounting for borrow interest accrual.",
|
|
64
64
|
"components.historyChart.error": "Couldn't load chart data",
|
|
65
65
|
"components.historyChart.empty": "No data",
|
|
66
|
-
"components.positionTypeBadge.pool": "
|
|
67
|
-
"components.positionTypeBadge.strategy": "
|
|
66
|
+
"components.positionTypeBadge.pool": "Lend",
|
|
67
|
+
"components.positionTypeBadge.strategy": "Leverage",
|
|
68
68
|
"components.positionTypeBadge.liquidation": "Liquidation",
|
|
69
69
|
"components.positionStatusBadge.active": "Active",
|
|
70
70
|
"components.positionStatusBadge.repaid": "Repaid",
|
|
@@ -12,10 +12,11 @@ export declare function periodMessageId(period: "7d" | undefined, base: LocaleKe
|
|
|
12
12
|
* uses above 1000%. A breakdown is read by adding it up, and `1.2K%` carries
|
|
13
13
|
* three significant figures — enough to make a correct column look wrong.
|
|
14
14
|
*
|
|
15
|
-
* `signed` is for the net chip
|
|
16
|
-
* stated by the row it sits on.
|
|
15
|
+
* `signed` is for the net chip: every row states its direction in its label.
|
|
17
16
|
*/
|
|
18
17
|
export declare function formatBreakdownRate(value: Bps, signed?: boolean): string;
|
|
18
|
+
/** The percent a row prints, so a caption can be built to add up to it. */
|
|
19
|
+
export declare function breakdownRateValue(value: Bps): number;
|
|
19
20
|
export interface ApyBreakdownBodyProps {
|
|
20
21
|
/** Heading to the left of the chip — "Net APY (7d)" and the like. */
|
|
21
22
|
readonly title: React.ReactNode;
|
|
@@ -6,6 +6,6 @@ export interface PositionTypeBadgeProps {
|
|
|
6
6
|
readonly size?: "table" | "aside" | "title";
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Colored kind label of a position row: "
|
|
9
|
+
* Colored kind label of a position row: "Lend" / "Leverage" / "Liquidation".
|
|
10
10
|
*/
|
|
11
11
|
export declare function PositionTypeBadge({ data, size, }: PositionTypeBadgeProps): React.ReactElement;
|
|
@@ -37,14 +37,9 @@ export declare function UtilizationValue({ data, }: {
|
|
|
37
37
|
readonly data: Bps | undefined;
|
|
38
38
|
}): React.ReactElement;
|
|
39
39
|
/**
|
|
40
|
-
* Health factor with its zone: below 1 the account is liquidatable.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* liquidate the figure has no zone, and the SDK reports one that would read as
|
|
44
|
-
* the worst there is — `0` bps from the on-chain `MAX_UINT256` sentinel, or
|
|
45
|
-
* `65535` down the price-failed path. The figure still shows; only the colour
|
|
46
|
-
* goes. ({@link HealthFactor}, the block, takes the same prop and answers
|
|
47
|
-
* "N/A" instead — a table cell that blanks out loses its column's alignment.)
|
|
40
|
+
* Health factor with its zone: below 1 the account is liquidatable. A `debt` of
|
|
41
|
+
* `0n` drops the zone — a repaid account still reports a figure, and it reads
|
|
42
|
+
* as the worst there is.
|
|
48
43
|
*/
|
|
49
44
|
export declare function HealthFactorValue({ data, debt, }: {
|
|
50
45
|
readonly data: Bps | undefined;
|
|
@@ -56,10 +56,10 @@ declare const _default: {
|
|
|
56
56
|
|
|
57
57
|
"components.poolTable.line.rwa.tip": "This is RWA market.",
|
|
58
58
|
|
|
59
|
-
"components.strategiesTable.line.name.disabled": "This
|
|
59
|
+
"components.strategiesTable.line.name.disabled": "This Leverage Opportunity is currently not available",
|
|
60
60
|
|
|
61
61
|
"components.strategiesTable.line.rwa": "RWA",
|
|
62
|
-
"components.strategiesTable.line.rwa.tip": "This
|
|
62
|
+
"components.strategiesTable.line.rwa.tip": "This Leverage Opportunity is available on RWA market.",
|
|
63
63
|
|
|
64
64
|
"dialogs.common.review": "Review",
|
|
65
65
|
|
|
@@ -85,8 +85,8 @@ declare const _default: {
|
|
|
85
85
|
"components.historyChart.error": "Couldn't load chart data",
|
|
86
86
|
"components.historyChart.empty": "No data",
|
|
87
87
|
|
|
88
|
-
"components.positionTypeBadge.pool": "
|
|
89
|
-
"components.positionTypeBadge.strategy": "
|
|
88
|
+
"components.positionTypeBadge.pool": "Lend",
|
|
89
|
+
"components.positionTypeBadge.strategy": "Leverage",
|
|
90
90
|
"components.positionTypeBadge.liquidation": "Liquidation",
|
|
91
91
|
|
|
92
92
|
"components.positionStatusBadge.active": "Active",
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
* A USD figure as a badge shows it: cents below ten thousand, an abbreviation
|
|
3
3
|
* above it.
|
|
4
4
|
*
|
|
5
|
-
* Neither existing formatter can do this. `formatMoney` abbreviates from a
|
|
6
|
-
* thousand, suffixes billions `Bn`, and truncates through the SDK's `formatBN`
|
|
7
|
-
* (`12.34` comes back as `12.33`); `formatOraclePrice` never abbreviates and drops
|
|
8
|
-
* the cents from a thousand up.
|
|
9
|
-
*
|
|
10
5
|
* @example
|
|
11
6
|
* ```ts
|
|
12
7
|
* formatPnl(1234.56) // "$1,234.56"
|