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

fix: script to fill jupiter swap #819

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

Conversation

Reinis-FRP
Copy link
Contributor

@Reinis-FRP Reinis-FRP commented Dec 23, 2024

Adds a script to test Across+ fills with Jupiter swap integration on mainnet. Note that all remaining tokens above minimum output amount can be stolen by anyone. This could be improved by either creating a sweeper program that reads actual handler ATA balance and transfers all of them to the recipient ATA or building this functionality in the Multicall handler.

Tested on below mainnet deployments:

multicall_handler = "71cJqNV4vkmxsbk422c2KpST3aSwuvKsQ4kpLD8RBHZ5"
svm_spoke = "D1WcTLKRyN4TuqnfMBGPvc16nACHfNhFPbgWNExb1aur"

Signed-off-by: Reinis Martinsons <[email protected]>
Signed-off-by: Reinis Martinsons <[email protected]>
Signed-off-by: Reinis Martinsons <[email protected]>
@@ -76,5 +116,33 @@ export async function sendTransactionWithLookupTable(
versionedTx.sign([sender]);
const txSignature = await connection.sendTransaction(versionedTx);

return { txSignature, lookupTableAddress };
// Confirm the versioned transaction
await confirmTransaction(connection, txSignature);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might conflict once #811 is merged in, but seems better to have reusable transaction confirmation helper

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has some overlaps from #811 as we needed better tx confirmation for filling across+

Signed-off-by: Reinis Martinsons <[email protected]>
Comment on lines +49 to +52
const svmSpokeIdl = require("../../target/idl/svm_spoke.json");
const svmSpokeProgram = new Program<SvmSpoke>(svmSpokeIdl, provider);
const handlerIdl = require("../../target/idl/multicall_handler.json");
const handlerProgram = new Program<MulticallHandler>(handlerIdl, provider);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to simplify this once #806 is in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to this PR, but linter picked these up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might also consider passing priority fees to loadExecuteRelayerRefundLeafParams, but that would require some refactor not directly related to this PR

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