- 
                Notifications
    You must be signed in to change notification settings 
- Fork 75
feat: show how to find fill status Events and fill status by querying fill StatusPDA #911
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
Conversation
|  | ||
| console.log(`Looking for Fill Event for Fill Status PDA: ${fillStatusPda.toString()}`); | ||
|  | ||
| const rpc = createSolanaRpc(provider.connection.rpcEndpoint); | 
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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.