-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement Public Allocator #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adhusson
force-pushed
the
feat/flows-and-eth-fee
branch
from
February 6, 2024 18:52
00a9a97
to
f124a1d
Compare
MathisGD
reviewed
Feb 11, 2024
adhusson
force-pushed
the
feat/flows-and-eth-fee
branch
from
February 12, 2024 15:22
a8041e4
to
19d17d2
Compare
Closed
adhusson
changed the title
feat: allocator with min/max flows and ETH fee
feat: allocator with min/max flows, subcaps and ETH fee
Feb 12, 2024
adhusson
force-pushed
the
feat/flows-and-eth-fee
branch
from
February 13, 2024 13:10
7bea44b
to
652f499
Compare
Merged
Co-authored-by: Romain Milon <rmilon@gmail.com> Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
via ir build
remove subcap
reorder functions
recover lost branch
MathisGD
previously approved these changes
Feb 20, 2024
MerlinEgalite
previously approved these changes
Feb 20, 2024
Jean-Grimal
previously approved these changes
Feb 20, 2024
QGarchery
previously approved these changes
Feb 20, 2024
Co-authored-by: Quentin Garchery <QGarchery@users.noreply.github.com> Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
MathisGD
dismissed stale reviews from QGarchery, Jean-Grimal, MerlinEgalite, and themself
via
February 20, 2024 14:53
14f4eb8
MathisGD
approved these changes
Feb 20, 2024
MerlinEgalite
approved these changes
Feb 20, 2024
QGarchery
approved these changes
Feb 20, 2024
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
tldr
Main function is
reallocateTo(Withdrawal[] calldata withdrawals, MarketParams calldata supplyMarketParams)
, it is callable by anyone.withdrawals
is a list of(market,amount)
pairs. The function will try to withdraw the givenamount
from each market and then deposit the total withdrawn todepositMarketParams
, subject to admin-settable constraints.Max flows
Each market has a max inflow (
maxIn
) and a max outflow (maxOut
). For every call toreallocateTo
:withdrawals
increase theirmaxIn
and decrease theirmaxOut
by the amount withdrawn.depositMarketParams
increases itsmaxOut
and decreases itsmaxIn
by the total withdrawn.The owner can configure the max inflows/outflows.
Supply caps
Each market has a supply cap that works like MetaMorpho's supply caps. The owner can configure the caps.
Fee
The
PublicAllocator
has a fee (payable in ETH). The owner can configure the fee. The owner must calltransferFee
to take the accumulated fees out of thePublicAllocator
.Checks
The
PublicAllocator
will make the following checks whenreallocateTo
is called:maxIn
ormaxOut
is exceeded.