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

[ECO-2095] Update economic data and rewards system #254

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
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
@@ -1,9 +1,17 @@
import { useWallet } from "@aptos-labs/wallet-adapter-react";
import { ExplorerLink } from "components/link/component";
import { APTOS_NETWORK } from "lib/env";
import { toDisplayCoinDecimals } from "lib/utils/decimals";

export const CongratulationsToast = ({ transactionHash }: { transactionHash: string }) => {
export const CongratulationsToast = ({
transactionHash,
amount,
}: {
transactionHash: string;
amount: number | bigint | string;
}) => {
const { network } = useWallet();
const amountString = toDisplayCoinDecimals({ num: amount, decimals: 2 });
return (
<div className="flex flex-col text-center">
<span className="text-7xl p-[20px]">🎉</span>
Expand All @@ -12,7 +20,7 @@ export const CongratulationsToast = ({ transactionHash }: { transactionHash: str
Congratulations!
</span>
<span className="font-forma text-2xl uppercase text-ec-blue">
{"You won 1 APT!"}
<span>{`You won ${amountString} APT.`}</span>
</span>
<div className="w-[100%] flex flex-row justify-center mb-[15px]">
<span className="text-dark-gray text-l uppercase">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const SwapButton = ({
toast.dark(
<>
<RewardsAnimation controls={controls} />
<CongratulationsToast transactionHash={res.response.hash} />
<CongratulationsToast transactionHash={res.response.hash} amount={rewardsEvent.data.octas_reward_amount} />
</>,
{
pauseOnFocusLoss: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import ButtonWithConnectWalletFallback from "components/header/wallet-button/Con
import { useAptos } from "context/wallet-context/AptosContextProvider";
import { useCallback, useEffect, useState } from "react";
import { createSession } from "./session";
import { EXTERNAL_LINK_PROPS } from "components/link";
import { useScramble } from "use-scramble";
import { motion } from "framer-motion";
import { Flex } from "@containers";
Expand Down
20 changes: 10 additions & 10 deletions src/typescript/sdk/src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ export const DEFAULT_REGISTER_MARKET_GAS_OPTIONS = {
maxGasAmount: ONE_APT / 100,
gasUnitPrice: 100,
};
export const MARKET_CAP = 4_500_000_000_000n;
export const EMOJICOIN_REMAINDER = 10_000_000_000_000_000n;
export const EMOJICOIN_SUPPLY = 45_000_000_000_000_000n;
export const LP_TOKENS_INITIAL = 100_000_000_000_000n;
export const MARKET_CAP = 450_000_000_000n;
export const EMOJICOIN_REMAINDER = 1_000_000_000_000_000n;
export const EMOJICOIN_SUPPLY = 4_500_000_000_000_000n;
export const LP_TOKENS_INITIAL = 10_000_000_000_000n;
export const BASE_REAL_FLOOR = 0n;
export const QUOTE_REAL_FLOOR = 0n;
export const BASE_REAL_CEILING = 35_000_000_000_000_000n;
export const QUOTE_REAL_CEILING = 1_000_000_000_000n;
export const BASE_VIRTUAL_FLOOR = 14_000_000_000_000_000n;
export const QUOTE_VIRTUAL_FLOOR = 400_000_000_000n;
export const BASE_VIRTUAL_CEILING = 49_000_000_000_000_000n;
export const QUOTE_VIRTUAL_CEILING = 1_400_000_000_000n;
export const BASE_REAL_CEILING = 3_500_000_000_000_000n;
export const QUOTE_REAL_CEILING = 100_000_000_000n;
export const BASE_VIRTUAL_FLOOR = 1_400_000_000_000_000n;
export const QUOTE_VIRTUAL_FLOOR = 40_000_000_000n;
export const BASE_VIRTUAL_CEILING = 4_900_000_000_000_000n;
export const QUOTE_VIRTUAL_CEILING = 140_000_000_000n;
export const POOL_FEE_RATE_BPS = 25;
export const MARKET_REGISTRATION_FEE = ONE_APT_BIGINT;
export const MARKET_REGISTRATION_DEPOSIT = 4n * ONE_APT_BIGINT;
Expand Down
Loading