I hope this example can help you.: https://github.com/chainstacklabs/raydium-sdk-swap-example-typescript