Use Incognito-CLI to Trade Unverified Coins

This guide will go over a step-by-step process to download, run, and trade coins on the Incognito blockchain that are no longer available on the app due to being unverified.

This guide can also help users who wish to directly interact with the blockchain but will specifically focus on unverified/custom coins.

This guide will mainly focus on Windows-based instructions, however, it should be easy to understand what to change to OSX or Linux commands.

Step 1:

Download extract the Incognito-CLI onto your computer.

Step 2:

Open your PowerShell or CMD (Windows), Terminal (OSX or Linux).

Navigate to the folder where you have downloaded and extracted the zipped folder.

Use the cd command to change folders.

For example: cd C:\Users\User\Downloads\executable_windows_x64

Step 3:

Go into the Incognito app and locate the coins you would like to swap. Once you have this go into More > Keychains and copy the private key of this wallet.

Step 4:

Now we will craft the command needed to interact with the Incognito blockchain. Pay close attention to the following options and adjust them as necessary. Our example will trade SHIVX for PRV from the PRV <> SHIVX pool.

Command breakdown

Command Explanation
.\incognito-cli.exe This runs the Incognito-CLI
-c 1 Saves a local cache for faster transactions
-d 1 enable debuging log (optional)
pdeaction trade Tells the CLI that we want to make a trade
–prvKey This will be our privateKey from the app (this demo will be 444444xxxxx)
–sellTokenID This is a unique tokenID set for each coin on the Incognito app (a list will be at the bottom of this post)
–buyID This will be the coin you want to trade to (see below)
–sellAmt How much you want to sell minus the tradingFee
–prvFee We set this to zero (0) to pay via ShivX, or else it will fail
–tradingFee This is the amount needed to successfully trade, 0.25% per hop

To calculate the trading fee you would take your total amount (in this case ShivX) and multiply by 0.25% and multiply by the number of hops or trade pairs needed (in this case only one).

If we have 2,000,000 ShivX that we want to trade into PRV we would figure 0.25% of 2,000,000 which gives us = 5,000 ShivX

Then to figure the --sellAmt we would take the 2,000,000 ShivX minus the --tradingFee of 5,000 ShivX to end with 1,995,000 ShivX.

Since we want to trade into PRV we would set --buyID to the ID for PRV which is:
0000000000000000000000000000000000000000000000000000000000000004

Now if we put this all together into one string/command then we have our example command to send.

.\incognito-cli.exe -c 1 -d 1 pdeaction trade --prvKey 444444xxxxx --sellTokenID ad3a4a45be01031ad00e1a047ad2e86225fc86b0854bcd32745b0ea859100b55 --buyID 0000000000000000000000000000000000000000000000000000000000000004 --sellAmt 1995000 --prvFee 0 --tradingFee 5000

That’s it! In one long command, we have sent a request to the Incognito full-node regarding the transaction we want to take and the CLI should produce a TX hash for our reference. You can now go into the app and find the transaction as pending/processing.

Note: If you see errors regarding trade paths you can ignore these as false positives

To find other coin ID’s go into the app, locate the coin, and then tap on coin information.


Related post:
introduce command line tool
withdraw pdexv2 liquidity with incognito-cli
incognito-cli release note

7 Likes

if you need to find tokenID (Coin ID) you can do this on app, for example, click on the little (?) next to token name, then copy its coin ID

2 Likes

So are you paying 5,000 ShivX as the prvFee? Isn’t it supposed to be PRV instead?

to pay trading fee by PRV, the pool size have to be bigger than 10000 PRV
While Shivx - PRV pool size is small, so you have to pay trading fee same kind as token sell (Shivx)

2 Likes

This is command to trade in revert direction

./incognito-cli -c 1 -d 1 pdeaction trade -p PRIVATEKEY --sellTokenID 0000000000000000000000000000000000000000000000000000000000000004 --buyID ad3a4a45be01031ad00e1a047ad2e86225fc86b0854bcd32745b0ea859100b55 --tradingPath 0000000000000000000000000000000000000000000000000000000000000004-ad3a4a45be01031ad00e1a047ad2e86225fc86b0854bcd32745b0ea859100b55-18b8a31f705e067436e9001b55c865e6d3e3de56944c10927739def82d3361d8 --sellAmt 10 --tradingFee 10

you need to adjust the tradingFee = 0.5% of SellAmt

1 Like