cypher-cli
provides rust code that integrates with cypher protocol.
This project contains contains some useful command-line utilities, such as:
account
- utility commands for the accountsclose
- closes an account if possible, requires all sub accounts to have been zeroed outcreate
- creates an accountcreate-whitelisted
- creates a whitelisted account (requires having the pubkeys of the corresponding private clearing and the whitelist accounts)peek
- displays the sub accounts
sub-account
- utility commands for the sub accountsclose
- closes a sub account if possible, requires all positions to have been closedcreate
- creates a sub accountdeposit
- deposits an assetpeek
- displays the sub account's deposits, borrows and derivatives positionstransfer
- transfers an asset between sub-accountswithdraw
- withdraws an asset
perps
,futures
- utility commands to interact with perp and futures markets, commands are similar between the twobook
- displays the orderbook,symbol
needs to be specifiedcancel
- cancels an order by IDcloses
- closes an existing position entirely, if liquidity on the orderbook so allowsmarket
- submits a market order with the given paremeters, onlysize
,side
andsymbol
need to be specifiedorders
- displays open orders by market, along with quantities locked in orders accountsplace
- places an order with the given parameters,size
,side
,symbol
,order-type
need to be specifiedsettle
- settles unlocked funds in the orders accounts
spot
- utilitity commands to interact with spot marketsbook
- displays the orderbook,symbol
needs to be specifiedcancel
- cancels an order by IDmarket
- submits a market order with the given paremeters, onlysize
,side
andsymbol
need to be specifiedorders
- displays open orders by market, along with quantities locked in orders accountsplace
- places an order with the given parameters,size
,side
,symbol
,order-type
need to be specifiedsettle
- settles unlocked funds in the orders accounts
faucet
(only available on devnet)list
request
There are also some more complex actions such as:
market-maker
- runs a marketmaker with the given config, available for cypher's derivative markets and openbook spot markets using cypher margin accounts- check possible configs at
/cfg/market/maker
- check possible configs at
liquidator
- runs a liquidator with the given config, this is a simple liquidator program with additional functionality being built- check possible configs at
/cfg/liquidator
- check possible configs at
Building the cli is as easy as:
cargo build --package cypher-cli --release
cargo build --package cypher-cli --release --no-default-features --features mainnet-beta
In order to prevent issues when compiling due to the agnostic-orderbook
.
In the root directory of the repo:
rustup override set 1.59.0-x86_64-apple-darwin
Running the cli:
./target/release/cypher-cli -u <RPC_URL> -k <KEYPAIR_FILEPATH>
In order to run the market maker and/or liquidator, it is necessary to provide a Streaming RPC endpoint:
./target/release/cypher-cli -u <RPC_URL> -p <STREAMING_RPC_URL> -k <KEYPAIR_FILEPATH> market-maker run -c -k <MAKER_CONFIG_FILEPATH>