Alpha software

The latest version of the SDK is used in production in the Premia Interface, but it is considered Alpha software and may contain bugs or change significantly between patch versions. If you have questions about how to use the SDK, please reach out in the #engineering channel of the Discord.

Pull requests are welcome!

Premia V3 SDK

Unit Tests Lint npm version npm bundle size (scoped version)

In-depth documentation on this SDK is available at premia.finance.

Dev Setup

  1. Set NPM auth token environment variable through command line, NPM_TOKEN, necessary for using the .npmc file. (you can store the variable locally in the .env file)
  2. Add API_KEY_ALCHEMY and PKEY_ETH_TEST to a .env file (see example)
  3. Ensure the latest ABI's are used in the ./src/abi folder
  4. Run yarn install to download dependencies
  5. Make sure to run chmod ug+x .husky/* to make the husky precommit script an executable.
  6. Run yarn postinstall to set up and install husky.

Anvil Setup

In order to use Anvil as a local blockchain for dev purposes, Forge needs to be installed. Instructions on how to install are here.

Forking Arbitrum Goerli

  1. Make sure ABI's reflect the same copy as the ones deployed on the Georli Network
  2. Determine the blocknumber inwhich new contracts were deployed (fork must be after this blocknumber)
  3. Forking Georli -> type the following into terminal to launch anvil fork of Georli: anvil --fork-url https://arb-goerli.g.alchemy.com/v2/NNaDMKJ64XmaH_zVzjX0GQLTFQlKLx3K --fork-block-number <INSERT BLOCK NUMBER>
  4. After running the fork use ctrl + z to pause and then type bg to run the fork in the background
  5. Run unit test by running yarn test through the command line

Contract Deployments

  • 2023-04-24 (Goerli): ~8883219

  • 2023-05-11 (Goerli): ~8983750

  • 2023-05-17 (Goerli): ~9016327

  • 2023-05-22 (Goerli): ~9041200

  • 2023-05-27 (Goerli): ~9069700

  • 2023-05-30 (Goerli): ~9094334

  • 2023-06-03 (Goerli): ~9117574

  • 2023-06-05 (Arbitrum Goerli): ~19452000

  • 2023-06-09 (Arbitrum Goerli): ~25083922

  • 2023-07-12 (Arbitrum Goerli): ~30175019

Generated using TypeDoc