Class TokenomicsModel
java.lang.Object
org.episteme.social.economics.money.TokenomicsModel
Models token engineering and cryptocurrency dynamics (Tokenomics).
Includes models for Automated Market Makers (AMM) and supply curves.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
-
Method Details
-
calculateSwapOutput
Constant Product AMM formula (x * y = k). Calculates the amount of tokens received when swapping 'dx' amount of token X.- Parameters:
reserveX- Current reserve of token X in the pool.reserveY- Current reserve of token Y in the pool.dx- Amount of token X being swapped in.fee- Fee percentage (0.0 to 1.0, e.g., 0.003 for 0.3%).- Returns:
- The amount of token Y received (dy).
-
calculatePriceImpact
Calculates the price impact of a trade on a Constant Product AMM. Price Impact = (Price_new - Price_old) / Price_old- Parameters:
reserveX- Current reserve of token XreserveY- Current reserve of token Ydx- Amount of token X input- Returns:
- Price impact fraction
-