diff --git a/frontend/app/src/app/leverage/[collateral]/page.tsx b/frontend/app/src/app/multiply/[collateral]/page.tsx similarity index 100% rename from frontend/app/src/app/leverage/[collateral]/page.tsx rename to frontend/app/src/app/multiply/[collateral]/page.tsx diff --git a/frontend/app/src/app/leverage/layout.tsx b/frontend/app/src/app/multiply/layout.tsx similarity index 100% rename from frontend/app/src/app/leverage/layout.tsx rename to frontend/app/src/app/multiply/layout.tsx diff --git a/frontend/app/src/app/leverage/page.tsx b/frontend/app/src/app/multiply/page.tsx similarity index 100% rename from frontend/app/src/app/leverage/page.tsx rename to frontend/app/src/app/multiply/page.tsx diff --git a/frontend/app/src/comps/ActionCard/ActionCard.tsx b/frontend/app/src/comps/ActionCard/ActionCard.tsx index c10599b12..e99732c5f 100644 --- a/frontend/app/src/comps/ActionCard/ActionCard.tsx +++ b/frontend/app/src/comps/ActionCard/ActionCard.tsx @@ -10,7 +10,7 @@ import { ActionIcon } from "./ActionIcon"; export function ActionCard({ type, }: { - type: "borrow" | "leverage" | "earn" | "stake"; + type: "borrow" | "multiply" | "earn" | "stake"; }) { const [hint, setHint] = useState(false); const [active, setActive] = useState(false); @@ -44,15 +44,15 @@ export function ActionCard({ path: "/borrow", title: ac.borrow.title, })) - .with("leverage", () => ({ + .with("multiply", () => ({ colors: { background: token("colors.brandGreen"), foreground: token("colors.brandGreenContent"), foregroundAlt: token("colors.brandGreenContentAlt"), }, - description: ac.leverage.description, - path: "/leverage", - title: ac.leverage.title, + description: ac.multiply.description, + path: "/multiply", + title: ac.multiply.title, })) .with("earn", () => ({ colors: { diff --git a/frontend/app/src/comps/ActionCard/ActionIcon.tsx b/frontend/app/src/comps/ActionCard/ActionIcon.tsx index 101259b82..bb7c699cf 100644 --- a/frontend/app/src/comps/ActionCard/ActionIcon.tsx +++ b/frontend/app/src/comps/ActionCard/ActionIcon.tsx @@ -24,12 +24,12 @@ export function ActionIcon({ background: string; foreground: string; }; - iconType: "borrow" | "leverage" | "earn" | "stake"; + iconType: "borrow" | "multiply" | "earn" | "stake"; state: IconProps["state"]; }) { const Icon = match(iconType) .with("borrow", () => ActionIconBorrow) - .with("leverage", () => ActionIconLeverage) + .with("multiply", () => ActionIconLeverage) .with("earn", () => ActionIconEarn) .with("stake", () => ActionIconStake) .exhaustive(); diff --git a/frontend/app/src/comps/LeverageField/LeverageField.tsx b/frontend/app/src/comps/LeverageField/LeverageField.tsx index 23e9ec781..18d5ad94e 100644 --- a/frontend/app/src/comps/LeverageField/LeverageField.tsx +++ b/frontend/app/src/comps/LeverageField/LeverageField.tsx @@ -115,7 +115,7 @@ export function LeverageField({ ), end: ( - Leverage { + Multiply { -
Leverage loan
+
Multiply position
{statusTag} , ]} diff --git a/frontend/app/src/comps/Positions/PositionCardLoan.tsx b/frontend/app/src/comps/Positions/PositionCardLoan.tsx index 40da21afe..cc1bd464c 100644 --- a/frontend/app/src/comps/Positions/PositionCardLoan.tsx +++ b/frontend/app/src/comps/Positions/PositionCardLoan.tsx @@ -29,7 +29,7 @@ export function PositionCardLoan( const prefixedTroveId = getPrefixedTroveId(props.collIndex, props.troveId); const loanMode = storedState.loanModes[prefixedTroveId] ?? props.type; - const Card = loanMode === "leverage" ? PositionCardLeverage : PositionCardBorrow; + const Card = loanMode === "multiply" ? PositionCardLeverage : PositionCardBorrow; return ( ( match(position) .returnType<[number, ReactNode]>() - .with({ type: P.union("borrow", "leverage") }, (p) => [ + .with({ type: P.union("borrow", "multiply") }, (p) => [ index, , ]) @@ -145,7 +145,7 @@ function PositionsGroup({ showNewPositionCard ? [ [0, ], - [1, ], + [1, ], [2, ], [3, ], ] diff --git a/frontend/app/src/comps/TopBar/TopBar.tsx b/frontend/app/src/comps/TopBar/TopBar.tsx index 4ca491ec1..0fe1c357f 100644 --- a/frontend/app/src/comps/TopBar/TopBar.tsx +++ b/frontend/app/src/comps/TopBar/TopBar.tsx @@ -15,7 +15,7 @@ import { Menu } from "./Menu"; const menuItems: ComponentProps["menuItems"] = [ [content.menu.dashboard, "/", IconDashboard], [content.menu.borrow, "/borrow", IconBorrow], - [content.menu.leverage, "/leverage", IconLeverage], + [content.menu.multiply, "/multiply", IconLeverage], [content.menu.earn, "/earn", IconEarn], [content.menu.stake, "/stake", IconStake], ]; diff --git a/frontend/app/src/constants.ts b/frontend/app/src/constants.ts index 4d5c201b4..72689fa15 100644 --- a/frontend/app/src/constants.ts +++ b/frontend/app/src/constants.ts @@ -43,9 +43,9 @@ export const MAX_COLLATERAL_DEPOSITS: Record = { RETH: dn.from(100_000_000n, 18), }; -// LTV factor suggestions, as ratios of the leverage factor range +// LTV factor suggestions, as ratios of the multiply factor range export const LEVERAGE_FACTOR_SUGGESTIONS = [ - norm(1.5, 1.1, 11), // 1.5x leverage with a 1.1x => 11x range + norm(1.5, 1.1, 11), // 1.5x multiply with a 1.1x => 11x range norm(2.5, 1.1, 11), norm(5, 1.1, 11), ]; diff --git a/frontend/app/src/content.tsx b/frontend/app/src/content.tsx index 3410de1d7..927433e47 100644 --- a/frontend/app/src/content.tsx +++ b/frontend/app/src/content.tsx @@ -11,7 +11,7 @@ export default { menu: { dashboard: "Dashboard", borrow: "Borrow", - leverage: "Leverage", + multiply: "Multiply", earn: "Earn", stake: "Stake", }, @@ -194,8 +194,8 @@ export default { title: "Borrow BOLD", description: "Set your own interest rate and borrow BOLD against ETH and staked ETH.", }, - leverage: { - title: "Leverage ETH", + multiply: { + title: "Multiply ETH", description: "Set your own interest rate and increase your exposure to ETH and staked ETH.", }, earn: { @@ -256,11 +256,11 @@ export default { }, }, - // Leverage screen + // Multiply screen leverageScreen: { headline: (tokensIcons: N) => ( <> - Leverage your exposure to {tokensIcons} + Multiply your exposure to {tokensIcons} ), depositField: { @@ -275,7 +275,7 @@ export default { action: "Next: Summary", infoTooltips: { leverageLevel: [ - "Leverage level", + "Multiply level", <> Choose the amplification of your exposure. Note that a higher level means higher liquidation risk. You are responsible for your own assessment of what a suitable level is. diff --git a/frontend/app/src/demo-mode/demo-data.ts b/frontend/app/src/demo-mode/demo-data.ts index b8e0621b0..e08b5e23b 100644 --- a/frontend/app/src/demo-mode/demo-data.ts +++ b/frontend/app/src/demo-mode/demo-data.ts @@ -44,7 +44,7 @@ export const ACCOUNT_POSITIONS: Exclude[] = [ updatedAt: getTime(), }, { - type: "leverage", + type: "multiply", status: "active", borrowed: dn.from(28_934.23, 18), borrower: DEMO_ACCOUNT, diff --git a/frontend/app/src/liquity-leverage.ts b/frontend/app/src/liquity-leverage.ts index 493c83a88..e22b578d0 100644 --- a/frontend/app/src/liquity-leverage.ts +++ b/frontend/app/src/liquity-leverage.ts @@ -58,7 +58,7 @@ export async function getLeverUpTroveParams( const leverageRatio = BigInt(leverageFactor * 1000) * DECIMAL_PRECISION / 1000n; if (leverageRatio <= currentLR) { - throw new Error(`Leverage ratio should increase: ${leverageRatio} <= ${currentLR}`); + throw new Error(`Multiply ratio should increase: ${leverageRatio} <= ${currentLR}`); } const currentCollAmount = troveData.entireColl; @@ -117,7 +117,7 @@ export async function getLeverDownTroveParams( const leverageRatio = BigInt(leverageFactor * 1000) * DECIMAL_PRECISION / 1000n; if (leverageRatio >= currentLR) { - throw new Error(`Leverage ratio should decrease: ${leverageRatio} >= ${currentLR}`); + throw new Error(`Multiply ratio should decrease: ${leverageRatio} >= ${currentLR}`); } const currentCollAmount = troveData.entireColl; diff --git a/frontend/app/src/screens/HomeScreen/HomeScreen.tsx b/frontend/app/src/screens/HomeScreen/HomeScreen.tsx index 9fd95795a..44bb22c3a 100644 --- a/frontend/app/src/screens/HomeScreen/HomeScreen.tsx +++ b/frontend/app/src/screens/HomeScreen/HomeScreen.tsx @@ -138,7 +138,7 @@ function BorrowingRow({ /> @@ -152,7 +152,7 @@ function BorrowingRow({ fontSize: 14, })} > - Leverage + Multiply } diff --git a/frontend/app/src/screens/LeverageScreen/LeverageScreen.tsx b/frontend/app/src/screens/LeverageScreen/LeverageScreen.tsx index d4042e0ab..4eff0f6c3 100644 --- a/frontend/app/src/screens/LeverageScreen/LeverageScreen.tsx +++ b/frontend/app/src/screens/LeverageScreen/LeverageScreen.tsx @@ -125,7 +125,7 @@ export function LeverageScreen() { ); const newLoan: PositionLoanUncommitted = { - type: "leverage", + type: "multiply", status: "active", batchManager: interestRateDelegate, borrowed: leverageField.debt ?? dn.from(0, 18), diff --git a/frontend/app/src/screens/LoanScreen/LoanScreen.tsx b/frontend/app/src/screens/LoanScreen/LoanScreen.tsx index a40714aae..9027dd148 100644 --- a/frontend/app/src/screens/LoanScreen/LoanScreen.tsx +++ b/frontend/app/src/screens/LoanScreen/LoanScreen.tsx @@ -117,7 +117,7 @@ export function LoanScreen() { return { loanModes: { ...loanModes, - [paramPrefixedId]: loanMode === "borrow" ? "leverage" : "borrow", + [paramPrefixedId]: loanMode === "borrow" ? "multiply" : "borrow", }, }; }); @@ -195,7 +195,7 @@ export function LoanScreen() { }} /> {action === "colldebt" && ( - loanMode === "leverage" + loanMode === "multiply" ? : )} diff --git a/frontend/app/src/screens/LoanScreen/LoanScreenCard.tsx b/frontend/app/src/screens/LoanScreen/LoanScreenCard.tsx index 84cd1d6c5..dc34cd3b0 100644 --- a/frontend/app/src/screens/LoanScreen/LoanScreenCard.tsx +++ b/frontend/app/src/screens/LoanScreen/LoanScreenCard.tsx @@ -37,7 +37,7 @@ import * as dn from "dnum"; import Image from "next/image"; import { match, P } from "ts-pattern"; -type LoanMode = "borrow" | "leverage"; +type LoanMode = "borrow" | "multiply"; export function LoanScreenCard({ collateral, @@ -84,7 +84,7 @@ export function LoanScreenCard({ ); const nftUrl = useTroveNftUrl(loan?.collIndex ?? null, troveId); - const title = mode === "leverage" ? "Leverage loan" : "BOLD loan"; + const title = mode === "multiply" ? "Multiply" : "BOLD loan"; const fullyRedeemed = loan && loan.status === "redeemed" && dn.eq(loan.borrowed, 0); @@ -257,7 +257,7 @@ function LoanCardHeading({ color: inheritColor ? "inherit" : "var(--color-alt)", }} > - {mode === "leverage" + {mode === "multiply" ? : } @@ -397,7 +397,7 @@ function LoanCard({ troveId, nftUrl, }) => { - const title = mode === "leverage" ? "Leverage loan" : "BOLD loan"; + const title = mode === "multiply" ? "Multiply" : "BOLD loan"; return ( - {mode === "leverage" + {mode === "multiply" ? : } ), - label: mode === "leverage" + label: mode === "multiply" ? "Convert to BOLD loan" - : "Convert to leverage loan", + : "Convert to Multiply position", }, { icon: ( @@ -577,7 +577,7 @@ function LoanCard({ selected={0} onSelect={(index) => { if (index === 0) { - onLeverageModeChange(mode === "leverage" ? "borrow" : "leverage"); + onLeverageModeChange(mode === "multiply" ? "borrow" : "multiply"); } if (index === 1) { navigator.clipboard.writeText(window.location.href); @@ -608,7 +608,7 @@ function LoanCard({ gap: 12, })} > - {mode === "leverage" + {mode === "multiply" ? (
- {mode === "leverage" ? "Total exposure" : "Total debt"} + {mode === "multiply" ? "Total exposure" : "Total debt"}
@@ -681,7 +681,7 @@ function LoanCard({ gap: 12, })} > - + {fmtnum(loan.deposit)} {collateral.name} @@ -704,7 +704,7 @@ function LoanCard({ gap: 12, })} > - N/A + N/A N/A N/A N/A @@ -730,7 +730,7 @@ function LoanCard({ gap: 12, })} > - {mode === "leverage" + {mode === "multiply" ? ( , + start: , end: ( void; txPreviewMode?: boolean; }) { - const title = leverage ? "Leverage loan" : "BOLD loan"; + const title = leverage ? "Multiply" : "BOLD loan"; const spring = useSpring({ to: match(loadingState) diff --git a/frontend/app/src/services/StoredState.tsx b/frontend/app/src/services/StoredState.tsx index aae1fb282..c0ff86199 100644 --- a/frontend/app/src/services/StoredState.tsx +++ b/frontend/app/src/services/StoredState.tsx @@ -14,7 +14,7 @@ export const StoredStateSchema = v.object({ vPrefixedTroveId(), v.union([ v.literal("borrow"), - v.literal("leverage"), + v.literal("multiply"), ]), ), }); diff --git a/frontend/app/src/subgraph-hooks.ts b/frontend/app/src/subgraph-hooks.ts index d8c6945b1..d215ebfe9 100644 --- a/frontend/app/src/subgraph-hooks.ts +++ b/frontend/app/src/subgraph-hooks.ts @@ -419,7 +419,7 @@ function subgraphTroveToLoan( } return { - type: trove.mightBeLeveraged ? "leverage" : "borrow", + type: trove.mightBeLeveraged ? "multiply" : "borrow", batchManager: isAddress(trove.interestBatch?.batchManager) ? trove.interestBatch.batchManager : null, diff --git a/frontend/app/src/tx-flows/openLeveragePosition.tsx b/frontend/app/src/tx-flows/openLeveragePosition.tsx index 52c95da13..e2d8b5a19 100644 --- a/frontend/app/src/tx-flows/openLeveragePosition.tsx +++ b/frontend/app/src/tx-flows/openLeveragePosition.tsx @@ -205,7 +205,7 @@ export const openLeveragePosition: FlowDeclaration = { if (stepId === "approveLst") { return `Approve ${collateral.name ?? ""}`; } - return "Open Leveraged Position"; + return "Open Multiply Position"; }, parseRequest(request) { diff --git a/frontend/app/src/tx-flows/updateLeveragePosition.tsx b/frontend/app/src/tx-flows/updateLeveragePosition.tsx index 52676dcc0..a52472b55 100644 --- a/frontend/app/src/tx-flows/updateLeveragePosition.tsx +++ b/frontend/app/src/tx-flows/updateLeveragePosition.tsx @@ -39,12 +39,12 @@ const RequestSchema = v.object({ // set to null to indicate no deposit change depositChange: v.union([v.null(), vDnum()]), - // set to null to indicate no leverage change + // set to null to indicate no multiply change leverageFactorChange: v.union([ v.null(), v.tuple([ - v.number(), // prev leverage - v.number(), // new leverage + v.number(), // prev multiply + v.number(), // new multiply ]), ]), @@ -65,8 +65,8 @@ const stepNames: Record = { approveLst: "Approve {tokenName}", decreaseDeposit: "Decrease Deposit", increaseDeposit: "Increase Deposit", - leverDownTrove: "Decrease Leverage", - leverUpTrove: "Increase Leverage", + leverDownTrove: "Decrease Multiplier", + leverUpTrove: "Increase Multiplier", }; export const updateLeveragePosition: FlowDeclaration = { @@ -152,7 +152,7 @@ export const updateLeveragePosition: FlowDeclaration = { )} {leverageFactorChange && ( {fmtnum(leverageFactorChange[1] - leverageFactorChange[0], { @@ -161,7 +161,7 @@ export const updateLeveragePosition: FlowDeclaration = { })}x ,
- {fmtnum(leverageFactorChange[1], 2)}x leverage + {fmtnum(leverageFactorChange[1], 2)}x multiply
, ]} /> diff --git a/frontend/app/src/types.ts b/frontend/app/src/types.ts index df4936e43..feb2a3d18 100644 --- a/frontend/app/src/types.ts +++ b/frontend/app/src/types.ts @@ -40,10 +40,10 @@ export type MenuSection = { }; export type PositionLoanBase = { - // TODO: rename the type to "loan" and move "borrow" | "leverage" to + // TODO: rename the type to "loan" and move "borrow" | "multiply" to // a "mode" field. The two separate types come from a previous design // where the two types of positions were having separate types. - type: "borrow" | "leverage"; + type: "borrow" | "multiply"; batchManager: null | Address; borrowed: Dnum; borrower: Address; @@ -70,7 +70,7 @@ export type PositionLoanUncommitted = PositionLoanBase & { export type PositionLoan = PositionLoanCommitted | PositionLoanUncommitted; export function isPositionLoan(position: Position): position is PositionLoan { - return position.type === "borrow" || position.type === "leverage"; + return position.type === "borrow" || position.type === "multiply"; } export function isPositionLoanCommitted( position: Position, diff --git a/frontend/app/src/valibot-utils.ts b/frontend/app/src/valibot-utils.ts index 206116e36..2e731791e 100644 --- a/frontend/app/src/valibot-utils.ts +++ b/frontend/app/src/valibot-utils.ts @@ -151,7 +151,7 @@ export function vPositionStake() { const VPositionLoanBase = v.object({ type: v.union([ v.literal("borrow"), - v.literal("leverage"), + v.literal("multiply"), ]), batchManager: v.union([v.null(), vAddress()]), borrowed: vDnum(), diff --git a/frontend/uikit-gallery/src/InputField/shared.tsx b/frontend/uikit-gallery/src/InputField/shared.tsx index 46e121983..5b5e7b34b 100644 --- a/frontend/uikit-gallery/src/InputField/shared.tsx +++ b/frontend/uikit-gallery/src/InputField/shared.tsx @@ -49,7 +49,7 @@ export function InputFieldFixture({ const labelEnd = match(fixture) .with("slider", () => ( - Leverage{" "} + Multiply{" "} 4 ? "#F36740" : "#2F3037",