Skip to content

Commit

Permalink
chore: use provided tradeside
Browse files Browse the repository at this point in the history
  • Loading branch information
borcherd committed Dec 13, 2024
1 parent 7e3620c commit 4235be3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useExtendedPool } from "~/hooks/useExtendedPools";
import { useMarginfiClient } from "~/hooks/useMarginfiClient";
import { useWrappedAccount } from "~/hooks/useWrappedAccount";
import { useAmountDebounce } from "~/hooks/useAmountDebounce";
import { PreviousTxn } from "~/types";

import {
ActionButton,
Expand All @@ -37,12 +38,11 @@ import {
Stats,
TradingBoxSettingsDialog,
InfoMessages,
ActionSimulationStatus,
} from "./components";
import { useTradeBoxStore } from "./store";
import { checkTradeActionAvailable } from "./utils";
import { useTradeSimulation, useActionAmounts } from "./hooks";
import { ActionSimulationStatus } from "./components";
import { PreviousTxn } from "~/types";

interface TradeBoxV2Props {
activePool: ArenaPoolV2;
Expand Down Expand Up @@ -189,6 +189,10 @@ export const TradeBoxV2 = ({ activePool, side = "long" }: TradeBoxV2Props) => {
refreshState();
}, []);

React.useEffect(() => {
setTradeState(side);
}, [side]);

const { refreshSimulation } = useTradeSimulation({
debouncedAmount: debouncedAmount ?? 0,
debouncedLeverage: debouncedLeverage ?? 0,
Expand Down

0 comments on commit 4235be3

Please sign in to comment.