cfmms-rs icon indicating copy to clipboard operation
cfmms-rs copied to clipboard

Integrate Batched Calls in v3 Swap simulation

Open 0xOsiris opened this issue 2 years ago • 0 comments

simulate_swap and simulate_swap_mut both require two external calls to the node to retrieve the Tick.Info and the word corresponding to tickBitmap[currentTick] during simulation. Two separate calls are made each time an initialized tick in crossed.

This can be optimized by batching the two calls into a single call to the node as both calls can happen in parallel. I think this will be most easily accomplished by abstracting the calls to the node outside of uniswap_v3_math into cfmms-rs.

0xOsiris avatar Jan 20 '23 18:01 0xOsiris