Closed nagakingg closed 1 year ago
The coverage rate went from 76.03%
to 75.64%
:arrow_down:
The branch rate is 62%
.
29.62%
of new lines are covered.
The simple pipeline CI is unaffected by these changes, except for the price_error values, which differ slightly due to the new computation.
For the volume limited pipeline, the results change slightly. Qualitatively, they look pretty similar but perhaps slightly denoised.
The comparison is simlar for TriCRV, except that the price errors come out quite noisy. Since the price errors are reduced using the new computation, this may reflect a noise floor. But I wonder if its better to record price errors as percect deviation from each target price. Currently they are absolute, which probably makes less sense for v2 pools.
I wonder if its better to record price errors as percect deviation from each target price
Indeed, dividing each price error by the target price cleans up the price error plots considerably:
Description
Fixes #223 -- trades are excluded from optimization in multipair_optimal_arbitrage if their volume limit is <=
pool.get_min_trade_size()
.Additionally, trades are excluded from optimization in get_arb_trades if the optimal trade size is less than
pool.get_min_trade_size()
(i.e., the minimum trade size would cause the pool price to become less than the target market price). In this case, a trade in the right direction, but with size 0 is returned. This prevents similar errors as those discussed in #223, and prevents trades that are smaller than a pool's min trade size, but within the single-trade optimization inget_arb_trades
.Important change with downstream effects: Previously, if no profitable arb was available for a particular pair,
get_arb_trades
would return a trade with size 0 in whatever direction the coin symbols were listed in. E.g., if market prices were indexed as (ETH, BTC), it would return a 0 trade with ETH as coin in and BTC as coin out. This had downstream effects for multipair_optimal_arbitrage (because only trades in that direction were allowed in the multi-trade optimization) and subsequent price error calculations (because price error was always computed in that arbitrary direction).With these changes, if no profitable arb is available (give the minimum trade size), a trade with size 0 in the more profitable direction is returned. This allows 'multipair_optimal_arbitrage' to make trades in that direction if they become available after previous trades in each optimizer iteration, and causes price error to always be computed in the direction of the best possible trade.
Additional changes:
Hygiene checklist
Cute Animal Picture