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

Add custom bottle multiplier for Lifi #2542

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 11 additions & 3 deletions web/app.fluidity.money/app/routes/$network/dashboard/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ function ErrorBoundary(error: Error) {

const ADJUSTED_BOTTLE_MULTIPLIER = 12;

const ADJUSTED_BOTTLE_MULTIPLIER = 24;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same variable name as above


const SAFE_DEFAULT_HOME: HomeLoaderData = {
network: "arbitrum",
loaded: false,
Expand Down Expand Up @@ -405,9 +407,15 @@ export default function Home() {

const shouldMultiplyBottles = application != "none";

let adjustedLootboxCount = lootboxCount;
if (shouldMultiplyBottles)
adjustedLootboxCount = adjustedLootboxCount * ADJUSTED_BOTTLE_MULTIPLIER;
// reward lifi bottles disproporationately (24x) compared to the usual (12x)

let adjustedLootboxCount = lootboxCount;
switch (true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has redundant logic (if application is lifi shouldMultiplyBottles is always going to be true), and should be a ternary such as

const adjustedLootboxCount = application === "lifi"
  ? lootboxCount * lifiMultiplier 
  : application !== "none" 
    ? lootboxCount * bottleMultiplier 
    : lootboxCount

case shouldMultiplyBottles && application == "lifi":
adjustedLootboxCount = adjustedLootboxCount * ADJUSTED_BOTTLE_MULTIPLIER_LIFI;
case shouldMultiplyBottles:
adjustedLootboxCount = adjustedLootboxCount * ADJUSTED_BOTTLE_MULTIPLIER;
}

return {
RowElement: ({ heading }: { heading: string }) => {
Expand Down
Loading