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

Simplified Liquidator #271

Merged
merged 6 commits into from
Jun 6, 2022
Merged

Conversation

asselstine
Copy link
Contributor

  • User now sets an arb target and max slippage
  • whenever user wants to swap, first it runs a buyback then swaps.

- User now sets an arb target and max slippage
- whenever user wants to swap, first it runs a buyback then swaps.
@linear
Copy link

linear bot commented May 19, 2022

ArbTarget.md Outdated
@@ -0,0 +1,22 @@
Slippage: 5%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this file to the docs or in Notion. Very informative but it doesn't really have it's place in this repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops!

});
return true;
}

function setPrizePoolLiquidationState(IPrizePool _prizePool, int256 deltaRatePerSecond, int256 maxSlippage) external {
poolLiquidatorStates[_prizePool].deltaRatePerSecond = PRBMath.SD59x18(deltaRatePerSecond);
function setPrizePoolLiquidationState(IPrizePool _prizePool, int256 maxSlippage) external {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function setPrizePoolLiquidationState(IPrizePool _prizePool, int256 maxSlippage) external {
function setPrizePoolLiquidationState(IPrizePool _prizePool, int256 _maxSlippage) external {

})

it('should revert if there is insufficient balance', async () => {
await expect(liquidatorLibHarness.swapExactAmountOutAtTime(toWei('50'), toWei('100'), '10'))
await expect(liquidatorLibHarness.swapExactAmountOut(toWei('50'), toWei('100')))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to test for slippage too.

@PierrickGT PierrickGT merged commit ac24259 into staging Jun 6, 2022
@PierrickGT PierrickGT deleted the pool-2287-simplify-prize-pool-liquidator branch June 6, 2022 19:49
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