Open NIXBNT opened 4 months ago
Why are there rows with no fee in them? Why is this issue relevant only for univ2 exchanges? There are other exchanges in this file with no fee defined for them. If this issue is relevant only for univ2, then why are there other exchanges for which there are some rows with fee and some rows without fee? Logically, it sounds like for each exchange, either the fee should be included in every row or omitted from every row.
This issue needs to be resolved from the cause root. Either by removing lines with invalid data, or by updating them to consist of valid data.
PR #607 attempts to do so by removing lines with fork=univ2 and no fee. But there are a few doubts remaining:
Why are there rows with no fee in them?
The fee is not required for every exchange since its only hardcoded for uniswapv2. I.e. passing the fee for uniswap v3 makes no sense since fees are decided at the pool level not the contract level
Why is this issue relevant only for univ2 exchanges?
I believe (might need to check me on this) but uniswap_v2 forks are the only ones that require the fee to be read in here because its hardcoded at the contract level and thus unreadable in a dynamic sense. So in essence, the fee here for univ2 is the single source of truth for univ2 fork fee in the bot.
There are other exchanges in this file with no fee defined for them.
As above, we could consider passing NA but I dont know the implications of passing 0 instead of None.
If this issue is relevant only for univ2, then why are there other exchanges for which there are some rows with fee and some rows without fee? Logically, it sounds like for each exchange, either the fee should be included in every row or omitted from every row.
I think this is adequately described above.
This issue needs to be resolved from the cause root. Either by removing lines with invalid data, or by updating them to consist of valid data.
Absolutely. Since the multichain_addresses.csv can only be populated manually, it is possible to make human error entering the data. The root cause is human error in this case and so I suggest that we have an early failure or at least very visible warning that alerts users to the fact that the data isnt populated correctly.
PR #607 attempts to do so by removing lines with fork=univ2 and no fee. But there are a few doubts remaining:
- Should these lines perhaps be instead updated to consist of valid data?
- Should other lines in this file be updated to consist of valid data?
- Should other lines in this file be removed?
- Should other lines in any other file be updated to consist of valid data?
- Should other lines in any other file be removed?
I think this PR has since been closed but nevertheless, yes the lines should be flagged as incorrect so that the can be updated manually (as there is no way to automate this). Yes we can/should review the file contents entirely. No other files are not relevant
Is your feature request related to a problem? Please describe. Univ2 forks without fee specified in multichain_addresses.csv cause trade calculation failures. Since this is a known issue, any univ2 forks without fees should be flagged early in the process.
Describe the solution you'd like When the multichain_addresses.csv is read in, any univ2 forks without a specified fee should raise an error immediately
Additional context In the current bot process, the absence of the fee isnt noticed until an arbitrage is found, and the calculate_trade_outputs function is called. At which point a sensible input (trade) amount is converted to a NaN throwing a large error.
^ that NaN part fills the entire terminal output :)