feat(traderjoe): add support for traderjoe swap #109
feat(traderjoe): add support for traderjoe swap #109Quazia merged 44 commits intorabbitholegg:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 246d63e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Fix(TraderJoe): jsbi fix
Quazia
left a comment
There was a problem hiding this comment.
LGTM - love the new and/or pattern for multiple function signature you have here. For the import { ChainId } from '@traderjoe-xyz/sdk-core' I don't think it's worth importing that package given that the chain ids are stable/not project specific and we can use our own internal chain ids. Whether we make that change now or once we add the intenal utils package I totally leave up to your judgement but long term I don't think it's worth having to import this package for that one object.
| }, | ||
| }, | ||
| { | ||
| $or: [ |
There was a problem hiding this comment.
I like this pattern for the optional params vs repeating the params that are always the same for each function signature. It's cool to see the plugin approaches evolve.
There was a problem hiding this comment.
We had a lot of duplicate code, so figured I would test this approach. It looks much cleaner.
There was a problem hiding this comment.
Yeah agreed - going to default to this going forward it's definitely much cleaner
| type SwapActionParams, | ||
| GreaterThanOrEqual, | ||
| } from '@rabbitholegg/questdk' | ||
| import { ChainId } from '@traderjoe-xyz/sdk-core' |
There was a problem hiding this comment.
Do we use this package for anything else? Probably makes sense to just hard-code it and avoid the import then switch over to the internal utils chain id definitions once those are accesible.
Integration of
traderjoePlugin for QuestDKThis PR introduces the integration of the
traderjoeplugin for QuestDK.About The Project
Trader Joe is a popular decentralized trading platform on the Avalanche network and more recently Arbitrum One. It is known for its extensive range of swap functionalities and token offerings.
Implementation Details
This plugin supports all tokens featured in the "top" token section of the Trader Joe user interface. It has been thoroughly tested to ensure functionality across all 9 available swap methods. Additional testing is done to make sure that undefined parameters do not cause any unintended false negatives. The plugin permits using "any" token as
tokenInortokenOutwithout negative impacts on the transaction's validity.Current Limitations
amountOutMinwhich can be significantly lower then expected. Especially if the user sets high slippage.amountInandamountInMaxhave a similar issue, where amount will be higher than expected.