Skip to content

Commit

Permalink
feat: update computeWeights function
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Dec 7, 2023
1 parent 823974e commit caf0e34
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions contracts/strategies/G3MStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ contract G3MStrategy is IG3MStrategy {

function computeWeights(uint64 poolId)
internal
returns (uint256, uint256)
returns (uint256 weightX, uint256 weightY)
{
PortfolioPool memory pool = IPortfolioStruct(portfolio).pools(poolId);

Expand All @@ -262,9 +262,7 @@ contract G3MStrategy is IG3MStrategy {
uint256 fw0 = G3MStrategyLib.computeISFunction(pool.startWeightX);
uint256 fw1 = G3MStrategyLib.computeISFunction(pool.endWeightX);

uint256 weightX = G3MStrategyLib.computeSFunction(t, fw1 - fw0, fw0);
uint256 weightY = WAD - weightX;

return (weightX, weightY);
weightX = G3MStrategyLib.computeSFunction(t, fw1 - fw0, fw0);
weightY = WAD - weightX;
}
}

0 comments on commit caf0e34

Please sign in to comment.