Pinned Tweet
Introducing DeFiMath - high-performance, open-source Solidity library designed for Ethereum smart contracts. It provides optimized, gas-efficient implementations of core DeFi primitives and mathematical utilities—built with precision and performance in mind.
Follow: @defi_math
Fast exponential in Solidity: a step-by-step tutorial on how it works. Follow @defi_math for more Solidity tips!
Exponential function in Solidity, 289 gas.
Two-stage range reduction shrinks the input to an interval of width 0.0108. On that sliver a Padé[3/3] is accurate to 1.7e-19 - so the approximation isn't what limits precision. Fixed-point truncation is.
defimath.com/blog/solidity-e…
2
18
Bachelier model for options is next to come, follow @defi_math for more updates!
DeFiMath v4.1.0 is out.
New: stdNormPDF — the standard normal density φ(x), in Solidity.
⛽ 320 gas
🎯 3.0e-16 max abs error
2.4× cheaper than the next on-chain impl, and ~half the cost of Φ(x)
Drop-in from v4.0.0.
npm i defimath-lib
defimath.com/docs/math/stdno…
32
More Solidity derivatives in the pipeline, follow @defi_math for more updates!
On-chain options on futures just got cheap.
DeFiMath v4.0.0 ships Black-76: European call/put on a future, full Greeks, and an IV solver — a call in 2,552 gas, 5e-12 precision, pure Solidity.
defimath.com/docs/black-76/
1
4
60
You can DM us for direct support if you want to use DefiMath
Building options, perps, or structured products on EVM?
The math shouldn’t be your gas bottleneck.
DeFiMath: Black-Scholes in 2,729 gas, plus the cheapest exp/ln/sqrt primitives in Solidity. Open source.
defimath.com
8
Sqrt function was good enough for finance/quant applications, now it can be used just about anywhere.
Follow @defi_math, more innovation in pipeline!
DeFiMath v3.5.0 → three input ceilings widened to their mathematical limit:
• sqrt: 1.21e42 → 1.158e59 (~10¹⁷×)
• Options MAX_EXPIRATION: 2y → 32y
• Binary MAX_EXPIRATION: 2y → 32y
Same precision, same gas, no API change.
defimath.com
10
If you are a DeFi dev looking for Black Scholes, Greeks or IV solver, we got you: 👇👇👇
DeFiMath v3.4.0 shipped 🚢
Pure-Solidity library for on-chain options pricing:
• Black-Scholes + full Greeks + IV solver
• Up to 5× cheaper than alternatives
• Sub-1e-12 precision, MIT-licensed, zero deps
• Now with property-based fuzz testing — 2.94M random executions per CI run
github.com/MerkleBlue/defima…
40
Unlocking new features for #DeFi by sheer gas-optimization: you can now run Black-Scholes 10 times in the same transaction for less than 30k gas. Amazing!
DeFiMath 3.0.0 🚀
Two new on-chain modules now shipping:
📈 Rates — compounding, present value, IRR, YTM
📊 Stats — volatility, Sharpe, VaR/CVaR, max drawdown
Plus Black-Scholes at 2,876 gas and every precision number re-validated against independent references.
npm i defimath-lib
1
24
Merkle Blue retweeted
DeFiMath v1.0.4 is now shipped. Every function in the library got faster:
ln 508 → 375 (-26%)
sqrt 344 → 245 (-29%)
log2/log10 524 → 391 (-25%)
pow 885 → 750 (-15%)
options call 2927 → 2867
binary call 2142 → 2082
Bit-exact precision preserved against the JS reference. Cheapest Black-Scholes on EVM, now cheaper.
Merkle Blue retweeted
DeFiMath just got better - we added binary option pricing model, and it's really fast: only 2300 gas for cash-or-nothing call or put.
Great for prediction markets. Unlocks onchain calculations for autonomous contracts.
Check out our repo here: github.com/MerkleBlue/defima…
More stuff to come. DefiMath is the fastest Solidity library for math and derivatives. If you are building something on Ethereum, you should check it out now:
We just added one more math function - pow()
As always, the focus was to implement it to be as fast as possible, without sacrificing precision.
DefiMath's derivatives and math library is here:
github.com/MerkleBlue/defima…
7
Merkle Blue retweeted
Gamma Options keeps innovating in #DeFi space!
Navigating the complexities of market making in option markets? No stress, Gamma Options has your back! #OptionsTrading #MarketMaking
Thread bellow 👇👇👇
Merkle Blue retweeted
Check out Gamma Options's profile on @startupbaseio :
startupbase.io/startups/gamm…
Merkle Blue retweeted
(1/9) Discover the Fee Structure of Gamma Options' #DeFi Trading in this comprehensive guide.
📚 Dive into the world of trading with insights and tips!
Read here: doc.gammaoptions.com/docs/fu…
Merkle Blue retweeted
1/ 🚀 Diving into the Gamma Options Margin System! 🧠💡 Before we dive deep, it's crucial to understand three foundational terms. Ready to elevate your understanding? 🚀 Scroll down!
Merkle Blue retweeted
🚀 Curious about how #GammaOptions utilizes the power of Ethereum blockchain for European options trading? Dive into the intricacies of our margin system! ⛓️📈
Thread below 👇
Let's start with fundamentals 👇👇👇
Ever wondered how to hedge against wild #crypto volatility? Dive into the world of crypto options trading and discover new strategies to manage your risk! 📉🚀 #OptionsTrading
11
Merkle Blue retweeted
Create ERC777 token in less than 2 minutes: youtube.com/watch?v=oBA8K_8v…
Merkle Blue retweeted
Ha this Hayek quote is on video "don't believe we shall ever have a good money again before we take the thing out of the hands of government, we can't take it violently out of the hands of govt, all we can do is by some sly roundabout way introduce something that they can't stop"








