Swaps that occur on the same chain should be executed in a single transaction with multiple messages.
Doing so results in:
Less NTRN spent on gas
Atomicity (i.e., all atomic legs execute or fail as one)
Both properties would enable greater confidence in the arbitrage bot by allowing for reduced profit margins, and for recovery-less failing of atomic arbs.
Suggested implementation
"Batching" calls for creative thinking within the existing Provider context, as Providers are treated as single per-pool units. One suggested approach is to provide a preview_swap method for each provider that produces the message but not the transaction that it would produce to execute the swap. This way, the messages can be built by the strategy function, or by exec_arb in util.py.
Swaps that occur on the same chain should be executed in a single transaction with multiple messages. Doing so results in:
Suggested implementation
"Batching" calls for creative thinking within the existing
Provider
context, asProvider
s are treated as single per-pool units. One suggested approach is to provide apreview_swap
method for each provider that produces the message but not the transaction that it would produce to execute the swap. This way, the messages can be built by the strategy function, or byexec_arb
inutil.py.