Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: FillAdjustor and clean up JS router and unused functions [TKR-403] #480

Merged
merged 4 commits into from
Jun 29, 2022

Conversation

dekz
Copy link
Member

@dekz dekz commented May 18, 2022

Description

  • Removed the concept of 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 nearest FillData to that amount.
    • This means we no longer need to "collapse" or join those individual fills into a single one.
  • Removed the concept of CollapsedPath
  • In the Rust router flow we'd always create a single Fill. Removed the support for arrays of fills
  • Splits the FeeSchedule and GasSchedule it was confusing to have one transformed into the other.
  • Added gas to the Fill

Samples: Info returned from the Sampling process, mostly input output and FillData
Fill: Total amount we wish to fill on each path, input and output may be modified. Includes adjustedOutput to account for costs.
Path: A collection of Fills. Includes adjustedRate to account for the output and costs

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:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

@dekz dekz force-pushed the feat/refactor-js-router-out branch from a913134 to a42ae30 Compare May 20, 2022 00:22
@dekz dekz changed the title chore: clean up JS router and unused functions [TKR-403] chore: FillAdjustor and clean up JS router and unused functions [TKR-403] May 26, 2022
@dekz dekz force-pushed the feat/refactor-js-router-out branch from bb9ca4a to 03e3897 Compare June 10, 2022 03:29
@dekz dekz marked this pull request as ready for review June 10, 2022 03:49
@dekz dekz force-pushed the feat/refactor-js-router-out branch from 69f0b83 to 6bf210a Compare June 14, 2022 00:11
dekz added 2 commits June 29, 2022 14:03
Clean up JS router and unused functions

Remove more unused functions, add adjustment of fills

Comment on why we use fill over sample

update CODEOWNERS

lint

Clean up Fill removing unused properties

Remove CollapsedFills, omit flags bigint

Create GasSchedule vs FeeSchedule, return Fill and gas on OptimizedOrder

Use Fill Adjustment in Phase2 of routing

Fix Limit orders being treated as VIP
@dekz dekz force-pushed the feat/refactor-js-router-out branch from 6bf210a to 7be187d Compare June 29, 2022 04:03
@dekz dekz force-pushed the feat/refactor-js-router-out branch from 7be187d to c56b2b9 Compare June 29, 2022 04:29
@dekz dekz merged commit ee98524 into development Jun 29, 2022
@dekz dekz deleted the feat/refactor-js-router-out branch June 29, 2022 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant