@gearbox-protocol/ui-kit 4.0.0-next.31 → 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.
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +104 -67
- package/dist/esm/components/graph/graph.js +169 -161
- package/dist/esm/locale/en.json.js +1 -1
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +18 -23
- package/dist/types/locale/en.json.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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": "{
|
|
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",
|
package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
|
40
|
-
*
|
|
41
|
-
*
|
|
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": "{
|
|
231
|
+
"components.strategyApyBreakdownCard.borrowFormula": "{leverage} × ({borrowRate} + {quotaRate}) − {borrowRate}",
|
|
232
232
|
|
|
233
233
|
"components.leveragePresetChips.label": "Leverage:",
|
|
234
234
|
|