Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use higher rate limit Jupiter API #30

Open
wants to merge 1 commit into
base: typescript-main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/jupiter/swap/swap-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function getQuote(
convertedAmountOfTokenOut: number,
slippage: any
) {
const url = `https://quote-api.jup.ag/v6/quote?inputMint=${tokenToSell}&outputMint=${tokenToBuy}&amount=${convertedAmountOfTokenOut}&slippageBps=${slippage}`;
const url = `https://public.jupiterapi.com/quote?inputMint=${tokenToSell}&outputMint=${tokenToBuy}&amount=${convertedAmountOfTokenOut}&slippageBps=${slippage}`;
const response = await fetch(url);
const quote = await response.json();
return quote;
Expand All @@ -44,7 +44,7 @@ export async function getSwapTransaction(
dynamicComputeUnitLimit: true, // allow dynamic compute limit instead of max 1,400,000
prioritizationFeeLamports: 4211970, // prioritization fee
};
const resp = await fetch("https://quote-api.jup.ag/v6/swap", {
const resp = await fetch("https://public.jupiterapi.com/swap", {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down