Skip to content

Conversation

@chrismaree
Copy link
Member

@chrismaree chrismaree commented Mar 6, 2025

This PR shows how we can easily fetch fill status events & fill status without needing to fetch all past events from the spoke pool. It introduces 2 new scripts to help with this as well as a new function added to the solanaProgramUtils to accommodate this flow.

Signed-off-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Chris Maree <christopher.maree@gmail.com>
@chrismaree chrismaree marked this pull request as ready for review March 6, 2025 11:51
Signed-off-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Chris Maree <christopher.maree@gmail.com>

console.log(`Looking for Fill Event for Fill Status PDA: ${fillStatusPda.toString()}`);

const rpc = createSolanaRpc(provider.connection.rpcEndpoint);
Copy link
Member

Choose a reason for hiding this comment

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

Does this only work on certain "archive"-ish rpc's?

Copy link
Member Author

Choose a reason for hiding this comment

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

I used this syntax as it's from web3-v2 (now just known as kit) which is what the bots will be using. it's meant to be illustrative for how those clients can injest this data.

Signed-off-by: Chris Maree <christopher.maree@gmail.com>
Copy link
Contributor

@md0x md0x left a comment

Choose a reason for hiding this comment

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

Great work!
The approach of picking the last signature (the oldest) based on the assumption that the first PDA creation event contains the relevant fill event makes sense!

Nit: It might be helpful to add a small integration test case that explicitly validates the assumption about signature ordering and PDA creation ensuring that any changes in teh RPC behavior or spam signatures don’t inadvertently break the logic.functionality.

@chrismaree chrismaree merged commit 447d77c into master Mar 18, 2025
9 checks passed
@chrismaree chrismaree deleted the chrismaree/add-query-by-pda branch March 18, 2025 14:18
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.

4 participants