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

Add SwapperCalleePsm #66

Merged
merged 8 commits into from
Nov 8, 2023
Merged

Add SwapperCalleePsm #66

merged 8 commits into from
Nov 8, 2023

Conversation

telome
Copy link
Collaborator

@telome telome commented Oct 10, 2023

Some open questions:

  • do we want to automatically fill() the PSM buffer when there is not enough dai available to be bought? Currently leaning towards no as large swaps by facilitators can call fill() manually and small swaps via StableSwapper may assume that keepers are regularly filling the PSM buffer. Swaps via StableSwapper may also be less common than for the UniV3 callee given that there is no slippage risk to mitigate here.

  • do we want to use the data of the swapCallback() to pass the PSM address (and therefore support multiple PSMs more easily)? Currently leaning towards no as only the USDC PSM is currently considered and passing the PSM address as data implies additional swap costs.

  • do we need a token recovery method in case the wrong gem is sent to the callee? Probably not necessary as only swappers are going to be warded callers of swapCallback().

test/mocks/PsmMock.sol Outdated Show resolved Hide resolved
test/mocks/PsmMock.sol Outdated Show resolved Hide resolved
test/mocks/PsmMock.sol Outdated Show resolved Hide resolved
test/mocks/PsmMock.sol Outdated Show resolved Hide resolved
test/mocks/PsmMock.sol Outdated Show resolved Hide resolved
test/mocks/PsmMock.sol Outdated Show resolved Hide resolved
Copy link
Collaborator

@sunbreak1211 sunbreak1211 left a comment

Choose a reason for hiding this comment

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

do we want to automatically fill() the PSM buffer when there is not enough dai available to be bought?...
I'd keep it simple as it is.

do we want to use the data of the swapCallback() to pass the PSM address (and therefore support multiple PSMs more easily)?
I like as it is.

do we need a token recovery method in case the wrong gem is sent to the callee? Probably not necessary as only swappers are going to be warded callers of swapCallback().
Yeah, if following the regular path, this should not happen, as otherwise it would revert. We can't ofc prevent that anyone is sending tokens, but I think we shouldn't prevent that.

LGTM.

Copy link
Collaborator

@oldchili oldchili left a comment

Choose a reason for hiding this comment

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

LGTM

@telome telome merged commit 7268b57 into dev Nov 8, 2023
2 checks passed
@telome telome deleted the psm-callee branch November 8, 2023 12:08
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.

3 participants