Skip to content

Commit

Permalink
chore: remove debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chambaz committed Nov 25, 2023
1 parent b5d7090 commit 1e244b9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import React, { FC } from "react";
import React from "react";

import dynamic from "next/dynamic";

import { useMrgnlendStore } from "~/store";
import { cn } from "~/utils";
import { useWalletContext } from "~/hooks/useWalletContext";

import { UserStats } from "~/components/common/AccountSummary";

const GlobalStats = dynamic(async () => (await import("~/components/common/AccountSummary/GlobalStats")).GlobalStats, {
ssr: false,
});

const AccountSummary: FC = () => {
const AccountSummary = () => {
const [isStoreInitialized, accountSummary, protocolStats, selectedAccount] = useMrgnlendStore((state) => [
state.initialized,
state.accountSummary,
Expand All @@ -18,10 +21,8 @@ const AccountSummary: FC = () => {
]);
const { connected } = useWalletContext();

// console.log(isStoreInitialized, accountSummary, protocolStats, selectedAccount);

return (
<div className="flex flex-col lg:flex-row w-full justify-between items-center">
<div className={cn("flex flex-col lg:flex-row w-full justify-between items-center")}>
<div className="font-[500] lg:block w-full h-[118px]">
<div className="h-full rounded-xl p-[10px]">
<span className="w-full flex justify-start text-xl">Global stats</span>
Expand Down
16 changes: 10 additions & 6 deletions apps/marginfi-v2-ui/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ const Home = () => {
const { walletAddress, wallet, isOverride } = useWalletContext();
const { connection } = useConnection();
const debounceId = React.useRef<NodeJS.Timeout | null>(null);
const [fetchMrgnlendState, setIsRefreshingStore, marginfiAccounts, selectedAccount] = useMrgnlendStore((state) => [
const [
fetchMrgnlendState,
isStoreInitialized,
isRefreshingStore,
setIsRefreshingStore,
marginfiAccounts,
selectedAccount,
] = useMrgnlendStore((state) => [
state.fetchMrgnlendState,
state.initialized,
state.isRefreshingStore,
state.setIsRefreshingStore,
state.marginfiAccounts,
state.selectedAccount,
]);

const [isStoreInitialized, isRefreshingStore] = useMrgnlendStore((state) => [
state.initialized,
state.isRefreshingStore,
]);

React.useEffect(() => {
const fetchData = () => {
setIsRefreshingStore(true);
Expand Down
4 changes: 0 additions & 4 deletions packages/marginfi-client-v2/src/models/account/pure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,9 @@ class MarginfiAccount {

// apply volatility factor to avoid failure due to price volatility / slippage
const initUntiedCollateralForBank = freeCollateral.times(_volatilityFactor);
console.log("initUntiedCollateralForBank", initUntiedCollateralForBank.toFixed(6));
const priceLowestBias = bank.getPrice(priceInfo, PriceBias.Lowest);
console.log("priceLowestBias", priceLowestBias.toFixed(6));
const initWeightedPrice = priceLowestBias.times(initAssetWeight);
console.log("initWeightedPrice", initWeightedPrice.toFixed(6));
const maxWithdraw = initUntiedCollateralForBank.div(initWeightedPrice);
console.log("maxWithdraw", maxWithdraw.toFixed(6));

return maxWithdraw;
}
Expand Down
1 change: 0 additions & 1 deletion packages/marginfi-v2-ui-state/src/lib/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ async function signLoginTx(
async function signinFirebaseAuth(token: string) {
try {
await signInWithCustomToken(auth, token);
console.log("Signed user in.");
} catch (error: any) {
console.error("Error signing in with custom token: ", error);
if (error.code === "auth/network-request-failed") {
Expand Down

3 comments on commit 1e244b9

@vercel
Copy link

@vercel vercel bot commented on 1e244b9 Nov 25, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

marginfi-landing-page – ./apps/marginfi-landing-page

marginfi-landing-page-git-production-mrgn.vercel.app
marginfi-landing-page.vercel.app
marginfi-landing-page-mrgn.vercel.app
www.marginfi.com
marginfi.com

@vercel
Copy link

@vercel vercel bot commented on 1e244b9 Nov 25, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

omni – ./apps/omni

omni-git-production-mrgn.vercel.app
omni-one.vercel.app
omni-mrgn.vercel.app
omni.marginfi.com

@vercel
Copy link

@vercel vercel bot commented on 1e244b9 Nov 25, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.