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

jupiter SDK limit orders going below quoted price . #337

Open
hammersharkfish opened this issue Apr 17, 2024 · 0 comments
Open

jupiter SDK limit orders going below quoted price . #337

hammersharkfish opened this issue Apr 17, 2024 · 0 comments

Comments

@hammersharkfish
Copy link

+-----------------------------------------------------------------------------------------------------+

| Transaction Type: Buy                                                                               |
| sellAmount: 0.135241916                                                                             |
| buyAmount: 18.749259                                                                                |
| sellAddress: So11111111111111111111111111111111111111112                                            |
| buyAddress: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v                                            |
| buy price: 138.634973736                                                                            |
| Signature: 4tnsKHFNZU5Nxw3aG4D1M7SC7DkZtG5CvgB7CdzP7WL6KXsiHtTSgGWYXwbTkX39pDUugeGuEuMRiUPhA1qC6Bp3 |

+-----------------------------------------------------------------------------------------------------+

I created a limit order using jupiter SDK in solana with the above parameters .

const { tx, orderPubKey } = await limitOrder.createOrder({
  owner: walletKeyPair.publicKey,
  inAmount:  new anchor.BN(sellAmount.toString()), 
  outAmount: new anchor.BN(buyAmount.toString()),
  inputMint: new PublicKey(sellAddress),
  outputMint: new PublicKey(buyAddress),
  expiredAt: transactionExpiry, // Example: new BN(new Date().valueOf() / 1000)
  base: base.publicKey,
});

My outAmount was 18749259 USDC but what I received was 18730510 USDC which is less than my outAmount . Does jupiter SDK automatically apply a slippage internally ? If yes how do I set it to 0%

Quoting the docs
Limit orders ensure that you get what you quote with no slippage, which is especially useful during volatile periods.
This is not happening .
https://docs.jup.ag/guides/limit-order/how-lo-work

https://docs.jup.ag/docs/limit-order/limit-order-with-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant