Add marginal price capability and update integration tests

Balancer now passes the test
Some misc aesthetics
This commit is contained in:
czanella
2024-07-18 16:12:50 +01:00
parent ab3723f29b
commit 772566c590
3 changed files with 32 additions and 20 deletions

View File

@@ -188,11 +188,10 @@ contract BalancerV2SwapAdapter is ISwapAdapter {
override
returns (Capability[] memory capabilities)
{
capabilities = new Capability[](4);
capabilities = new Capability[](3);
capabilities[0] = Capability.SellOrder;
capabilities[1] = Capability.BuyOrder;
capabilities[2] = Capability.PriceFunction;
capabilities[3] = Capability.HardLimits;
}
function getTokens(bytes32 poolId)

View File

@@ -33,7 +33,11 @@ interface ISwapAdapterTypes {
ScaledPrices,
// Indicates that if we try to go over the sell limits, the pool will
// revert (optional)
HardLimits
HardLimits,
// Indicates whether the pool's price function can be called with
// amountIn=0 to return the
// current price (optional)
MarginalPrice
}
/// @dev Representation used for rational numbers such as prices.