-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat(orderly-network): implement plugin for Orderly with deposit, withdrawal, order creation, and close position functionality #442
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…r methods - Introduced `withdrawOrderly` method to facilitate USDC withdrawals from the Orderly Network. - Updated `DepositOrderlyParams` and added `WithdrawOrderlyParams` for better parameter handling. - Enhanced helper functions for key management and network interactions, including public key retrieval and signing requests. - Added new utility functions for handling cryptographic operations. - Updated package dependencies to support new features.
… handling - Added `createOrderOrderly` method to facilitate order creation at the Orderly Network. - Introduced new parameters for order creation, including `order_amount`, `visible_quantity`, and `client_order_id`. - Enhanced error handling in withdrawal and deposit methods for better user feedback. - Added utility functions to fetch allowed symbols and USDC token information based on network. - Updated `CreateOrderOrderlyParams` and added new parameter classes for improved validation.
…arameter validation - Implemented `closePositionOrderly` method to allow users to close positions on the Orderly Network. - Introduced `ClosePositionOrderlyParams` for better parameter handling, ensuring position quantity is validated. - Added `getPosition` helper function to retrieve current position details based on network and account ID. - Updated existing parameter classes to improve clarity and maintainability.
- Added new dependencies for `@orderly.network/types`, `tweetnacl`, and updated existing ones in the `orderly-network` plugin. - Improved the structure of `package.json` for better readability. - Updated `pnpm-lock.yaml` to reflect changes in package versions and dependencies, including the removal of unnecessary dependencies. - Ensured compatibility with the latest versions of TypeScript and other related packages.
|
…ce parameter handling - Introduced `getBalanceHoldingsOrderly` method to retrieve user token holdings in Orderly Network. - Added `GetUSDCBalanceHoldingsOrderlyParams` for improved parameter validation. - Refactored existing methods to utilize pattern matching for better error handling and code clarity. - Updated utility functions for fetching USDC addresses and vault addresses using pattern matching.
… handling - Added checks to ensure a position exists and has a non-zero quantity before attempting to close it. - Updated the order creation logic to use the position details directly instead of parameters for better accuracy. - Removed redundant validation from `ClosePositionOrderlyParams` to streamline parameter handling.
…mount restrictions - Added validation to prevent the use of order_amount for BUY orders in Futures mode, prompting users to use order_quantity instead. - Updated parameter descriptions to clarify usage for order_quantity and order_amount in the context of MARKET orders.
- Added advanced usage section in README for integrating with the ERC20 plugin. - Updated tools list in README to include specific USDC operations. - Introduced package-lock.json for the vercel-ai example to manage dependencies effectively.
…nges - Replaced the import of modeGovernance with orderlynetwork in the README example for better clarity on plugin usage. - Ensured the documentation aligns with the latest integration practices for the ERC20 plugin.
- Added new address mappings for chain ID 34443 in both getEvmUSDCAddress and getEvmVaultAddress functions. - Updated the default address returned for both functions to ensure consistency for the specified chain.
…er Registration Tool
0xaguspunk
approved these changes
Mar 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to:
Background
This PR implements the Orderly plugin and introduces several new features and improvements:
withdrawOrderly
method for facilitating USDC withdrawals, along with improved helper methods for key management and signing requests.createOrderOrderly
method with new parameters (order_amount
,visible_quantity
, andclient_order_id
) and improved error handling.closePositionOrderly
method to allow users to close positions, along with new parameter validation (ClosePositionOrderlyParams
) and thegetPosition
helper function for retrieving current position details.What does this PR do?
Testing
examples
directory and choose an example to test the plugin functionality.Detailed testing results
Docs
My changes do not require a change to the project documentation.
Checklist