diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx
index 14c5f176b..7ee7367e8 100644
--- a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx
+++ b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx
@@ -244,9 +244,9 @@ export function OpenShortForm({
amountOfBondsToShortAsBigInt && traderDeposit
? fixed(amountOfBondsToShortAsBigInt, activeToken.decimals)
.div(traderDeposit, activeToken.decimals)
- .format({ decimals: 2, rounding: "trunc" })
+ .format({ decimals: 1, rounding: "trunc" })
: calculateMarketYieldMultiplier(longPrice ?? 0n).format({
- decimals: 2,
+ decimals: 1,
rounding: "trunc",
});
@@ -430,7 +430,7 @@ export function OpenShortForm({
≈ {`${exposureMultiplier}x`}
{" "}
- capital exposure
+ yield exposure
}
valueLoading={longPriceStatus === "loading"}
diff --git a/apps/hyperdrive-trading/src/ui/markets/PoolRow/FixedAprCta.tsx b/apps/hyperdrive-trading/src/ui/markets/PoolRow/FixedAprCta.tsx
index 2598f7a63..3c1041f99 100644
--- a/apps/hyperdrive-trading/src/ui/markets/PoolRow/FixedAprCta.tsx
+++ b/apps/hyperdrive-trading/src/ui/markets/PoolRow/FixedAprCta.tsx
@@ -1,15 +1,19 @@
+import { fixed } from "@delvtech/fixed-point-wasm";
import { HyperdriveConfig } from "@delvtech/hyperdrive-appconfig";
+import { Link } from "@tanstack/react-router";
import { ReactElement } from "react";
import { formatRate } from "src/base/formatRate";
import { useFixedRate } from "src/ui/hyperdrive/longs/hooks/useFixedRate";
import { PercentLabel } from "src/ui/markets/PoolRow/PercentLabel";
import { PoolStat } from "src/ui/markets/PoolRow/PoolStat";
+import { useAccount } from "wagmi";
interface FixedAprCtaProps {
hyperdrive: HyperdriveConfig;
}
export function FixedAprCta({ hyperdrive }: FixedAprCtaProps): ReactElement {
+ const { address: account } = useAccount();
const { fixedApr, fixedRateStatus } = useFixedRate({
chainId: hyperdrive.chainId,
hyperdriveAddress: hyperdrive.address,
@@ -18,22 +22,44 @@ export function FixedAprCta({ hyperdrive }: FixedAprCtaProps): ReactElement {
const label = "Fixed APR";
return (
-
- ) : (
- "-"
- )
- }
- isLoading={fixedRateStatus === "loading"}
- />
+ {
+ e.stopPropagation();
+ window.plausible("positionCtaClick", {
+ props: {
+ chainId: hyperdrive.chainId,
+ poolAddress: hyperdrive.address,
+ positionType: "long",
+ statName: label,
+ statValue: fixedApr ? fixed(fixedApr.apr, 18).toString() : "",
+ connectedWallet: account,
+ },
+ });
+ }}
+ >
+
+ ) : (
+ "-"
+ )
+ }
+ isLoading={fixedRateStatus === "loading"}
+ />
+
);
}
diff --git a/apps/hyperdrive-trading/src/ui/markets/PoolRow/LpApyCta.tsx b/apps/hyperdrive-trading/src/ui/markets/PoolRow/LpApyCta.tsx
index cb809ec73..5a4204169 100644
--- a/apps/hyperdrive-trading/src/ui/markets/PoolRow/LpApyCta.tsx
+++ b/apps/hyperdrive-trading/src/ui/markets/PoolRow/LpApyCta.tsx
@@ -1,15 +1,19 @@
+import { fixed } from "@delvtech/fixed-point-wasm";
import { HyperdriveConfig } from "@delvtech/hyperdrive-appconfig";
+import { Link } from "@tanstack/react-router";
import { ReactElement } from "react";
import { useLpApy } from "src/ui/hyperdrive/lp/hooks/useLpApy";
import { LpApyStat } from "src/ui/markets/PoolRow/LpApyStat";
import { PoolStat } from "src/ui/markets/PoolRow/PoolStat";
import { RewardsTooltipContent } from "src/ui/rewards/RewardsTooltip/RewardsTooltipContent";
+import { useAccount } from "wagmi";
interface LpApyCtaProps {
hyperdrive: HyperdriveConfig;
}
export function LpApyCta({ hyperdrive }: LpApyCtaProps): ReactElement {
+ const { address: account } = useAccount();
const { lpApy, lpApyStatus } = useLpApy({
hyperdriveAddress: hyperdrive.address,
chainId: hyperdrive.chainId,
@@ -18,25 +22,47 @@ export function LpApyCta({ hyperdrive }: LpApyCtaProps): ReactElement {
const label = lpApy ? `LP APY (${lpApy.ratePeriodDays}d)` : "LP APY";
return (
-
- }
- isLoading={lpApyStatus === "loading"}
- isNew={lpApy?.isNew}
- value={
-
- }
- />
+ {
+ e.stopPropagation();
+ window.plausible("positionCtaClick", {
+ props: {
+ chainId: hyperdrive.chainId,
+ poolAddress: hyperdrive.address,
+ positionType: "lp",
+ statName: label,
+ statValue: lpApy?.netLpApy ? fixed(lpApy.netLpApy).toString() : "",
+ connectedWallet: account,
+ },
+ });
+ }}
+ >
+
+ }
+ isLoading={lpApyStatus === "loading"}
+ isNew={lpApy?.isNew}
+ value={
+
+ }
+ />
+
);
}
diff --git a/apps/hyperdrive-trading/src/ui/markets/PoolRow/VariableApyCta.tsx b/apps/hyperdrive-trading/src/ui/markets/PoolRow/VariableApyCta.tsx
index 2cf8e302b..7cd53ef4b 100644
--- a/apps/hyperdrive-trading/src/ui/markets/PoolRow/VariableApyCta.tsx
+++ b/apps/hyperdrive-trading/src/ui/markets/PoolRow/VariableApyCta.tsx
@@ -1,10 +1,13 @@
+import { fixed } from "@delvtech/fixed-point-wasm";
import { HyperdriveConfig } from "@delvtech/hyperdrive-appconfig";
+import { Link } from "@tanstack/react-router";
import { ReactElement } from "react";
import { PoolStat } from "src/ui/markets/PoolRow/PoolStat";
import { VariableApyStat } from "src/ui/markets/PoolRow/VariableApyStat";
import { useOpenShortRewards } from "src/ui/rewards/hooks/useOpenShortRewards";
import { RewardsTooltipContent } from "src/ui/rewards/RewardsTooltip/RewardsTooltipContent";
import { useYieldSourceRate } from "src/ui/vaults/useYieldSourceRate";
+import { useAccount } from "wagmi";
interface YieldMultiplierCtaProps {
hyperdrive: HyperdriveConfig;
@@ -13,6 +16,7 @@ interface YieldMultiplierCtaProps {
export function VariableApyCta({
hyperdrive,
}: YieldMultiplierCtaProps): ReactElement {
+ const { address: account } = useAccount();
const { vaultRate: yieldSourceRate } = useYieldSourceRate({
chainId: hyperdrive.chainId,
hyperdriveAddress: hyperdrive.address,
@@ -24,25 +28,49 @@ export function VariableApyCta({
: "Variable APY";
return (
- {
+ e.stopPropagation();
+ window.plausible("positionCtaClick", {
+ props: {
+ chainId: hyperdrive.chainId,
+ poolAddress: hyperdrive.address,
+ positionType: "short",
+ statName: label,
+ statValue: yieldSourceRate?.netVaultRate
+ ? fixed(yieldSourceRate.netVaultRate).toString()
+ : "",
+ connectedWallet: account,
+ },
+ });
+ }}
+ >
+
+ ) : null
+ }
+ value={
+
- ) : null
- }
- value={
-
- }
- />
+ }
+ />
+
);
}