Skip to content

Commit

Permalink
chore: remove fee & comments
Browse files Browse the repository at this point in the history
  • Loading branch information
borcherd committed Dec 19, 2024
1 parent 3463ef8 commit 14c7fd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,21 @@ import { ArenaPoolV2Extended } from "~/types/trade-store.types";

interface InfoMessagesProps {
connected: boolean;
tradeState: string;
activePool: ArenaPoolV2Extended;
actionMethods: ActionMessageType[];
setIsWalletOpen: (value: boolean) => void;
refreshStore: () => Promise<void>;
refreshSimulation: () => void;
connection: any;
wallet: any;
isRetrying?: boolean;
usdcBalance: number;
}

export const InfoMessages = ({
connected,
tradeState,
activePool,

actionMethods = [],
setIsWalletOpen,
refreshStore,
connection,
wallet,

refreshSimulation,
isRetrying,
usdcBalance,
Expand All @@ -57,16 +51,6 @@ export const InfoMessages = ({
</div>
);

// const renderLongWarning = () =>
// renderWarning(`You need to hold ${activePool?.tokenBank.meta.tokenSymbol} to open a long position.`, () =>
// setIsWalletOpen(true)
// );

// const renderShortWarning = () =>
// renderWarning(`You need to hold ${activePool?.quoteBank.meta.tokenSymbol} to open a short position.`, () =>
// setIsWalletOpen(true)
// );

const renderUSDCWarning = () =>
renderWarning(`You need to hold USDC to open a position.`, () => setIsWalletOpen(true));

Expand Down Expand Up @@ -157,25 +141,6 @@ export const InfoMessages = ({
</div>
);

// const renderDepositCollateralDialog = () => (
// <ActionBox.Lend
// isDialog
// useProvider
// lendProps={{
// connected,
// requestedLendType: ActionType.Deposit,
// requestedBank: activePool.quoteBank,
// showAvailableCollateral: false,
// captureEvent: () => console.log("Deposit Collateral"),
// onComplete: () => refreshStore(),
// }}
// dialogProps={{
// trigger: <Button className="w-full">Deposit Collateral</Button>,
// title: `Supply ${activePool.quoteBank.meta.tokenSymbol}`,
// }}
// />
// );

const renderContent = () => {
if (!connected) return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,6 @@ export const TradeBoxV2 = ({ activePool, side = "long" }: TradeBoxV2Props) => {
{actionMethods && actionMethods.some((method) => method.description) && (
<InfoMessages
connected={connected}
tradeState={tradeState}
activePool={activePoolExtended}
actionMethods={actionMethods}
setIsWalletOpen={setIsWalletOpen}
refreshStore={() =>
Expand All @@ -494,8 +492,6 @@ export const TradeBoxV2 = ({ activePool, side = "long" }: TradeBoxV2Props) => {
banks: [activePoolExtended.tokenBank.address, activePoolExtended.quoteBank.address, RANDOM_USDC_BANK],
})
}
connection={connection}
wallet={wallet}
refreshSimulation={refreshSimulation}
isRetrying={isSimulating.isLoading}
usdcBalance={maxAmount}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export async function generateTradeTx(props: CalculateLoopingProps): Promise<Tra
swapTx = await createSwapTx(
props,
{
platformFeeBps: props.platformFeeBps ?? 0,
slippageBps: props.slippageBps ?? 0,
},
props.marginfiClient.wallet.publicKey,
Expand Down Expand Up @@ -173,7 +172,7 @@ export async function generateTradeTx(props: CalculateLoopingProps): Promise<Tra

export async function createSwapTx(
props: CalculateLoopingProps,
jupOpts: { platformFeeBps: number; slippageBps: number },
jupOpts: { slippageBps: number },
feepayer: PublicKey,
connection: Connection
): Promise<{ quote?: QuoteResponse; tx?: VersionedTransaction; error?: ActionMessageType }> {
Expand All @@ -185,7 +184,6 @@ export async function createSwapTx(
amount: uiToNative(props.depositAmount, 6).toNumber(),
inputMint: USDC_MINT.toBase58(),
outputMint: props.depositBank.info.state.mint.toBase58(),
platformFeeBps: jupOpts.platformFeeBps,
slippageBps: jupOpts.slippageBps,
});

Expand Down

0 comments on commit 14c7fd5

Please sign in to comment.