Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate market impact and term #999

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,44 +91,55 @@ export function OpenShortPreview({
</span>
}
/>
<LabelValue
label="Fixed APR after open"
value={
<span
className={classNames(
"daisy-tooltip daisy-tooltip-top daisy-tooltip-left cursor-help before:border",
{ "border-b border-dashed border-current": spotRateAfterOpen },
)}
data-tip="The market fixed rate after opening the short."
>
{spotRateAfterOpen ? `${formatRate(spotRateAfterOpen)}% APR` : "-"}
</span>
}
/>
<LabelValue
label="Fixed APR impact"
value={
<span
className={classNames(
"daisy-tooltip daisy-tooltip-top daisy-tooltip-left cursor-help before:border",
{
"border-b border-dashed border-success text-success":
spotRateAfterOpen,
},
)}
data-tip={`The net market impact on the fixed rate after opening the short.`}
>
{getMarketImpactLabel(fixedAPR?.apr, spotRateAfterOpen)}
</span>
}
/>
<div className="flex flex-col gap-3">
<h6 className="font-medium">Market Impact</h6>
<LabelValue
label="Fixed APR after open"
value={
<span
className={classNames(
"daisy-tooltip daisy-tooltip-top daisy-tooltip-left cursor-help before:border",
{ "border-b border-dashed border-current": spotRateAfterOpen },
)}
data-tip="The market fixed rate after opening the short."
>
{spotRateAfterOpen
? `${formatRate(spotRateAfterOpen)}% APR`
: "-"}
</span>
}
/>
<LabelValue
label="Fixed APR impact"
value={
<span
className={classNames(
"daisy-tooltip daisy-tooltip-top daisy-tooltip-left cursor-help before:border",
{
"border-b border-dashed border-success text-success":
spotRateAfterOpen,
},
)}
data-tip={`The net market impact on the fixed rate after opening the short.`}
>
{getMarketImpactLabel(fixedAPR?.apr, spotRateAfterOpen)}
</span>
}
/>
</div>

<LabelValue
label="Matures in"
value={`${convertMillisecondsToDays(termLengthMS)} days, ${formatDate(
Date.now() + termLengthMS,
)}`}
/>
<div className="flex flex-col gap-3">
<h6 className="font-medium">Term</h6>
<LabelValue
label="Matures in"
value={`${convertMillisecondsToDays(termLengthMS)} days
`}
/>
<LabelValue
label="Matures on"
value={`${formatDate(Date.now() + termLengthMS)}`}
/>
</div>
</div>
);
}
Expand Down
Loading