Go to file
armaniferrante feebf9d3de
dex-fuzz: Update Solana SDK version
2020-10-31 11:02:45 -07:00
assert-owner assert-owner: Cargo fmt to fix build 2020-10-26 09:50:38 -07:00
common Employ RpcSendTransactionConfig::default() for better forward compatibility (#39) 2020-10-23 11:58:56 -07:00
crank Employ RpcSendTransactionConfig::default() for better forward compatibility (#39) 2020-10-23 11:58:56 -07:00
dex dex-fuzz: Update Solana SDK version 2020-10-31 11:02:45 -07:00
docker Run wholeshebang in CI 2020-09-19 13:08:24 -07:00
docs docs: Registry draft design 2020-10-13 14:59:06 -07:00
lockup lockup: Whitelist program-derived-addresses (#27) 2020-10-12 21:25:19 -07:00
node Employ RpcSendTransactionConfig::default() for better forward compatibility (#39) 2020-10-23 11:58:56 -07:00
registry lockup: CLI, whitelist, and relay transfers (#23) 2020-10-10 22:36:32 -07:00
scripts/travis Node registry (#15) 2020-10-02 12:42:48 -07:00
solana-client-gen Employ RpcSendTransactionConfig::default() for better forward compatibility (#39) 2020-10-23 11:58:56 -07:00
.gitignore Run cargo fix on crank 2020-10-12 22:43:49 -07:00
.travis.yml travis: Fix node version 2020-10-20 12:45:25 -07:00
Cargo.lock Add assert-owner program 2020-10-26 18:27:47 +08:00
Cargo.toml Add assert-owner program 2020-10-26 18:27:47 +08:00
LICENSE Add license (#18) 2020-10-03 10:33:06 -07:00
Makefile lockup: CLI, whitelist, and relay transfers (#23) 2020-10-10 22:36:32 -07:00
README.md Add badges and adjust readme headers (#19) 2020-10-03 17:50:42 -07:00
bpf-sdk-install.sh Use https to install bpf sdk 2020-09-22 17:58:57 +00:00
do.sh Initial release 2020-09-09 12:14:15 +00:00

README.md

serum-dex

Build Status Discord Chat License

Deploying the DEX

Run unit tests

./do.sh test dex

Compile the dex binary

./do.sh build dex

Deploy the dex to the configured solana cluster

DEX_PROGRAM_ID="$(solana deploy dex/target/bpfel-unknown-unknown/release/serum_dex.so --use-deprecated-loader | jq .programId -r)"

Run the fuzz tests

cd dex
cargo install cargo-fuzz
cargo fuzz run multiple_orders

Using the client utility

cd crank

# read the autogenerated help text
cargo run -- help

# supported options are localnet, mainnet, testnet, devnet
CLUSTER=localnet

# verify that you have SOL balances for gas
KEYPAIR=~/.config/solana/id.json
solana balance -k $KEYPAIR

# run the demo script (this is mostly a smoke test)
cargo run -- $CLUSTER whole-shebang $KEYPAIR $DEX_PROGRAM_ID

# list a market with the default tick size and minimum quantity.
# if both assets have 6 decimals, this will be a quantity of 1 and a tick size of 0.01
COIN_MINT="..."
PRICE_CURRENCY_MINT="..."
cargo run -- $CLUSTER list-market $KEYPAIR $DEX_PROGRAM_ID --coin-mint $COIN_MINT --pc-mint $PRICE_CURRENCY_MINT

First-time setup

# Building the dex
sudo apt-get install -y pkg-config build-essential python3-pip jq
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v1.3.9/install/solana-install-init.sh | sh -s - v1.3.9
export PATH="/home/ubuntu/.local/share/solana/install/active_release/bin:$PATH"

git clone https://github.com/project-serum/serum-dex
cd serum-dex
./do.sh update
./do.sh build dex

# run a solana cluster. in a new shell:
git clone https://github.com/solana-labs/solana --branch v1.3.10
cd solana
sudo apt-get install -y libssl-dev libudev-dev zlib1g-dev llvm clang
cargo build --release
export RUST_LOG=solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=info,solana_bpf_loader=debug,solana_rbpf=debug
NDEBUG=1 ./run.sh

# Deploy the dex to our cluster (in the old shell)
solana config set -u http://127.0.0.1:8899
solana-keygen new
solana airdrop 100
DEX_PROGRAM_ID="$(solana deploy dex/target/bpfel-unknown-unknown/release/serum_dex.so --use-deprecated-loader | jq .programId -r)"
CLUSTER=localnet
KEYPAIR=~/.config/solana/id.json

# run the demo script (this is mostly a smoke test)
cargo run -- $CLUSTER whole-shebang $KEYPAIR $DEX_PROGRAM_ID