Skip to content

Commit

Permalink
Merge pull request #3248 from OlympusDAO/develop
Browse files Browse the repository at this point in the history
[Release] - Coolers in Single View, Emission Manager View
  • Loading branch information
brightiron authored Dec 7, 2024
2 parents 8b620c8 + db6bbb0 commit fd2f405
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 201 deletions.
3 changes: 2 additions & 1 deletion src/components/Sidebar/NavContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const NavContent: React.VFC = () => {

const protocolMetricsEnabled = Boolean(Environment.getWundergraphNodeUrl());
const emissionsManagerEnabled = Environment.getEmissionsManagerEnabled();
const rbsDisabled = Environment.getRbsDisabled();
return (
<Paper className="dapp-sidebar">
<Box className="dapp-sidebar-inner" display="flex" justifyContent="space-between" flexDirection="column">
Expand Down Expand Up @@ -62,7 +63,7 @@ const NavContent: React.VFC = () => {
to="/lending/cooler"
/>
{emissionsManagerEnabled && <NavItem to="/emission" icon="range" label={`Emission Manager`} />}
{!emissionsManagerEnabled && <NavItem to="/range" icon="range" label={`RBS`} />}
{!rbsDisabled && <NavItem to="/range" icon="range" label={`RBS`} />}
<NavItem icon="settings" label={`Utility`} to="/utility" />
<NavItem to="/governance" icon="voting" label={`Govern`} />
</>
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/environment/Environment/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ export class Environment {
fallback: "false",
}) === "true";

public static getRbsDisabled = (): boolean =>
this._get({
first: true,
key: "VITE_RBS_DISABLED",
fallback: "false",
}) === "true";

public static getGovernanceSubgraphUrl = (): string => {
const subgraphApiKey = this.getSubgraphApiKey();
return this._get({
Expand Down
12 changes: 6 additions & 6 deletions src/views/Emission/hooks/useGetEmissionConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export const useGetEmissionConfig = () => {
return {
baseEmissionRate: `${Number(formatUnits(baseEmissionRate, 9)) * 100}%`, // 1e9 = 100%
backing: formatUnits(backing, 18),
premium: `${Number(formatUnits(premium, 18)) * 100}%`,
minimumPremium: `${Number(formatUnits(minimumPremium, 18)) * 100}%`, // 1e18 = 100%
premium: `${(Number(formatUnits(premium, 18)) * 100).toFixed(2)}%`,
minimumPremium: `${(Number(formatUnits(minimumPremium, 18)) * 100).toFixed(2)}%`, // 1e18 = 100%
nextSale: {
premium: `${Number(formatUnits(nextSalePremium, 18)) * 100}%`, // 1e18 = 100%
emissionRate: `${Number(formatUnits(nextSaleEmissionRate, 9)) * 100}%`, // OHM scale
emission: `${formatUnits(nextSaleEmission, 9)} OHM`, // OHM scale
premium: `${(Number(formatUnits(nextSalePremium, 18)) * 100).toFixed(2)}%`, // 1e18 = 100%
emissionRate: `${(Number(formatUnits(nextSaleEmissionRate, 9)) * 100).toFixed(2)}%`, // OHM scale
emission: `${Number(formatUnits(nextSaleEmission, 9)).toFixed(2)} OHM`, // OHM scale
},
rateChange: {
changeBy: formatUnits(rateChange.changeBy, 9), // OHM scale
Expand All @@ -66,7 +66,7 @@ export const useGetEmissionConfig = () => {
activeMarketId: activeMarketId.toNumber(),
vestingPeriod: vestingPeriod.toString(), // uint48 (in seconds)
// reserves: formatUnits(reserves, 18), // DAI scale (18 decimals)
currentEmissionRate: `${Number(Number(formatUnits(currentEmissionRate, 9)) * 100).toFixed(4)}%`, // OHM scale
currentEmissionRate: `${(Number(formatUnits(currentEmissionRate, 9)) * 100).toFixed(4)}%`, // OHM scale
currentEmission: `${Number(formatUnits(currentEmission, 9)).toFixed(2)} OHM`, // OHM scale
tellerAddress,
reserveAddress,
Expand Down
2 changes: 1 addition & 1 deletion src/views/Emission/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const Emission = () => {
<div id="stake-view">
<PageTitle name={"Emission Manager"} noMargin />
<Box width="97%" maxWidth="974px">
{emissionConfig?.activeMarketId && (
{Boolean(emissionConfig?.activeMarketId) && (
<Box mb="21px">
<InfoNotification>
<Typography>
Expand Down
Loading

0 comments on commit fd2f405

Please sign in to comment.