import { percentFormat } from '../utils/index' import useSrmAccount from '../hooks/useSrmAccount' import { MSRM_DECIMALS, SRM_DECIMALS, } from '@project-serum/serum/lib/token-instructions' import Tooltip from './Tooltip' import { InformationCircleIcon } from '@heroicons/react/outline' import Button from './Button' import useMangoStore from '../stores/useMangoStore' import { ZERO_BN } from '@blockworks-foundation/mango-client' import DepositMsrmModal from './DepositMsrmModal' import WithdrawMsrmModal from './WithdrawMsrmModal' import { useState } from 'react' const FeeDiscountsTable = () => { const mangoAccount = useMangoStore((s) => s.selectedMangoAccount.current) const { totalSrm, totalMsrm, rates } = useSrmAccount() const [showDeposit, setShowDeposit] = useState(false) const [showWithdraw, setShowWithdraw] = useState(false) return (
Serum Spot Fees
{totalMsrm > 0 ? 'MSRM' : 'SRM'} Deposits
{totalMsrm > 0 ? totalMsrm.toLocaleString(undefined, { maximumFractionDigits: MSRM_DECIMALS, }) : totalSrm.toLocaleString(undefined, { maximumFractionDigits: SRM_DECIMALS, })}
Maker Fee
{rates ? percentFormat.format(rates.maker) : null}
Taker Fee
{rates ? percentFormat.format(rates.takerWithRebate) : null}
{mangoAccount ? (
{mangoAccount.msrmAmount.gt(ZERO_BN) ? ( ) : null}
) : null}
Mango Perp Fees
Maker Fee
{percentFormat.format(0.0)}
Taker Fee
{percentFormat.format(0.0005)}
{showDeposit ? ( setShowDeposit(false)} /> ) : null} {showWithdraw ? ( setShowWithdraw(false)} /> ) : null}
) } export default FeeDiscountsTable