@gearbox-protocol/ui-kit 4.0.0-next.32 → 4.0.0-next.33

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../apy-breakdown-body/apy-breakdown-body.cjs"),A=require("../../points-icon/points-icon.cjs"),T=require("../../token-icon/token-icon.cjs"),r=require("../../typed-intl/index.cjs"),m=require("../../../utils/apy-breakdown.cjs"),n=require("../../../utils/format-leverage.cjs"),o=require("./constants.cjs");function x({data:d,showFormula:p=!1,period:i}){const{leverage:s,collateralApy:l}=d,y=m.totalApyOf(d.netApy),B=y+d.borrowCost,v=l?m.positiveTokenRewardsOf(l):[],g=l?m.pointProgramsOf(l):[],u=v.map(a=>({reward:a,value:Math.round(s*(a.supplyApr??0))})),k=B-u.reduce((a,c)=>a+c.value,0),w=s>0?k/s:void 0;return e.jsxs(t.ApyBreakdownBody,{testId:o.StrategyApyBreakdownCardTest.root,title:e.jsx(r.FormattedMessageTyped,{messageId:t.periodMessageId(i,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:n.formatLeverage(s)}}),chip:t.formatBreakdownRate(y),chipPositive:y>0,chipTestId:o.StrategyApyBreakdownCardTest.net,children:[e.jsx(t.ApyBreakdownRow,{testId:o.StrategyApyBreakdownCardTest.collateral,valueTestId:o.StrategyApyBreakdownCardTest.value,captionTestId:o.StrategyApyBreakdownCardTest.caption,label:e.jsx(r.FormattedMessageTyped,{messageId:t.periodMessageId(i,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:t.formatBreakdownRate(k),subtext:p&&w!==void 0?e.jsx(r.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:n.formatLeverage(s),base:t.formatBreakdownRate(w)}}):void 0}),u.map(({reward:a,value:c})=>e.jsx(t.ApyBreakdownRow,{valueTestId:o.StrategyApyBreakdownCardTest.value,captionTestId:o.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(r.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:a.token.symbol}})}),e.jsx(T.TokenIcon,{token:a.token,symbol:a.token.symbol,size:16,className:"shrink-0"})]}),value:t.formatBreakdownRate(c),subtext:p?e.jsx(r.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:n.formatLeverage(s),base:t.formatBreakdownRate(a.supplyApr??0)}}):void 0},`incentive-${a.token.address}-${a.supplyApr??0}`)),e.jsx(t.ApyBreakdownRow,{muted:!0,testId:o.StrategyApyBreakdownCardTest.borrow,valueTestId:o.StrategyApyBreakdownCardTest.value,label:e.jsx(r.FormattedMessageTyped,{messageId:t.periodMessageId(i,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:t.formatBreakdownRate(-d.borrowCost)}),g.length>0?e.jsxs(e.Fragment,{children:[e.jsx(t.ApyBreakdownDivider,{}),g.map(a=>e.jsx(t.ApyBreakdownRow,{valueTestId:o.StrategyApyBreakdownCardTest.points,captionTestId:o.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(r.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:a.name}})}),e.jsx(A.PointsIcon,{reward:{name:a.name,type:a.id},size:16,className:"shrink-0"})]}),value:a.multiplier!=null?`${n.formatLeverage(a.multiplier*s)}×`:t.BREAKDOWN_DASH,subtext:p&&a.multiplier!=null?e.jsx(r.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:n.formatLeverage(s),base:n.formatLeverage(a.multiplier)}}):void 0},a.id))]}):null]})}exports.StrategyApyBreakdownCardTest=o.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),w=require("@gearbox-protocol/sdk/onchain"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),j=require("../../points-icon/points-icon.cjs"),C=require("../../token-icon/token-icon.cjs"),d=require("../../typed-intl/index.cjs"),A=require("../../../utils/apy-breakdown.cjs"),l=require("../../../utils/format-leverage.cjs"),r=require("./constants.cjs");function R(i){const{borrowApyAvg7D:a,quotaRateAvg7D:p,liquidationThreshold:y}=i;return a===void 0||p===void 0?null:{borrowApy:a,quotaRate:p,liquidationThreshold:y}}function S({data:i,leverage:a,showFormula:p=!1,period:y}){const s=R(i),n=s&&i.collateralApyAvg7D?i.collateralApyAvg7D:void 0,c=s!==null&&n!==void 0,x=c&&s&&n?{organicApy:w.calcNetStrategyApy(s,n.organicApy,a),totalApy:w.calcNetStrategyApy(s,n.totalApy??n.organicApy,a),...n.rewards?{rewards:n.rewards}:{}}:{organicApy:0,totalApy:0},m=c&&s?w.calcEffectiveBorrowApy(s,a):0,u=A.totalApyOf(x),I=u+m,b=n?A.positiveTokenRewardsOf(n):[],k=n?A.pointProgramsOf(n):[],B=b.map(t=>({reward:t,value:Math.round(a*(t.supplyApr??0))})),v=I-B.reduce((t,g)=>t+g.value,0),T=a>0?v/a:void 0,f=c&&s&&a>0?(m-s.borrowApy*(a-1))/a:void 0;return e.jsxs(o.ApyBreakdownBody,{testId:r.StrategyApyBreakdownCardTest.root,title:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(y,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:l.formatLeverage(a)}}),chip:o.formatBreakdownRate(u),chipPositive:u>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(d.FormattedMessageTyped,{messageId:o.periodMessageId(y,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:o.formatBreakdownRate(v),subtext:p&&T!==void 0?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:l.formatLeverage(a),base:o.formatBreakdownRate(T)}}):void 0}),B.map(({reward:t,value:g})=>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(d.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:t.token.symbol}})}),e.jsx(C.TokenIcon,{token:t.token,symbol:t.token.symbol,size:16,className:"shrink-0"})]}),value:o.formatBreakdownRate(g),subtext:p?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:l.formatLeverage(a),base:o.formatBreakdownRate(t.supplyApr??0)}}):void 0},`incentive-${t.token.address}-${t.supplyApr??0}`)),e.jsx(o.ApyBreakdownRow,{muted:!0,testId:r.StrategyApyBreakdownCardTest.borrow,valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(y,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:o.formatBreakdownRate(-m),subtext:p&&s&&f!==void 0?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.borrowFormula",values:{leverage:l.formatLeverage(a),borrowRate:o.formatBreakdownRate(s.borrowApy),quotaRate:o.formatBreakdownRate(f)}}):void 0}),k.length>0?e.jsxs(e.Fragment,{children:[e.jsx(o.ApyBreakdownDivider,{}),k.map(t=>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(d.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:t.name}})}),e.jsx(j.PointsIcon,{reward:{name:t.name,type:t.id},size:16,className:"shrink-0"})]}),value:t.multiplier!=null?`${l.formatLeverage(t.multiplier*a)}×`:o.BREAKDOWN_DASH,subtext:p&&t.multiplier!=null?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:l.formatLeverage(a),base:l.formatLeverage(t.multiplier)}}):void 0},t.id))]}):null]})}exports.StrategyApyBreakdownCardTest=r.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=S;
@@ -1 +1 @@
1
- "use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.networkIndicator.title":"Network","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.sdkStatus.connecting":"Connecting…","components.sdkStatus.connected":"Connected","components.sdkStatus.disconnected":"Not connected","components.creditAccountHistory.table.protocol":"Protocol","components.creditAccountHistory.table.operation":"Operation","components.creditAccountHistory.table.details":"Details","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.amountLabel":"Amount","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.smartNumberInput.selectToken":"Select token","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.titleNetAtLeverage7d":"Net APY at {leverage}× Leverage (7d)","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.rate":"Effective rate","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap utilization","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy 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 account '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 account'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 account 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":"LP","components.positionTypeBadge.strategy":"Strategy","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.strategyApyBreakdownCard.formula":"{leverage} × {base}","components.strategyApyBreakdownCard.borrowFormula":"{debtMultiplier} × {borrowBase} + {quotaMultiplier} × {quotaBase}","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 Account value or Debt amount.","components.transactionConfirm.previewLoading":"Parsing transaction…","components.transactionConfirm.previewErrorTitle":"Preview error"};module.exports=e;
1
+ "use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.networkIndicator.title":"Network","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.sdkStatus.connecting":"Connecting…","components.sdkStatus.connected":"Connected","components.sdkStatus.disconnected":"Not connected","components.creditAccountHistory.table.protocol":"Protocol","components.creditAccountHistory.table.operation":"Operation","components.creditAccountHistory.table.details":"Details","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.amountLabel":"Amount","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.smartNumberInput.selectToken":"Select token","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.titleNetAtLeverage7d":"Net APY at {leverage}× Leverage (7d)","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.rate":"Effective rate","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap utilization","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy 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 account '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 account'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 account 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":"LP","components.positionTypeBadge.strategy":"Strategy","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.strategyApyBreakdownCard.formula":"{leverage} × {base}","components.strategyApyBreakdownCard.borrowFormula":"{leverage} × ({borrowRate} + {quotaRate}) − {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 Account value or Debt amount.","components.transactionConfirm.previewLoading":"Parsing transaction…","components.transactionConfirm.previewErrorTitle":"Preview error"};module.exports=e;
@@ -1,83 +1,105 @@
1
- import { jsxs as d, jsx as t, Fragment as b } from "react/jsx-runtime";
2
- import { ApyBreakdownBody as B, formatBreakdownRate as n, ApyBreakdownRow as m, periodMessageId as y, ApyBreakdownDivider as T, BREAKDOWN_DASH as h } from "../apy-breakdown-body/apy-breakdown-body.js";
3
- import { PointsIcon as x } from "../../points-icon/points-icon.js";
4
- import { TokenIcon as C } from "../../token-icon/token-icon.js";
5
- import { FormattedMessageTyped as s } from "../../typed-intl/index.js";
6
- import { totalApyOf as N, positiveTokenRewardsOf as R, pointProgramsOf as P } from "../../../utils/apy-breakdown.js";
7
- import { formatLeverage as l } from "../../../utils/format-leverage.js";
8
- import { StrategyApyBreakdownCardTest as o } from "./constants.js";
9
- function E({
10
- data: r,
11
- showFormula: p = !1,
1
+ import { jsxs as m, jsx as t, Fragment as N } from "react/jsx-runtime";
2
+ import { calcNetStrategyApy as T, calcEffectiveBorrowApy as C } from "@gearbox-protocol/sdk/onchain";
3
+ import { ApyBreakdownBody as D, formatBreakdownRate as l, ApyBreakdownRow as y, periodMessageId as k, ApyBreakdownDivider as P, BREAKDOWN_DASH as q } from "../apy-breakdown-body/apy-breakdown-body.js";
4
+ import { PointsIcon as O } from "../../points-icon/points-icon.js";
5
+ import { TokenIcon as S } from "../../token-icon/token-icon.js";
6
+ import { FormattedMessageTyped as r } from "../../typed-intl/index.js";
7
+ import { totalApyOf as L, positiveTokenRewardsOf as M, pointProgramsOf as $ } from "../../../utils/apy-breakdown.js";
8
+ import { formatLeverage as d } from "../../../utils/format-leverage.js";
9
+ import { StrategyApyBreakdownCardTest as a } from "./constants.js";
10
+ function j(p) {
11
+ const { borrowApyAvg7D: o, quotaRateAvg7D: i, liquidationThreshold: c } = p;
12
+ return o === void 0 || i === void 0 ? null : {
13
+ borrowApy: o,
14
+ quotaRate: i,
15
+ liquidationThreshold: c
16
+ };
17
+ }
18
+ function J({
19
+ data: p,
20
+ leverage: o,
21
+ showFormula: i = !1,
12
22
  period: c
13
23
  }) {
14
- const { leverage: a, collateralApy: i } = r, u = N(r.netApy), f = u + r.borrowCost, w = i ? R(i) : [], g = i ? P(i) : [], k = w.map((e) => ({
24
+ const n = j(p), s = n && p.collateralApyAvg7D ? p.collateralApyAvg7D : void 0, u = n !== null && s !== void 0, h = u && n && s ? {
25
+ organicApy: T(
26
+ n,
27
+ s.organicApy,
28
+ o
29
+ ),
30
+ totalApy: T(
31
+ n,
32
+ s.totalApy ?? s.organicApy,
33
+ o
34
+ ),
35
+ ...s.rewards ? { rewards: s.rewards } : {}
36
+ } : { organicApy: 0, totalApy: 0 }, A = u && n ? C(n, o) : 0, v = L(h), R = v + A, x = s ? M(s) : [], g = s ? $(s) : [], b = x.map((e) => ({
15
37
  reward: e,
16
- value: Math.round(a * (e.supplyApr ?? 0))
17
- })), I = f - k.reduce((e, v) => e + v.value, 0), A = a > 0 ? I / a : void 0;
18
- return /* @__PURE__ */ d(
19
- B,
38
+ value: Math.round(o * (e.supplyApr ?? 0))
39
+ })), f = R - b.reduce((e, w) => e + w.value, 0), I = o > 0 ? f / o : void 0, B = u && n && o > 0 ? (A - n.borrowApy * (o - 1)) / o : void 0;
40
+ return /* @__PURE__ */ m(
41
+ D,
20
42
  {
21
- testId: o.root,
43
+ testId: a.root,
22
44
  title: /* @__PURE__ */ t(
23
- s,
45
+ r,
24
46
  {
25
- messageId: y(
47
+ messageId: k(
26
48
  c,
27
49
  "components.yieldBreakdown.titleNetAtLeverage",
28
50
  "components.yieldBreakdown.titleNetAtLeverage7d"
29
51
  ),
30
- values: { leverage: l(a) }
52
+ values: { leverage: d(o) }
31
53
  }
32
54
  ),
33
- chip: n(u),
34
- chipPositive: u > 0,
35
- chipTestId: o.net,
55
+ chip: l(v),
56
+ chipPositive: v > 0,
57
+ chipTestId: a.net,
36
58
  children: [
37
59
  /* @__PURE__ */ t(
38
- m,
60
+ y,
39
61
  {
40
- testId: o.collateral,
41
- valueTestId: o.value,
42
- captionTestId: o.caption,
62
+ testId: a.collateral,
63
+ valueTestId: a.value,
64
+ captionTestId: a.caption,
43
65
  label: /* @__PURE__ */ t(
44
- s,
66
+ r,
45
67
  {
46
- messageId: y(
68
+ messageId: k(
47
69
  c,
48
70
  "components.yieldBreakdown.collateralApy",
49
71
  "components.yieldBreakdown.collateralApy7d"
50
72
  )
51
73
  }
52
74
  ),
53
- value: n(I),
54
- subtext: p && A !== void 0 ? /* @__PURE__ */ t(
55
- s,
75
+ value: l(f),
76
+ subtext: i && I !== void 0 ? /* @__PURE__ */ t(
77
+ r,
56
78
  {
57
79
  messageId: "components.strategyApyBreakdownCard.formula",
58
80
  values: {
59
- leverage: l(a),
60
- base: n(A)
81
+ leverage: d(o),
82
+ base: l(I)
61
83
  }
62
84
  }
63
85
  ) : void 0
64
86
  }
65
87
  ),
66
- k.map(({ reward: e, value: v }) => /* @__PURE__ */ t(
67
- m,
88
+ b.map(({ reward: e, value: w }) => /* @__PURE__ */ t(
89
+ y,
68
90
  {
69
- valueTestId: o.value,
70
- captionTestId: o.caption,
71
- label: /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-1.5", children: [
91
+ valueTestId: a.value,
92
+ captionTestId: a.caption,
93
+ label: /* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1.5", children: [
72
94
  /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
73
- s,
95
+ r,
74
96
  {
75
97
  messageId: "components.apyParts.extraAPY",
76
98
  values: { symbol: e.token.symbol }
77
99
  }
78
100
  ) }),
79
101
  /* @__PURE__ */ t(
80
- C,
102
+ S,
81
103
  {
82
104
  token: e.token,
83
105
  symbol: e.token.symbol,
@@ -86,14 +108,14 @@ function E({
86
108
  }
87
109
  )
88
110
  ] }),
89
- value: n(v),
90
- subtext: p ? /* @__PURE__ */ t(
91
- s,
111
+ value: l(w),
112
+ subtext: i ? /* @__PURE__ */ t(
113
+ r,
92
114
  {
93
115
  messageId: "components.strategyApyBreakdownCard.formula",
94
116
  values: {
95
- leverage: l(a),
96
- base: n(e.supplyApr ?? 0)
117
+ leverage: d(o),
118
+ base: l(e.supplyApr ?? 0)
97
119
  }
98
120
  }
99
121
  ) : void 0
@@ -101,41 +123,56 @@ function E({
101
123
  `incentive-${e.token.address}-${e.supplyApr ?? 0}`
102
124
  )),
103
125
  /* @__PURE__ */ t(
104
- m,
126
+ y,
105
127
  {
106
128
  muted: !0,
107
- testId: o.borrow,
108
- valueTestId: o.value,
129
+ testId: a.borrow,
130
+ valueTestId: a.value,
131
+ captionTestId: a.caption,
109
132
  label: /* @__PURE__ */ t(
110
- s,
133
+ r,
111
134
  {
112
- messageId: y(
135
+ messageId: k(
113
136
  c,
114
137
  "components.yieldBreakdown.borrowRate",
115
138
  "components.yieldBreakdown.borrowRate7d"
116
139
  )
117
140
  }
118
141
  ),
119
- value: n(-r.borrowCost)
142
+ value: l(-A),
143
+ subtext: i && n && B !== void 0 ? /* @__PURE__ */ t(
144
+ r,
145
+ {
146
+ messageId: "components.strategyApyBreakdownCard.borrowFormula",
147
+ values: {
148
+ leverage: d(o),
149
+ // Magnitudes, not signed rates: the row above already carries
150
+ // the minus, and `− (−0.88%)` reads as arithmetic to decode
151
+ // rather than a cost to understand.
152
+ borrowRate: l(n.borrowApy),
153
+ quotaRate: l(B)
154
+ }
155
+ }
156
+ ) : void 0
120
157
  }
121
158
  ),
122
- g.length > 0 ? /* @__PURE__ */ d(b, { children: [
123
- /* @__PURE__ */ t(T, {}),
159
+ g.length > 0 ? /* @__PURE__ */ m(N, { children: [
160
+ /* @__PURE__ */ t(P, {}),
124
161
  g.map((e) => /* @__PURE__ */ t(
125
- m,
162
+ y,
126
163
  {
127
- valueTestId: o.points,
128
- captionTestId: o.caption,
129
- label: /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-1.5", children: [
164
+ valueTestId: a.points,
165
+ captionTestId: a.caption,
166
+ label: /* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1.5", children: [
130
167
  /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
131
- s,
168
+ r,
132
169
  {
133
170
  messageId: "components.yieldBreakdown.programPoints",
134
171
  values: { name: e.name }
135
172
  }
136
173
  ) }),
137
174
  /* @__PURE__ */ t(
138
- x,
175
+ O,
139
176
  {
140
177
  reward: { name: e.name, type: e.id },
141
178
  size: 16,
@@ -143,14 +180,14 @@ function E({
143
180
  }
144
181
  )
145
182
  ] }),
146
- value: e.multiplier != null ? `${l(e.multiplier * a)}×` : h,
147
- subtext: p && e.multiplier != null ? /* @__PURE__ */ t(
148
- s,
183
+ value: e.multiplier != null ? `${d(e.multiplier * o)}×` : q,
184
+ subtext: i && e.multiplier != null ? /* @__PURE__ */ t(
185
+ r,
149
186
  {
150
187
  messageId: "components.strategyApyBreakdownCard.formula",
151
188
  values: {
152
- leverage: l(a),
153
- base: l(e.multiplier)
189
+ leverage: d(o),
190
+ base: d(e.multiplier)
154
191
  }
155
192
  }
156
193
  ) : void 0
@@ -163,6 +200,6 @@ function E({
163
200
  );
164
201
  }
165
202
  export {
166
- E as StrategyApyBreakdownCard,
167
- o as StrategyApyBreakdownCardTest
203
+ J as StrategyApyBreakdownCard,
204
+ a as StrategyApyBreakdownCardTest
168
205
  };
@@ -188,7 +188,7 @@ const e = {
188
188
  "components.poolApyBreakdownCard.incentiveApy": "Incentive APY",
189
189
  "components.poolApyBreakdownCard.incentiveApy7d": "Incentive APY (7d)",
190
190
  "components.strategyApyBreakdownCard.formula": "{leverage} × {base}",
191
- "components.strategyApyBreakdownCard.borrowFormula": "{debtMultiplier} × {borrowBase} + {quotaMultiplier} × {quotaBase}",
191
+ "components.strategyApyBreakdownCard.borrowFormula": "{leverage} × ({borrowRate} + {quotaRate}) {borrowRate}",
192
192
  "components.leveragePresetChips.label": "Leverage:",
193
193
  "components.liquidationParamsTable.lt": "Liquidation threshold",
194
194
  "components.liquidationParamsTable.penalty": "Liquidation discount",
@@ -1,27 +1,20 @@
1
- import { ApyBreakdown, Bps, Leverage } from '@gearbox-protocol/sdk/model';
1
+ import { Leverage, StrategyOpportunity } from '@gearbox-protocol/sdk/model';
2
2
  import { default as React } from 'react';
3
3
  import { StrategyApyBreakdownCardTest } from './constants';
4
4
  export { StrategyApyBreakdownCardTest };
5
- export interface StrategyApyBreakdownData {
5
+ /**
6
+ * What the card reads off a strategy: the seven-day feed, and the liquidation
7
+ * threshold the quota is weighted by.
8
+ *
9
+ * A slice of the SDK type rather than a shape of its own, so a caller hands
10
+ * over the opportunity it already holds and the card states what it reads.
11
+ */
12
+ export type StrategyApyBreakdownSlice = Pick<StrategyOpportunity, "borrowApyAvg7D" | "quotaRateAvg7D" | "liquidationThreshold" | "collateralApyAvg7D">;
13
+ export interface StrategyApyBreakdownCardProps {
14
+ /** The strategy being broken down; every figure is derived from it. */
15
+ readonly data: StrategyApyBreakdownSlice;
6
16
  /** Leverage every figure below is quoted at. */
7
17
  readonly leverage: Leverage;
8
- /**
9
- * **N** — the strategy's net rate on the user's equity, as
10
- * `calcNetStrategyApy` returns it. Passed in rather than reconstructed:
11
- * this is the same figure the badge and the list cell print, and it stays
12
- * the same figure by being handed over, not by two formulas agreeing.
13
- */
14
- readonly netApy: ApyBreakdown;
15
- /**
16
- * **B** — cost of the credit behind the position, quota folded in, as
17
- * `calcEffectiveBorrowApy` returns it. Positive; the card negates it.
18
- */
19
- readonly borrowCost: Bps;
20
- /** The collateral yield the net was computed from, for its incentive rows. */
21
- readonly collateralApy?: ApyBreakdown;
22
- }
23
- export interface StrategyApyBreakdownCardProps {
24
- readonly data: StrategyApyBreakdownData;
25
18
  /**
26
19
  * Multiplier caption under each figure — `11.18 × 3.11%` and the like.
27
20
  *
@@ -36,9 +29,11 @@ export interface StrategyApyBreakdownCardProps {
36
29
  * How a strategy's net APY is arrived at: collateral yield on the leveraged
37
30
  * position, less what the credit behind it costs.
38
31
  *
39
- * The card computes no rate of its own. **N** (`netApy`) and **B**
40
- * (`borrowCost`) arrive already calculated, and the collateral row is their
41
- * sum which is exactly `round(leverage × collateralApy)`, because the SDK
32
+ * The card is handed a strategy and a leverage and derives the rest, because
33
+ * every figure it shows is a figure only this card asks for. **N** and **B**
34
+ * come from the SDK `calcNetStrategyApy` and `calcEffectiveBorrowApy`, the
35
+ * same two the badge and the list cell are quoting — and the collateral row is
36
+ * their sum, which is exactly `round(leverage × collateralApy)` because the SDK
42
37
  * subtracts an integer `B` inside its own rounding. Deriving the third value
43
38
  * instead of recomputing it is what makes `N = C − B` hold to the basis point
44
39
  * rather than approximately.
@@ -47,4 +42,4 @@ export interface StrategyApyBreakdownCardProps {
47
42
  * remainder, so the column adds up to the chip even when each reward rounds
48
43
  * its own way.
49
44
  */
50
- export declare function StrategyApyBreakdownCard({ data, showFormula, period, }: StrategyApyBreakdownCardProps): React.ReactElement;
45
+ export declare function StrategyApyBreakdownCard({ data, leverage, showFormula, period, }: StrategyApyBreakdownCardProps): React.ReactElement;
@@ -228,7 +228,7 @@ declare const _default: {
228
228
  "components.poolApyBreakdownCard.incentiveApy": "Incentive APY",
229
229
  "components.poolApyBreakdownCard.incentiveApy7d": "Incentive APY (7d)",
230
230
  "components.strategyApyBreakdownCard.formula": "{leverage} × {base}",
231
- "components.strategyApyBreakdownCard.borrowFormula": "{debtMultiplier} × {borrowBase} + {quotaMultiplier} × {quotaBase}",
231
+ "components.strategyApyBreakdownCard.borrowFormula": "{leverage} × ({borrowRate} + {quotaRate}) {borrowRate}",
232
232
 
233
233
  "components.leveragePresetChips.label": "Leverage:",
234
234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "4.0.0-next.32",
3
+ "version": "4.0.0-next.33",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",