chore: FillAdjustor and clean up JS router and unused functions [TKR-403] #480
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fill
parents or having an array of fills for the path. The Rust router just returns the amount to fill against that path and we find the nearestFillData
to that amount.CollapsedPath
FeeSchedule
andGasSchedule
it was confusing to have one transformed into the other.gas
to theFill
Samples: Info returned from the Sampling process, mostly
input
output
andFillData
Fill: Total amount we wish to fill on each path,
input
andoutput
may be modified. IncludesadjustedOutput
to account for costs.Path: A collection of Fills. Includes
adjustedRate
to account for theoutput
andcosts
In c56b2b9 we are now adjusting our FEE SOURCES which use use to calculate costs (in maker/taker assets). During sampling we perform a lite check for ETH/makerToken and ETH/takerToken. Then we can go gas * gasPrice -> makerTokenAmount
Previously we took the median, which was ok when liquidity was fairly spread out. But as liquidity for certain pairs begins to centralize, it is likely better to find the best price, adjusted for cost. Adjusting for cost will help us remove super expensive pools, like some of the big curves, which aren't worth arbing.
Testing instructions
Types of changes
Simbot as at a42ae30
Checklist:
[WIP]
if necessary.