GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Shouldn't fees be excluded when estimating the price impact? · Issue #310 · uniswap-python/uniswap-python Open DescriptionIn https://github.com/uniswap-python/uniswap-python/blob/master/uniswap/uniswap.py#L1879:L1920
In Uniswap Interface, they refer to this 'accurate price impact' as 'realised', and indeed it gets calculated by taking the price impact, and subtracting the fees from it: export function computeRealizedPriceImpact(trade: Trade<Currency, Currency, TradeType>): Percent { const realizedLpFeePercent = computeRealizedLPFeePercent(trade) return trade.priceImpact.subtract(realizedLpFeePercent) } Where Note, that Uniswap Interface uses the Auto Router, which could carry out a single trade through different swaps, meaning that there would be multiple fees that need to be taken into account, hence the fee_percentage = fee / 1000000 return float((price_small - price_amount) / price_small - fee_percentage ) Hence:
Reacted by Julian Schoen and Erik Bjäreholt Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |