Skip to content

jupiter SDK limit orders going below quoted price .  #337

@hammersharkfish

Description

@hammersharkfish
+-----------------------------------------------------------------------------------------------------+

| 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions