Description
When a user executes a 3-hop trade (e.g., Asset A -> Asset B -> Asset C), our current logic emits a separate SwapEvent for every single hop.
Publishing multiple events to the Stellar ledger in a single transaction burns unnecessary gas and forces our indexer to reconstruct the final trade manually.
We need to aggregate the overall input and final output into a single, unified MultiHopSwap event.
This saves users money on ledger rent and simplifies our backend data architecture.
Requirements
Description
When a user executes a 3-hop trade (e.g., Asset A -> Asset B -> Asset C), our current logic emits a separate
SwapEventfor every single hop.Publishing multiple events to the Stellar ledger in a single transaction burns unnecessary gas and forces our indexer to reconstruct the final trade manually.
We need to aggregate the overall input and final output into a single, unified
MultiHopSwapevent.This saves users money on ledger rent and simplifies our backend data architecture.
Requirements
Symbol("MultiHopSwap").swap_exact_tokens_for_tokensfunction, track the initialamount_inand the finalamount_out.Vec<Address>path that the trade took.