Nova provides a basic CLI to make configuring your DEX simple and easy. This document:
- You can also use Admin API
Note that because this API controls important fundamental elements of Nova DEX, it is important to secure this API against unwanted access.
If you are using docker-compose to run your nova relayer, you can login into the admin service by entering:
docker-compose exec admin sh
This enters the Admin CLI. Once you are logged in, you can use the commands detailed below to configure your DEX. To exit the CLI, type exit
nova-dex-ctl helpnova-dex-ctl statusnova-dex-ctl market helpnova-dex-ctl market listWhen creating a new market, you can choose to either:
- use default options for the majority of the parameters
- specify all parameters
To use default options, you only need to specify the base and quote token addresses for your trading pair. You can always edit these parameters later.
# Default market creation: specify the token addresses for your trading pair
nova-dex-ctl market new HOT-WWW \
--baseTokenAddress=0x224E34A640FC4108FABDb201eD85D909059105fA \
--quoteTokenAddress=0xbc3524faa62d0763818636d5e400f112279d6cc0
# create a new market and specify all attributes
nova-dex-ctl market new HOT-WWW \
--baseTokenAddress=0x224E34A640FC4108FABDb201eD85D909059105fA \
--quoteTokenAddress=0xbc3524faa62d0763818636d5e400f112279d6cc0 \
--minOrderSize=0.1 \
--pricePrecision=5 \
--priceDecimals=5 \
--amountDecimals=5 \
--makerFeeRate=0.001 \
--takerFeeRate=0.002 \
--gasUsedEstimation=150000
In order to make trades with a new token pair, the relayer must first set token allowance permissions for the new market. To do this, enter:
nova-dex-ctl market approve HOT-WETHIn the example above, the Relayer is approving both HOT and WETH (if not already approved) for trading.
To change parameters in an existing market, specify the market and the parameter you wish to modify.
nova-dex-ctl market update HOT-WWW --amountDecimals=3The market selection area on the frontend will only show markets that are published.
nova-dex-ctl market publish HOT-WETHUnpublishing a market will make the market no exist in the frontend market selection area.
nova-dex-ctl market unpublish HOT-WETH
You can modify the fee structure for each market. Nova supports assymetric fee structures - so you can have the order maker and order taker automatically pay different fees.
# set the HOT-WETH market makerFee to 0.1% and takerFee to 0.3%
nova-dex-ctl market changeFees HOT-WETH "0.001" "0.003"