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

New BatchLiquidator optimized for L2 rollups #179

Merged
merged 20 commits into from Mar 15, 2023
Merged

New BatchLiquidator optimized for L2 rollups #179

merged 20 commits into from Mar 15, 2023

Conversation

ngmachado
Copy link
Collaborator

@ngmachado ngmachado commented Mar 8, 2023

Use the new BatchLiquidator contract: superfluid-finance/protocol-monorepo#1306
reduces cost on L2s.

  • add to ethereum-contracts package and update the dependency here (this was blocked by the npm package release which is blocked by a subgraph re-indexing to finish, not waiting for it any longer)
  • always use the batch interface (instead of host interface) on L2s (even if batch size is 1)
  • deploy to all mainnets, and update metadata dependency

@ngmachado ngmachado mentioned this pull request Mar 8, 2023
3 tasks
@d10r d10r changed the title L2 rollups New BatchLiquidator optimized for L2 rollups Mar 9, 2023
@d10r
Copy link
Collaborator

d10r commented Mar 9, 2023

results on Optimism:
1 liquidation via host: 6350 L1 gas
1 liquidation via new batch: 4900 L1 gas
2 liquidations via new batch: 6200 L1 gas
2 liquidations via old batch: 7000 L1 gas
9 liquidations via new batch: 11400 L1 gas

We could further optimize the cost for popular SuperTokens by deploying BatchLiquidator contracts specific to them, such that the SuperToken address can also be omitted from calldata. Could be implemented in a way similar to how canonical SuperToken wrappers were done in SuperTokenFactory.

@d10r
Copy link
Collaborator

d10r commented Mar 13, 2023

@ngmachado please check if you can simplify liquidator.js - merge singleTerminations() and sendBatch() into one function.
Also revisit the terminology as discussed. Now there's work, batch, , batchWork, termination, liquidations.
Can probably be simplified to less terms, also reusing a term in plural form for lists/arrays of it.

@d10r d10r self-requested a review March 15, 2023 09:44
@d10r d10r merged commit b8a1925 into master Mar 15, 2023
1 check passed
@d10r d10r deleted the l2_rollups branch March 15, 2023 09:59
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.

None yet

2 participants