-
-
Notifications
You must be signed in to change notification settings - Fork 247
Feat/orca connector #547
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
base: development
Are you sure you want to change the base?
Feat/orca connector #547
Conversation
| * @param signature Transaction signature | ||
| * @param owner Owner address (required for SPL tokens and SOL balance extraction) | ||
| * @param tokens Array of token mint addresses or 'SOL' for native SOL | ||
| * @param treatWsolAsSplToken If true, treats WSOL as a regular SPL token instead of native SOL (default: false for backward compatibility) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @fengtality, about this method, do we know the reason why we treat Wrapped SOL as native token? Since most of Orca operations do not auto wrap and un-wrap SOL so I have to add this flag so that Wrapped SOL can be treated as normal SPL token and therefore Wrapped SOL balance changes can be tracked properly, at least for Orca operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @mlguys, meeep from Orca here. You can use our helper function to create the wrap/unwrap/createATA for you with this util function when you construct the whirlpool instructions
You can take a look at how it's being used across our SDK here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you end up using our new sdk, this is handled for you in our out of the box functions and this wouldn't be necessary.
| * @param signature Transaction signature | ||
| * @param owner Owner address (required for SPL tokens and SOL balance extraction) | ||
| * @param tokens Array of token mint addresses or 'SOL' for native SOL | ||
| * @param treatWsolAsSplToken If true, treats WSOL as a regular SPL token instead of native SOL (default: false for backward compatibility) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @mlguys, meeep from Orca here. You can use our helper function to create the wrap/unwrap/createATA for you with this util function when you construct the whirlpool instructions
You can take a look at how it's being used across our SDK here.
| * @param signature Transaction signature | ||
| * @param owner Owner address (required for SPL tokens and SOL balance extraction) | ||
| * @param tokens Array of token mint addresses or 'SOL' for native SOL | ||
| * @param treatWsolAsSplToken If true, treats WSOL as a regular SPL token instead of native SOL (default: false for backward compatibility) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you end up using our new sdk, this is handled for you in our out of the box functions and this wouldn't be necessary.
| "@raydium-io/raydium-sdk-v2": "0.1.141-alpha", | ||
| "@sinclair/typebox": "^0.33.22", | ||
| "@solana-program/token-2022": "^0.6.0", | ||
| "@solana/kit": "3.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two ts-sdks in the Orca realm. The legacy-sdk orca-so/whirlpools-sdk & the new kit-based SDK orca-so/whirlpools. They are both at feature parity.
Looking at hummingbot's usage here, the requirement is mostly to construct the ix and executing it. If there are no issues adding @solana/kit as a dependency, we'd highly recommend using the new SDK and not use the legacy-sdk since it's a lot easier to use for your use-case.
For example, the following QoL type functionality are done for you:
- appending ATA / wrapSOL ix if necessary
- initializing tick-arrays before tick-array operations
- ...etc
| import { getTickArrayPubkeys, handleWsolAta } from '../orca.utils'; | ||
| import { OrcaClmmAddLiquidityRequest } from '../schemas'; | ||
|
|
||
| async function addLiquidity( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following routes can be simplified to a single call to construct the ix & execution if you use our kit-sdk (toggle the "Typescript Kit" header when you visit our docs to see the examples):
- addLiquidity (increaseLiquidity)
- closePosition
- collectFees
- openPosition
- removeLiquidity (decreaseLiquidity)
- swap
The complexities such as input conversion, ATA/wSOL handling & other Orca specific operations are done for you in these methods.
Before submitting this PR, please make sure:
A description of the changes proposed in the pull request:
Tests performed by the developer:
Tips for QA testing: