This repo contains a the Margined Protocol a decentralized perpetual contract protocol for CosmWasm networks.
Contract | Reference | Description |
---|---|---|
Margin Engine | doc | Margin engine that manages users positions and the collateral management |
vAMM | doc | Virtual AMM enabling users to take perpetual positions |
Insurance Fund | doc | Contract that holds funds to cover shortfalls |
Fee Pool | doc | Contract that accrues the fees generated by protocol to be redistributed to $MRG token holders |
Price Feed | doc | Integration contract for the data oracles and other data related logic |
Governance | doc | Todo: Community governance contract that managers the protocol |
Factory | doc | Todo: Manages the deployment and upgrade of perpetual contracts |
- Rust v1.44.1+
wasm32-unknown-unknown
target- Docker
-
Install
rustup
via https://rustup.rs/ -
Run the following:
rustup default stable
rustup target add wasm32-unknown-unknown
- Make sure Docker is installed
Clone this repository and build the source code:
git clone git@github.com:margined-protocol/perpetuals.git
cd perpetuals
cargo build
To run the tests after installing pre-requisites do the following:
cargo test