feat: implement Jupiter referral system with SSE compatibility #7
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.
🎯 Jupiter Referral System Implementation
This PR implements a robust Jupiter referral system that allows developers to earn 2.51% fees from swaps while maintaining full compatibility with the existing SSE token infrastructure.
🐛 Problem Solved
Resolves the Jupiter v6 API conflict identified in commit 81f3f24 where using both
platformFeeBps
andreferralAccount/referralFeeBps
simultaneously caused fees to be ignored.✨ Solution
platformFeeBps
approach in quote API🚀 Features
📁 Files Changed
src/components/trade/hooks/jupiter/use-jupiter-swap.ts
src/services/jupiter.ts
,src/services/swap.ts
src/types/jupiter-service.ts
src/app/api/jupiter/swap/route.ts
README.md
,JUPITER_REFERRAL_SETUP.md
.env.example
🧪 Testing
npm run build
)💡 Technical Details
Dual Fee System Architecture:
platformFeeBps
in Jupiter quote APIJUPITER_CONFIG.FEE_WALLET
Both systems operate independently without conflicts, ensuring reliable fee collection while maintaining full SSE token support.
📚 Documentation
Complete setup instructions and technical details available in
JUPITER_REFERRAL_SETUP.md
🙏 Attribution
This implementation resolves the issue identified by @rxdha1 and the Bonk Computer team, refined for the official Solana Starter Kit.
Ready for review! 🚀