@gearbox-protocol/ui-kit 4.0.0-next.16 → 4.0.0-next.18
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/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/position-assets/constants.cjs +1 -0
- package/dist/cjs/components/base/position-assets/index.cjs +1 -0
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -0
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/strategy-apy.cjs +1 -1
- package/dist/esm/components/base/index.js +112 -108
- package/dist/esm/components/base/info-list/info-list.js +7 -6
- package/dist/esm/components/base/position-assets/constants.js +8 -0
- package/dist/esm/components/base/position-assets/index.js +6 -0
- package/dist/esm/components/base/position-assets/position-assets.js +73 -0
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +121 -116
- package/dist/esm/components/base/values/scalars.js +52 -33
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/compound-apy/compound-apy.js +2 -2
- package/dist/esm/components/index.js +662 -658
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +20 -21
- package/dist/esm/index.js +851 -848
- package/dist/esm/utils/index.js +29 -30
- package/dist/esm/utils/strategy-apy.js +41 -31
- package/dist/types/components/base/index.d.ts +1 -0
- package/dist/types/components/base/position-assets/constants.d.ts +5 -0
- package/dist/types/components/base/position-assets/index.d.ts +2 -0
- package/dist/types/components/base/position-assets/position-assets.d.ts +49 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +7 -13
- package/dist/types/components/base/values/scalars.d.ts +4 -0
- package/dist/types/components/compound-apy/compound-apy.d.ts +2 -2
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +3 -3
- package/dist/types/utils/strategy-apy.d.ts +21 -18
- package/package.json +2 -2
package/dist/esm/utils/index.js
CHANGED
|
@@ -8,9 +8,9 @@ import { generateColorsFromBase as h, getCSSVariable as A, hexToRgba as v, hslTo
|
|
|
8
8
|
import { copyToClipboard as N } from "./copy.js";
|
|
9
9
|
import { convertPercent as I, formatBytecodeSize as k, formatBytecodeVersion as C, formatTimestamp as w, shortenHash as F, significantTrunc as D } from "./format.js";
|
|
10
10
|
import { formatAssetAmount as V } from "./format-asset-amount.js";
|
|
11
|
-
import { formatLeverage as
|
|
11
|
+
import { formatLeverage as M } from "./format-leverage.js";
|
|
12
12
|
import { formatCompactPercent as _, formatMoney as E, formatMoneyAmount as H, formatPercentAmount as W, percentTemplate as Z, percentageTemplate as z } from "./format-money.js";
|
|
13
|
-
import { FORMAT_CONSTANTS as X, formatNumberWithSuffix as q, formatPrice as
|
|
13
|
+
import { FORMAT_CONSTANTS as X, formatNumberWithSuffix as q, formatPrice as j, getAdaptiveDecimals as G, isBelowDisplayThreshold as J, isEffectivelyZero as K, toSignificantDigits as Q } from "./format-number.js";
|
|
14
14
|
import { slippageTemplate as $ } from "./format-slippage.js";
|
|
15
15
|
import { formatChipLeverage as oe, leveragePresets as re } from "./leverage-presets.js";
|
|
16
16
|
import { allLoaded as ae, loadingProgress as me, round5 as ne } from "./loading.js";
|
|
@@ -22,19 +22,19 @@ import { getAvailableRanges as Ne } from "./ranges.js";
|
|
|
22
22
|
import { extractTextFromLabel as Ie, serializeValue as ke } from "./react.js";
|
|
23
23
|
import { searchInString as we } from "./search.js";
|
|
24
24
|
import { createTokenSearchFilter as De, searchInToken as Oe } from "./search-in-token.js";
|
|
25
|
-
import { shortSHA as
|
|
26
|
-
import { isLongString as
|
|
27
|
-
import { strategyApyPartsAtLeverage as He, strategyNetApyAtLeverage as We
|
|
28
|
-
import { negativeTokenTemplate as
|
|
25
|
+
import { shortSHA as Be } from "./short-sha.js";
|
|
26
|
+
import { isLongString as Re, shortenString as _e } from "./shorten-string.js";
|
|
27
|
+
import { strategyApyPartsAtLeverage as He, strategyNetApyAtLeverage as We } from "./strategy-apy.js";
|
|
28
|
+
import { negativeTokenTemplate as ze, tokenTemplate as Ue, tokenTemplateNumber as Xe, tokenTemplateString as qe } from "./templates.js";
|
|
29
29
|
import { getTokenIcon as Ge, parseShareTokenUnderlying as Je } from "./token-icon-source.js";
|
|
30
|
-
import { TTL_CONSTANTS as
|
|
31
|
-
import { openInNewWindow as
|
|
32
|
-
import { Z_INDEX as
|
|
30
|
+
import { TTL_CONSTANTS as Qe, getTTLZones as Ye, ttlFromTimestamp as $e, ttlLeft as eo, ttlLeftHuman as oo } from "./ttl.js";
|
|
31
|
+
import { openInNewWindow as to } from "./window.js";
|
|
32
|
+
import { Z_INDEX as mo, Z_INDEX_VALUES as no } from "./z-index.js";
|
|
33
33
|
export {
|
|
34
34
|
X as FORMAT_CONSTANTS,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Qe as TTL_CONSTANTS,
|
|
36
|
+
mo as Z_INDEX,
|
|
37
|
+
no as Z_INDEX_VALUES,
|
|
38
38
|
ae as allLoaded,
|
|
39
39
|
s as bnToInputView,
|
|
40
40
|
de as bnToLiquidationPriceView,
|
|
@@ -53,33 +53,33 @@ export {
|
|
|
53
53
|
C as formatBytecodeVersion,
|
|
54
54
|
oe as formatChipLeverage,
|
|
55
55
|
_ as formatCompactPercent,
|
|
56
|
-
|
|
56
|
+
M as formatLeverage,
|
|
57
57
|
E as formatMoney,
|
|
58
58
|
H as formatMoneyAmount,
|
|
59
59
|
q as formatNumberWithSuffix,
|
|
60
60
|
W as formatPercentAmount,
|
|
61
|
-
|
|
61
|
+
j as formatPrice,
|
|
62
62
|
w as formatTimestamp,
|
|
63
63
|
se as formatWithDecimals,
|
|
64
64
|
le as formatWithoutDecimals,
|
|
65
65
|
h as generateColorsFromBase,
|
|
66
66
|
r as generateId,
|
|
67
|
-
|
|
67
|
+
G as getAdaptiveDecimals,
|
|
68
68
|
Ne as getAvailableRanges,
|
|
69
69
|
A as getCSSVariable,
|
|
70
70
|
ce as getNetworkIcon,
|
|
71
|
-
|
|
71
|
+
Ye as getTTLZones,
|
|
72
72
|
Ge as getTokenIcon,
|
|
73
73
|
v as hexToRgba,
|
|
74
74
|
y as hslToHex,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
J as isBelowDisplayThreshold,
|
|
76
|
+
K as isEffectivelyZero,
|
|
77
|
+
Re as isLongString,
|
|
78
78
|
ue as isPositiveFloat,
|
|
79
79
|
re as leveragePresets,
|
|
80
80
|
me as loadingProgress,
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
ze as negativeTokenTemplate,
|
|
82
|
+
to as openInNewWindow,
|
|
83
83
|
he as parseInputToBN,
|
|
84
84
|
Je as parseShareTokenUnderlying,
|
|
85
85
|
Ae as parseSmallNumber,
|
|
@@ -94,7 +94,7 @@ export {
|
|
|
94
94
|
Oe as searchInToken,
|
|
95
95
|
Pe as selectPluralString,
|
|
96
96
|
ke as serializeValue,
|
|
97
|
-
|
|
97
|
+
Be as shortSHA,
|
|
98
98
|
F as shortenHash,
|
|
99
99
|
_e as shortenString,
|
|
100
100
|
D as significantTrunc,
|
|
@@ -102,16 +102,15 @@ export {
|
|
|
102
102
|
xe as splitInterval,
|
|
103
103
|
He as strategyApyPartsAtLeverage,
|
|
104
104
|
We as strategyNetApyAtLeverage,
|
|
105
|
-
|
|
106
|
-
K as toSignificantDigits,
|
|
105
|
+
Q as toSignificantDigits,
|
|
107
106
|
p as tokenRewardsOf,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
Ue as tokenTemplate,
|
|
108
|
+
Xe as tokenTemplateNumber,
|
|
109
|
+
qe as tokenTemplateString,
|
|
111
110
|
i as totalApyOf,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
$e as ttlFromTimestamp,
|
|
112
|
+
eo as ttlLeft,
|
|
113
|
+
oo as ttlLeftHuman,
|
|
115
114
|
t as useFormFieldIds,
|
|
116
115
|
Te as validateMinMax
|
|
117
116
|
};
|
|
@@ -1,41 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { calcEffectiveBorrowApy as o, calcNetStrategyApy as u } from "@gearbox-protocol/sdk";
|
|
2
|
+
function f(t, e, r) {
|
|
3
|
+
switch (r) {
|
|
4
|
+
case "min":
|
|
5
|
+
return Math.max(t - 1, 0);
|
|
6
|
+
case "aggressive":
|
|
7
|
+
return 1.05 * Math.max(t - 1, 0);
|
|
8
|
+
default:
|
|
9
|
+
return t * e / 1e4;
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
function
|
|
8
|
-
leverage:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
function m({
|
|
13
|
+
leverage: t,
|
|
14
|
+
borrowApy: e = 0,
|
|
15
|
+
quotaRate: r = 0,
|
|
16
|
+
liquidationThreshold: s = 0,
|
|
17
|
+
quotaMode: a = "safe"
|
|
12
18
|
}) {
|
|
13
|
-
const
|
|
19
|
+
const c = {
|
|
20
|
+
borrowApy: e,
|
|
21
|
+
quotaRate: r,
|
|
22
|
+
liquidationThreshold: s
|
|
23
|
+
}, n = Math.max(t - 1, 0), i = f(t, s, a);
|
|
14
24
|
return {
|
|
15
25
|
debtMultiplier: n,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
quotaMultiplier: i,
|
|
27
|
+
borrowCost: e * n,
|
|
28
|
+
quotaRate: r,
|
|
29
|
+
quotaCost: r * i,
|
|
30
|
+
totalCost: o(c, t, a)
|
|
20
31
|
};
|
|
21
32
|
}
|
|
22
|
-
function
|
|
23
|
-
collateralApy:
|
|
24
|
-
leverage:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
function l({
|
|
34
|
+
collateralApy: t,
|
|
35
|
+
leverage: e,
|
|
36
|
+
borrowApy: r = 0,
|
|
37
|
+
quotaRate: s = 0,
|
|
38
|
+
liquidationThreshold: a = 0,
|
|
39
|
+
quotaMode: c = "safe"
|
|
28
40
|
}) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return o * t - s;
|
|
41
|
+
return u(
|
|
42
|
+
{ borrowApy: r, quotaRate: s, liquidationThreshold: a },
|
|
43
|
+
t,
|
|
44
|
+
e,
|
|
45
|
+
c
|
|
46
|
+
);
|
|
36
47
|
}
|
|
37
48
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
e as strategyQuotaRate
|
|
49
|
+
m as strategyApyPartsAtLeverage,
|
|
50
|
+
l as strategyNetApyAtLeverage
|
|
41
51
|
};
|
|
@@ -16,6 +16,7 @@ export * from './more-accordion';
|
|
|
16
16
|
export * from './nested-info-stack';
|
|
17
17
|
export * from './page-title';
|
|
18
18
|
export * from './pool-apy-breakdown-card';
|
|
19
|
+
export * from './position-assets';
|
|
19
20
|
export * from './review-button';
|
|
20
21
|
export * from './section-heading';
|
|
21
22
|
export * from './segmented-tabs';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TokenAmount } from '@gearbox-protocol/sdk/model';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { PositionAssetsTest } from './constants';
|
|
4
|
+
export { PositionAssetsTest };
|
|
5
|
+
export interface PositionAssetsProps {
|
|
6
|
+
/** What this side holds. */
|
|
7
|
+
readonly assets?: readonly TokenAmount[];
|
|
8
|
+
/**
|
|
9
|
+
* The list this one is shown against — the other slot of the same row.
|
|
10
|
+
* Never rendered: it only joins the row set and the order, so two lists in
|
|
11
|
+
* `value` and `valueTo` list the same tokens in the same order and their
|
|
12
|
+
* rows line up. Pass each side the other one.
|
|
13
|
+
*/
|
|
14
|
+
readonly against?: readonly TokenAmount[];
|
|
15
|
+
/** Rendered in place of the rows when nothing survives the dust filter. */
|
|
16
|
+
readonly empty?: React.ReactNode;
|
|
17
|
+
readonly testId?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Holdings token by token, most valuable first — the position itself rather
|
|
21
|
+
* than the one number its collateral adds up to. A right-aligned column, so it
|
|
22
|
+
* reads as the value of the `InfoLine` a caller drops it into, in either slot.
|
|
23
|
+
*
|
|
24
|
+
* The rows carry no label of their own, which is why they are not `InfoLine`s:
|
|
25
|
+
* `VerticalIndicator` leaves out its left column entirely when no label is
|
|
26
|
+
* given and never justifies what remains, so a label-less row would sit on the
|
|
27
|
+
* wrong side.
|
|
28
|
+
*
|
|
29
|
+
* Dust is left out: an account carries stray fractions of a cent from
|
|
30
|
+
* rounding, and listing them buries the holdings that matter. A token the
|
|
31
|
+
* oracle cannot price is never dust — an unknown value is not a small one.
|
|
32
|
+
*/
|
|
33
|
+
export declare function PositionAssets({ assets, against, empty, testId, }: PositionAssetsProps): React.ReactElement;
|
|
34
|
+
/** One token as a side lists it. */
|
|
35
|
+
export interface AssetRow {
|
|
36
|
+
readonly token: TokenAmount["token"];
|
|
37
|
+
/** What this side holds — zero for a token only the other side has. */
|
|
38
|
+
readonly value: bigint;
|
|
39
|
+
/**
|
|
40
|
+
* What the token is worth at its richer side, which is what decides both
|
|
41
|
+
* dust and order. `null` when a side the oracle cannot price is involved.
|
|
42
|
+
*/
|
|
43
|
+
readonly worth: number | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* What earns a row, most valuable first — decided across both sides, so the
|
|
47
|
+
* order is a property of the pair rather than of the side that renders it.
|
|
48
|
+
*/
|
|
49
|
+
export declare function visibleAssets(assets: readonly TokenAmount[] | undefined, against?: readonly TokenAmount[]): AssetRow[];
|
package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { ApyBreakdown,
|
|
1
|
+
import { ApyBreakdown, Leverage } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
+
import { StrategyApyRates } from '../../../utils/strategy-apy';
|
|
3
4
|
import { StrategyApyBreakdownCardTest } from './constants';
|
|
4
5
|
export { StrategyApyBreakdownCardTest };
|
|
5
|
-
export interface StrategyApyBreakdownData {
|
|
6
|
+
export interface StrategyApyBreakdownData extends StrategyApyRates {
|
|
6
7
|
readonly collateralApy?: ApyBreakdown;
|
|
7
|
-
|
|
8
|
-
readonly additionalBorrowApy?: Bps;
|
|
8
|
+
/** Leverage the card falls back to when the toolbar names none. */
|
|
9
9
|
readonly maxLeverage?: Leverage;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
readonly maxLeverageApy?: ApyBreakdown;
|
|
16
|
-
/**
|
|
17
|
-
* SDK net at the displayed {@link StrategyApyBreakdownCardProps.leverage}
|
|
18
|
-
* (e.g. a position's `netApy`). Preferred over both `maxLeverageApy` and
|
|
19
|
-
* the reconstructed formula.
|
|
11
|
+
* Net rate the caller already knows — a position's own `netApy`. Preferred
|
|
12
|
+
* over the rows' arithmetic, which answers for the strategy rather than for
|
|
13
|
+
* one account inside it.
|
|
20
14
|
*/
|
|
21
15
|
readonly netApy?: ApyBreakdown;
|
|
22
16
|
}
|
|
@@ -36,6 +36,10 @@ export declare function HealthFactorValue({ data, }: {
|
|
|
36
36
|
* A bare `bigint` in token units (simulate previews carry these): the only
|
|
37
37
|
* value component that needs a denomination passed with it, because the SDK
|
|
38
38
|
* hands these out without one.
|
|
39
|
+
*
|
|
40
|
+
* Shown to `formatAssetAmount`'s three decimals, with the exact amount in a
|
|
41
|
+
* tooltip — a metrics row reads better short, and nothing is lost: the figure
|
|
42
|
+
* behind the rounding stays a hover away.
|
|
39
43
|
*/
|
|
40
44
|
export declare function TokenBigint({ data, token, }: {
|
|
41
45
|
readonly data: bigint | undefined;
|
|
@@ -17,7 +17,7 @@ export interface CompoundAPYProps {
|
|
|
17
17
|
/** Strategy base borrow cost in bps. */
|
|
18
18
|
borrowApy?: Bps;
|
|
19
19
|
/** Strategy additional (quota) borrow cost in bps. */
|
|
20
|
-
|
|
20
|
+
quotaRate?: Bps;
|
|
21
21
|
/**
|
|
22
22
|
* Number of decimal places for the total APY string.
|
|
23
23
|
* @default 2
|
|
@@ -31,4 +31,4 @@ export interface CompoundAPYProps {
|
|
|
31
31
|
* No `tokensList`, no external APY, no 7D history, no "soon" points state.
|
|
32
32
|
* For the legacy percent-based API see {@link CompoundAPYLegacy}.
|
|
33
33
|
*/
|
|
34
|
-
export declare function CompoundAPY({ apy, maxLeverage, collateralApy, borrowApy,
|
|
34
|
+
export declare function CompoundAPY({ apy, maxLeverage, collateralApy, borrowApy, quotaRate, decimals, className, }: CompoundAPYProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,8 +18,8 @@ export interface YieldBreakdownTooltipProps {
|
|
|
18
18
|
collateralApy?: ApyBreakdown;
|
|
19
19
|
/** Strategy base borrow cost in bps (shown as a negative rate). */
|
|
20
20
|
borrowApy?: Bps;
|
|
21
|
-
/** Strategy
|
|
22
|
-
|
|
21
|
+
/** Strategy quota rate in bps, at 1x (folded into Borrow Rate). */
|
|
22
|
+
quotaRate?: Bps;
|
|
23
23
|
children?: React.ReactNode;
|
|
24
24
|
className?: string;
|
|
25
25
|
}
|
|
@@ -27,4 +27,4 @@ export interface YieldBreakdownTooltipProps {
|
|
|
27
27
|
* Earn APY tooltip — strategy (`Net APY at Nx Leverage`) and pool
|
|
28
28
|
* (`Overall APY`) layouts from SDK `ApyBreakdown`.
|
|
29
29
|
*/
|
|
30
|
-
export declare function YieldBreakdownTooltip({ supplyApy, maxLeverage, collateralApy, borrowApy,
|
|
30
|
+
export declare function YieldBreakdownTooltip({ supplyApy, maxLeverage, collateralApy, borrowApy, quotaRate, children, className, }: YieldBreakdownTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,37 +1,40 @@
|
|
|
1
|
+
import { QuotaMode, StrategyRateInputs } from '@gearbox-protocol/sdk';
|
|
1
2
|
import { Bps, Leverage } from '@gearbox-protocol/sdk/model';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
4
|
+
* The rates a strategy's cost of credit is made of — the SDK's own
|
|
5
|
+
* `StrategyRateInputs`, spelled the same way so a caller hands over the fields
|
|
6
|
+
* of a `StrategyOpportunity` rather than a translation of them.
|
|
7
|
+
*
|
|
8
|
+
* Optional only because a card may be rendered before its strategy has loaded;
|
|
9
|
+
* the SDK requires all three, and so does the arithmetic.
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
}
|
|
11
|
+
export type StrategyApyRates = Readonly<Partial<StrategyRateInputs>> & {
|
|
12
|
+
/** How much quota the position quotes; the SDK's `"safe"` unless told. */
|
|
13
|
+
readonly quotaMode?: QuotaMode;
|
|
14
|
+
};
|
|
10
15
|
/**
|
|
11
|
-
* Borrow
|
|
16
|
+
* Borrow and quota cost of a strategy at one leverage, split so each can have
|
|
17
|
+
* its own row.
|
|
12
18
|
*
|
|
13
|
-
* `
|
|
19
|
+
* `totalCost` comes from `calcEffectiveBorrowApy` rather than from adding the
|
|
20
|
+
* two parts up here: the SDK rounds once, at the end, and a card whose rows
|
|
21
|
+
* sum to something other than its own total is the bug this replaced.
|
|
14
22
|
*/
|
|
15
|
-
export declare function strategyApyPartsAtLeverage({ leverage,
|
|
23
|
+
export declare function strategyApyPartsAtLeverage({ leverage, borrowApy, quotaRate, liquidationThreshold, quotaMode, }: StrategyApyRates & {
|
|
16
24
|
readonly leverage: Leverage;
|
|
17
|
-
readonly maxLeverage?: Leverage;
|
|
18
|
-
readonly borrowApy?: Bps;
|
|
19
|
-
readonly additionalBorrowApy?: Bps;
|
|
20
25
|
}): {
|
|
21
26
|
readonly debtMultiplier: number;
|
|
27
|
+
readonly quotaMultiplier: number;
|
|
22
28
|
readonly borrowCost: Bps;
|
|
23
29
|
readonly quotaRate: Bps;
|
|
24
30
|
readonly quotaCost: Bps;
|
|
25
31
|
readonly totalCost: Bps;
|
|
26
32
|
};
|
|
27
33
|
/**
|
|
28
|
-
* Net strategy APY at leverage
|
|
29
|
-
*
|
|
34
|
+
* Net strategy APY at one leverage, straight from the SDK — the same call the
|
|
35
|
+
* app makes for the badge beside this card, so the two cannot disagree.
|
|
30
36
|
*/
|
|
31
|
-
export declare function strategyNetApyAtLeverage({ collateralApy, leverage,
|
|
37
|
+
export declare function strategyNetApyAtLeverage({ collateralApy, leverage, borrowApy, quotaRate, liquidationThreshold, quotaMode, }: StrategyApyRates & {
|
|
32
38
|
readonly collateralApy: Bps;
|
|
33
39
|
readonly leverage: Leverage;
|
|
34
|
-
readonly maxLeverage?: Leverage;
|
|
35
|
-
readonly borrowApy?: Bps;
|
|
36
|
-
readonly additionalBorrowApy?: Bps;
|
|
37
40
|
}): Bps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/ui-kit",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.18",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@commitlint/cli": "^20.1.0",
|
|
116
116
|
"@commitlint/config-conventional": "^20.0.0",
|
|
117
117
|
"@gearbox-protocol/biome-config": "^1.0.2",
|
|
118
|
-
"@gearbox-protocol/sdk": "
|
|
118
|
+
"@gearbox-protocol/sdk": "16.0.0-next.1",
|
|
119
119
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
120
120
|
"@storybook/addon-a11y": "^10.0.8",
|
|
121
121
|
"@storybook/addon-docs": "^10.0.8",
|