Erlang and AMM Verification

The AMM, as described here, that we are using is a modification of the Wombat algorithm. This algorithm was designed to provide stablecoin trading with some elasticity to leverage the trading pools, while having little slippage when trading near equilibrium. It also contains a mechanism for preventing arbitrage attacks.

The algorithm was modified to allow for exchange rates to be specified that describe the relative value of the traded commodities as might be present in a global currency exchange market. Because the algorithm was modified, it is important to ensure that the desired characteristics of the underlying model have not changed. Unfortunately, standard testing tools are not necessarily appropriate for this type of testing.

A solution is to design a series of tests that will use statistical methodology to analyze the results of transactions, and ensure they meet the specifications. These tests then are implemented in a custom stand-alone tool that executes them, validating that the new algorithm has the desired characteristics.

The specific test routine implemented for this demonstration validates the following features:

  • Each trade executed results in a net gain in total asset value for the AMM, ensuring a profit
  • As the pool balances stray from equilibrium, their relative prices adjust to account for their relative scarcity
  • Performing a large series of trades in both directions that are ultimately balanced in amounts in each direction leave the AMM at or near equilibrium

Test Tool In Action

Contact

Contact us for pricing to help you with your project.
We work on an hourly basis and/or project milestone.
admin@auctoritas.tech