This is perps v2, following a completely new financial model, without a vAMM
It's also an updated dev environment, with multichain support and a native SDK in both Typescript and Rust/WASM (no Rust binary sdk yet..)
- Long-form documentation
- Whitepaper
- High level overview
- Slides describing the platform (primarily intended for audit)
- API tutorial in TypeScript
- References docs
- Web interfaces
- Rust
- Docker, used by default for building and optimizing the smart contracts
- just, optional, but a recommended way to perform common tasks
- (optional, for typescript) Node
cargo test
runs the minimal off-chain testsjust cargo-test-check
runs off-chain tests in more configurations and checks the codebasejust build-contracts
will build the WASM files- alternatively,
just build-contracts-native
to bypass Docker and build with native tooling
- alternatively,
just run-localosmo
launches a local Osmosis instanceCOSMOS_WALLET
env var should be set to the correct seed phrasejust local-deploy
deploys a copy of the contracts to your Local Osmosisjust contracts-test
will launch Local Osmosis, deploy contracts to it, and then run on-chain tests
cargo test --features proptest
runs prop testscargo install cargo-fuzz
to install the fuzz testing tooljust fuzz
- Juno: https://docs.junonetwork.io/validators/joining-the-testnets#get-some-testnet-tokens
- Osmosis: https://faucet.osmosis.zone/#/
Deploying is handled via the perps-deploy
tool, located in the
packages/perps-deploy
directory. The perps-deploy.md includes
more details of how deployments work, this file covers the direct
steps.
When you deploy, you'll need to have the deployer seed phrase. This is available in a Google Drive sheet. You'll also need to choose which contract family you want to deploy, e.g. dragonci
, dragondev
, dragonqa
. Let's assume you'll be deploying dragonci
.
- Build the WASM contracts:
just build-contracts
- Or, with native tools:
just build-contracts-native
- Or, with native tools:
- Set your seed phrase to an environment variable:
export COSMOS_WALLET="deployer seed phrase"
- Set the appropriate contract family:
export PERPS_FAMILY=dragonci
- Store the WASM code on the blockchain:
cargo run --bin perps-deploy testnet store-code
- To deploy a fresh set of contracts:
cargo run --bin perps-deploy testnet instantiate
- To migrate an existing set of contracts:
cargo run --bin perps-deploy testnet migrate
- Install cargo-llvm-cov
- Install llvm-tools-preview component from rustup:
❯ rustup component add llvm-tools-preview
Build coverage report by running off chain tests under different configurations:
❯ just off-chain-coverage
...
Then based on the kind of output you want, run these recipies:
- For an HTML based report:
❯ just off-chain-html-coverage
- For a summary on the terminal:
❯ just off-chain-term-coverage