Go to file
armaniferrante d63f2c01e6
Update Cargo.toml
2021-07-04 18:59:29 -07:00
deps Add init and close open orders instructions (#1) 2021-05-31 13:45:24 -07:00
migrations Init repo 2021-04-30 01:29:48 -07:00
programs/swap Update Cargo.toml 2021-07-04 18:59:29 -07:00
tests Add spill when calculating exchange rate (#5) 2021-06-05 04:10:40 +08:00
.gitignore Init repo 2021-04-30 01:29:48 -07:00
.gitmodules Init repo 2021-04-30 01:29:48 -07:00
.travis.yml Add init and close open orders instructions (#1) 2021-05-31 13:45:24 -07:00
Anchor.toml Add spill when calculating exchange rate (#5) 2021-06-05 04:10:40 +08:00
Cargo.lock Update Cargo.toml 2021-07-04 18:59:29 -07:00
Cargo.toml Init repo 2021-04-30 01:29:48 -07:00
LICENSE Add LICENSE 2021-05-12 20:49:35 -07:00
README.md Update Cargo.toml 2021-07-04 18:59:29 -07:00

README.md

Swap

Crates.io Docs.rs

Swap provides a convenient API to the Serum DEX for performing instantly settled token swaps directly on the order book.

Developing

This program requires building the Serum DEX from source, which is done using git submodules.

Install Submodules

Pull the source

git submodule init
git submodule update

Build the DEX

Build it

cd deps/serum-dex/dex/ && cargo build-bpf && cd ../../../

Build

Anchor is used for developoment, and it's recommended workflow is used here. To get started, see the guide.

anchor build --verifiable

The --verifiable flag should be used before deploying so that your build artifacts can be deterministically generated with docker.

Test

anchor test

Verify

To verify the program deployed on Solana matches your local source code, install docker, cd programs/swap, and run

anchor verify <program-id | write-buffer>

A list of build artifacts can be found under releases.

Run the Test

Run the test

anchor test