-
Notifications
You must be signed in to change notification settings - Fork 50
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
Conversation
asselstine
commented
May 19, 2022
- 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.
ArbTarget.md
Outdated
@@ -0,0 +1,22 @@ | |||
Slippage: 5% |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops!
contracts/PrizePoolLiquidator.sol
Outdated
}); | ||
return true; | ||
} | ||
|
||
function setPrizePoolLiquidationState(IPrizePool _prizePool, int256 deltaRatePerSecond, int256 maxSlippage) external { | ||
poolLiquidatorStates[_prizePool].deltaRatePerSecond = PRBMath.SD59x18(deltaRatePerSecond); | ||
function setPrizePoolLiquidationState(IPrizePool _prizePool, int256 maxSlippage) external { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'))) |
There was a problem hiding this comment.
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.