Skip to content

Contract code for leveraged pools and their tokens on Terra network

License

Notifications You must be signed in to change notification settings

SpaceCamp-Leverage-Tokens/leveraged_pools

Repository files navigation

Leveraged Tokens on Terra network

Concept for zero-sum leveraged trading pools on Terra network. Allows traders to swap leveraged Cw20-stablecoin pairs like mTSLA-UST 3x; zero-sum allows for arbitrarily-high leverage on stablecoin-stablecoin pairs like UST-KRT.

Created for Terra's Spacecamp hackathon; our page is here.

Contracts

The source code for each contract is in the contracts/ directory.

Name Description
leveraged_pool Pool providing leverage on a token
factory Create leveraged pools
leverage_governance WIP
forex_pool Very high-leverage & very WIP

Contracts created from this repository are available on the bombay-10 test network at the below addresses:

Contract Name Address
Factory terra16sjkmp79wku8hg3su7uqxqgm9770r0ddz8kdq8
mTSLA 2x leverage pool terra14kqxdu9rv97dhrwq3ns444rnwhzz0s72k0nt7d
MIR 3x leverage pool terra1kn9e6pmcqsynkmu4vra4wmxv0f4f5m356ul6re

Minting a leveraged position requires access to the mocked MIR or mTSLA assets which back the leveraged positions.

Building

Building is facilitated by a shell script in this repository (./build_artifacts.sh) which uses the cosmwasm/workspace-optimizer Docker container to build artifacts that are optimized for deployment on Terra network. It also builds all schemas and enforces the rule that all unit-tests must pass.

Here are the steps for building artifacts from scratch:

git clone https://github.com/SpaceCamp-Leverage-Tokens/leveraged_pools
cd leveraged_pools
cargo build --all
./build_artifacts.sh

License

All code is under the very permissive MIT License (available in the source tree as /LICENSE) so pretty much do whatever you want.

About

Contract code for leveraged pools and their tokens on Terra network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published