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

Add JupiterPerpProgram and corresponding unit tests #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

skynetcap
Copy link
Owner

@skynetcap skynetcap commented Sep 23, 2024

Implemented the JupiterPerpProgram class to handle various actions such as initializing, creating, and managing positions in the Jupiter Perpetuals program on Solana. Additionally, added comprehensive unit tests to ensure the correctness of the implemented instructions.

There's 50+ instructions in their IDL. This PR is under construction

Implemented the JupiterPerpProgram class to handle various actions such as initializing, creating, and managing positions in the Jupiter Perpetuals program on Solana. Additionally, added comprehensive unit tests to ensure the correctness of the implemented instructions.
Refactor `JupiterPerpProgram` to streamline instruction types and add new methods. Remove unit tests from `JupiterPerpProgramTest` to align with the updated structure.
Renamed several public static methods to improve readability and simplicity. The new names remove "Instruction" suffix, streamlining code comprehension and maintenance without changing functionality.
Introduced various new transaction instructions like withdrawFees2, createTokenMetadata, and swap2, each utilizing Borsh serialization for better efficiency. Updated existing instructions to use a consistent data serialization approach, improving the maintainability and performance of the code.
Introduced methods to initialize Jupiter perpetuals program, add pools, and add custody. These methods include account metadata and parameter serialization using Borsh.
Changed long to double for financial fields in JupiterPerpPosition and introduced POSITION_DIVISOR for conversion. Enhanced testGetAllJupiterPerpPositions to log formatted, comprehensive position details including entry price and leverage.
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.

1 participant