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

ft_watcher: sol swap layer #356

Merged
merged 2 commits into from
Aug 26, 2024
Merged

ft_watcher: sol swap layer #356

merged 2 commits into from
Aug 26, 2024

Conversation

bingyuyap
Copy link
Contributor

@bingyuyap bingyuyap commented Aug 16, 2024

This PR adds the Solana Swap Layer parser - to parse the completion of Fast Transfer that ends on Solana.

This PR might seem big but actually 7,339 line of the code are from IDL and test mock data. There is no Devnet Swap Layer now so we would have to mock these data.

We are parsing 6 complete ix:

  1. complete_transfer_direct
  2. complete_transfer_payload
  3. complete_transfer_relay
  4. complete_swap_direct
  5. complete_swap_payload
  6. complete_swap_relay
    and a release_inbound ix

complete_*_payload ix is for dApps building on top of swap layer. It uses staged_inbound as an intermediary account to store the payload, which is released by the release_inbound. Hence there is a need to parse this ix and link it back to the complete_*_payload via staged_inbound pubkey.

TODO:

  • complete_*_relay should have relaying_fee but afaik the only way to find out is through the fill account which is closed at the end, hence we aren't able to grab the fee now. I am in the process of clarifying this with drew and karl but it is the weekend so I will open another PR for this.

watcher/src/fastTransfer/swapLayer/solParser.ts Outdated Show resolved Hide resolved
watcher/src/fastTransfer/swapLayer/solParser.ts Outdated Show resolved Hide resolved
watcher/src/fastTransfer/swapLayer/solParser.ts Outdated Show resolved Hide resolved
watcher/src/fastTransfer/swapLayer/solParser.ts Outdated Show resolved Hide resolved
watcher/src/fastTransfer/types.ts Show resolved Hide resolved
@bingyuyap bingyuyap force-pushed the bing/ft_sol_swap_layer branch 2 times, most recently from 523c651 to dc77bb9 Compare August 17, 2024 11:51
@bingyuyap bingyuyap requested a review from panoel August 17, 2024 12:08
@bingyuyap bingyuyap marked this pull request as ready for review August 17, 2024 15:36
panoel
panoel previously approved these changes Aug 19, 2024
ft_watcher: test: mock tests

ft_watcher: working solana swap layer parser

ft_watcher: fix tests

ft_watcher: fix swap recipients and token balances

ft_watcher: remove unused mock files

ft_watcher: update mock file names

ft_watcher: move getTokenBalance

ft_watcher: clean sol parser

ft_watcher: add batched parseFill

ft_watcher: update names

ft_watcher: minor tweaks

ft_watcher: formatter

ft_watcher: fix tests

ft_watcher: add comment

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
@bingyuyap bingyuyap merged commit 445fe3e into main Aug 26, 2024
3 checks passed
@bingyuyap bingyuyap deleted the bing/ft_sol_swap_layer branch August 26, 2024 15:57
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.

2 participants