logo

How to change precisions for the market?

NOTICE: ALL OPEN ORDERS ON THIS MARKET SHOULD BE CANCELLED BEFORE CHANGING ITS PRECISION .

First of all you'd need to exec into any Peatio pod/container, by running one of the following commands:

kubectl exec -it -n *YOUR_NAMESAPCE* *YOUR_POD* bundle exec rails c 
docker-compose exec peatio bundle exec rails c
docker exec -it *CONTAINER_ID* bundle exec rails c

Then you should disable the market before updating and cancelling all open orders, by doing the following:

Market.find(*MARKET_ID*).update(state: 'disabled')
Order.where(market_id: *MARKET_ID*, state: 'wait').each do |o|
  Order.cancel!(o.id)
end

Now we can change precisions( NOTICE: sum of precisions on one market cannot be greater than 10), by running the following commands:

Market.find(*MARKET_ID*).update(amount_precision: *NUMBER*)
Market.find(*MARKET_ID*).update(price_precision: *NUMBER*)

Afterwards you can enable the market:

Market.find(*MARKET_ID*).update(state: 'enabled')

Congratulations! Precisions were changed.