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

integrate ratex #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

integrate ratex #66

wants to merge 1 commit into from

Conversation

ratex-tony
Copy link

integrate ratex and fetch the margin and lp of the ratex user
test address: AeHwgwuNVBLNacBqmDfzXxSF3fvkGYo56q6wQosFA18G

@Geninsus
Copy link
Contributor

Geninsus commented Jan 2, 2025

Hey, thank you for your contribution!

Some feedback that needs to be addressed before we merge :

  1. Interfaces and Types can be moved to a dedicated file (types.ts) for better readiness.

  2. Helper functions can be moved to a dedicated file (helpers.ts)

  3. The function getTokenAmountsFromLiquidity already exist in the repo (check how we use them inside the Orca CLMM or Raydium CLMM)

  4. If possible, try using the SolanaFM Parser library for onchain accounts, you can see an example in the Citrus plugins : https://github.com/sonarwatch/portfolio/tree/main/packages/plugins/src/plugins/citrus

  5. A Fetcher must have the least amount of OnChain calls to make sure it runs as quickly as possible.

I feel like some of the request could be made in a separate file and stored into our Cache, you can have a look at Raydium or Orca jobs to understand how to use the Cache.
You can also take a look at our docs here : https://docs.sonar.watch/open-source/list-your-project

We forbid "await" inside a for/while loop, try to fetch everything at once using Promises before going through the loop. You can check other plugins to understand how we usually do it.

  1. Try to use our helpers made on top of SolanaClient, we've created various helpers which allow to fetch & parse accounts, fetch & parse gPA etc...

You will find other examples inside our different plugins.

Thanks again for taking the time to contribute and looking forward to your updates!

If you have any further question feel free to dm on telegram : guysonar or join our discord!

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

Successfully merging this pull request may close these issues.

2 participants