Skip to content

Uniswap-inspired automated market-maker (AMM) protocol powered by Smart Contracts on the Orai blockchain.

License

Notifications You must be signed in to change notification settings

oraidex/oraiswap

Repository files navigation

OraiSwap

Uniswap-inspired automated market-maker (AMM) protocol powered by Smart Contracts on the Orai blockchain.

Contracts

Name Description
oraiswap_factory Proxy contract to create oraiswap_pair instance
oraiswap_oracle Global parameters updated by multisig wallet
oraiswap_pair Logic for building liquidity pool and trade between pair
oraiswap_router Facilitate multi-hop swap operations
oraiswap_orderbook Orderbook implementation
oraiswap_staking Stake LPs to get ORAIX reward
oraiswap_token (ERC20 equivalent) token implementation, AIRI, ORAIX
oraiswap_mixed_router Facilitate multi-hop swap operations between v2 & v3

Running this contract

You will need Rust 1.44.1+ with wasm32-unknown-unknown target installed.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown

You can run unit tests on this on each contracts directory via :

cargo unit-test
cargo integration-test

Gen proto definitions

# gen protobuf response.rs
cargo install protobuf-codegen
protoc --rust_out . response.proto
tee -a response.proto << END
impl ::std::convert::TryFrom<&[u8]> for MsgInstantiateContractResponse {
    type Error = ::protobuf::Error;

    fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
       ::protobuf::Message::parse_from_bytes(value)
    }
}
END

# gen proto using prost
# macos
brew install protobuf

cargo install protoc-gen-prost

protoc --prost_out packages/oraiswap/src --proto_path packages/oraiswap/src -I proto packages/oraiswap/src/universal_swap_memo.proto && mv packages/oraiswap/src/_ packages/oraiswap/src/universal_swap_memo.rs

About

Uniswap-inspired automated market-maker (AMM) protocol powered by Smart Contracts on the Orai blockchain.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages