fix / remove double-counting of priority fee in getFee#620
Open
fengtality wants to merge 6 commits intodevelopmentfrom
Open
fix / remove double-counting of priority fee in getFee#620fengtality wants to merge 6 commits intodevelopmentfrom
fengtality wants to merge 6 commits intodevelopmentfrom
Conversation
The Solana RPC `meta.fee` field already includes both base fee and priority fee. The previous code was extracting the priority fee from compute budget instructions and adding it again, causing fees to be reported as nearly double the actual amount. This fix affects all connectors using sendAndConfirmTransaction: - Meteora CLMM - Orca CLMM Note: Raydium and PancakeSwap-Sol were unaffected as they read meta.fee directly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add solana-error-parser.ts for parsing program error codes - Parse on-chain transaction errors into user-friendly messages - Simplify /poll endpoint: remove tokens/walletAddress params - Include parsed error in poll response (TYPE (code): message) - Add error helper functions: simulationFailed, insufficientBalance, slippageExceeded Error codes supported: - Jupiter: 6001 (slippage) - Meteora DLMM: 6004, 6018, 6040 - Raydium CLMM: 6029-6031, 6037 - Orca Whirlpool: 6029-6031 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add specific error type for no-route scenarios that allows clients to know they can retry with flipped direction (ExactIn vs ExactOut). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The noRouteFound error returns 400 (not 404) as it's not a "resource not found" error but a "bad request" where no route exists. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or 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
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.
Summary
meta.feealready includes both base fee and priority feeNew in this update:
/pollendpoint (removetokens/walletAddressparams)TYPE (code): messageError Parser
Parses program-specific error codes into user-friendly messages:
Example poll response for failed transaction:
{ "txStatus": -1, "fee": 0.000403, "error": "SLIPPAGE_EXCEEDED (0x1771): Slippage tolerance exceeded. The output amount would be less than your minimum.", "txData": {...} }Affected Connectors
Related PRs
Test plan
🤖 Generated with Claude Code