Skip to content

Commit

Permalink
Add bps param for fetchConversionRate
Browse files Browse the repository at this point in the history
  • Loading branch information
sablevsky committed Dec 9, 2024
1 parent 84ed64d commit 2be2b6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/common/jup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import { getTokenDecimals } from '@banx/utils'
type FetchConversionRate = {
lendingTokenType: LendingTokenType
tokenMint: string
slippageBps: number
}
export const fetchConversionRate = async ({
lendingTokenType,
tokenMint,
slippageBps = 300,
}: FetchConversionRate): Promise<number> => {
try {
const tokenDecimals = getTokenDecimals(lendingTokenType)
Expand All @@ -22,8 +24,7 @@ export const fetchConversionRate = async ({
inputMint: lendingTokenMint,
outputMint: tokenMint,
amount: getTokenDecimals(lendingTokenType),
//TODO Fix slippage problem
slippageBps: 300,
slippageBps,
computeAutoSlippage: true,
swapMode: 'ExactIn',
onlyDirectRoutes: true,
Expand Down

0 comments on commit 2be2b6f

Please sign in to comment.