Class TokenomicsModel

java.lang.Object
org.episteme.social.economics.money.TokenomicsModel

public class TokenomicsModel extends Object
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 Details

    • calculateSwapOutput

      public static Real calculateSwapOutput(Real reserveX, Real reserveY, Real dx, Real fee)
      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

      public static Real calculatePriceImpact(Real reserveX, Real reserveY, Real dx)
      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 X
      reserveY - Current reserve of token Y
      dx - Amount of token X input
      Returns:
      Price impact fraction