From e3b61e0a1ad3c15600f7e982c18d33252f98b709 Mon Sep 17 00:00:00 2001 From: clemlak Date: Thu, 7 Dec 2023 15:52:29 +0400 Subject: [PATCH] test: update SF and ISF tests --- test/TestG3MCreatePool.t.sol | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/TestG3MCreatePool.t.sol b/test/TestG3MCreatePool.t.sol index f7811115..0857e6e8 100644 --- a/test/TestG3MCreatePool.t.sol +++ b/test/TestG3MCreatePool.t.sol @@ -4,6 +4,26 @@ pragma solidity ^0.8.4; import "./Setup.sol"; contract TestG3MCreatePool is Setup { + using FixedPointMathLib for *; + + function test_SF_computeISF() public view { + uint256 x = 0.05 ether; + uint256 y = G3MStrategyLib.computeISFunction(x); + console.log(y); + } + + function test_SF_computeSF() public view { + uint256 w0 = 0.05 ether; + uint256 w1 = 0.9 ether; + uint256 t = 0.5 ether; + uint256 fw0 = G3MStrategyLib.computeISFunction(w0); + console.log(fw0); + uint256 fw1 = G3MStrategyLib.computeISFunction(w1); + console.log(fw1); + uint256 weightX = G3MStrategyLib.computeSFunction(t, fw1 - fw0, fw0); + console.log(weightX); + } + function deployTokens( IPortfolio subject, bool createPair