-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from BeanstalkFarms/multi-flow-pump-v1.1
Multi Flow Pump v1.1
- Loading branch information
Showing
37 changed files
with
1,261 additions
and
643 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,6 @@ stash | |
lcov.info | ||
.DS_Store | ||
test/output/ | ||
|
||
# Python | ||
__pycache__ |
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import {IWellFunction} from "src/interfaces/IWellFunction.sol"; | ||
|
||
/** | ||
* @title IMultiFlowPumpWellFunction | ||
* @dev A Well Function must implement IMultiFlowPumpWellFunction to be supported by | ||
* the Multi Flow Pump. | ||
*/ | ||
interface IMultiFlowPumpWellFunction is IWellFunction { | ||
/** | ||
* @notice Calculates the `j` reserve such that `π_{i | i != j} (d reserves_j / d reserves_i) = π_{i | i != j}(ratios_j / ratios_i)`. | ||
* assumes that reserve_j is being swapped for other reserves in the Well. | ||
* @dev used by Beanstalk to calculate the deltaB every Season | ||
* @param reserves The reserves of the Well | ||
* @param j The index of the reserve to solve for | ||
* @param ratios The ratios of reserves to solve for | ||
* @param data Well function data provided on every call | ||
* @return reserve The resulting reserve at the jth index | ||
*/ | ||
function calcReserveAtRatioSwap( | ||
uint256[] calldata reserves, | ||
uint256 j, | ||
uint256[] calldata ratios, | ||
bytes calldata data | ||
) external view returns (uint256 reserve); | ||
|
||
/** | ||
* @notice Calculates the rate at which j can be exchanged for i. | ||
* @param reserves The reserves of the Well | ||
* @param i The index of the token for which the output is being calculated | ||
* @param j The index of the token for which 1 token is being exchanged | ||
* @param data Well function data provided on every call | ||
* @return rate The rate at which j can be exchanged for i | ||
* @dev should return with 36 decimal precision | ||
*/ | ||
function calcRate( | ||
uint256[] calldata reserves, | ||
uint256 i, | ||
uint256 j, | ||
bytes calldata data | ||
) external view returns (uint256 rate); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,6 @@ interface IMultiFlowPumpErrors { | |
error NotInitialized(); | ||
|
||
error NoTimePassed(); | ||
|
||
error TooManyTokens(); | ||
} |
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
Oops, something went wrong.