@polymarket/amm-maths
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Polymarket AMM Maths

This package contains a number of functions to calculate the effects of interactions with the Conditional Tokens Market Makers used by Polymarket.

Note: A number of utility functions from https://github.com/protofire/omen-exchange have been included in this package which were then adapted where necessary.

Running tests

To run the tests, follow these steps. You must have at least node v10 and yarn installed.

First clone the repository:

git clone https://github.com/TokenUnion/amm-maths.git

Move into the uniswap-sdk working directory

cd amm-maths/

Install dependencies

yarn install

Run tests

yarn test

You should see output like the following:

yarn run v1.22.4
$ jest
 PASS  test/trading.test.ts
 PASS  test/liquidity.test.ts
 PASS  test/price.test.ts

Test Suites: 3 passed, 3 total
Tests:       64 passed, 64 total
Snapshots:   0 total
Time:        1.05 s
Ran all test suites.
Done in 1.64s.

Package Sidebar

Install

npm i @polymarket/amm-maths

Weekly Downloads

23

Version

0.3.0

License

MIT

Unpacked Size

39.5 kB

Total Files

48

Last publish

Collaborators

  • niraek
  • poly-rodr
  • mshrieve
  • dylangolow
  • esinger93457
  • jonamen
  • l-kov
  • sherrbss
  • mttwlkr