swap icon indicating copy to clipboard operation
swap copied to clipboard

Eliminate spill for transitive swaps

Open armaniferrante opened this issue 3 years ago • 0 comments

Instead of trying to swap the entire amount given by the client, the program should read the orderbook, calculate the exact amount for the swap (i.e. the max amount such that there is zero spill), and execute it, thereby eliminating the spill surplus given by the connecting quote token (usually usd(x)).

armaniferrante avatar Jun 23 '21 04:06 armaniferrante