Guides
DEX integration with Orca
Orca is natively supported in the SDK. Utility methods are provided to easily build the transactions needed to make swaps, open positions, manage cash and interact with Whirlpools.
Orca
Orca is the easiest place to trade cryptocurrency on the Solana blockchain. For a detailed description refer to the official Orca documentation and Orca Developer Portal.
Perform a Swap
- Create an IDex istance, providing a default account and and the RPC client istance:
- Create an IDex istance:
- Find the whirlpool:
- Get a swap quote for 1 USDC:
- Create the swap transaction:
- Sign and send the swap transaction:
Open a position and increase the liquidity of the ORCA/USDC whirlpool
An example of adding 5 ORCA and 5 USDC to the liquidity of the pool, minting a metaplex NFT representing the position
Was this page helpful?