A simple implementation of a root finding algorithm Numo using the Newton-Raphson method. This was done to test out the Solstat library. Since Numo implements a time-dependent, non-linear trading function that must equal 0. We can quickly solve for liquidity L
, the denominator that normalizes the reserves to ensure F(L) = 0.
A more through explanation of how Newton's method works can be found in my tweet.
$ forge build
$ forge test
$ forge fmt
$ forge snapshot
$ anvil
$ forge script script/deployRootFinder.s.sol:DeployRootFinder --rpc-url <YOUR_RPC_URL> --broadcast --private-key $PRIVATE_KEY
$ cast <subcommand>