# Centralized Auton Exchange (CAX)

## Install Package requied

```
apt install jq -y
curl -SsL https://packages.httpie.io/deb/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/httpie.gpg
sudo echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" > /etc/apt/sources.list.d/httpie.list
sudo apt update
apt install snapd
sudo snap install httpie
```

## Config Aut use Wallet.key

<figure><img src="/files/dgpUFuoxfZ1v0aPKc8X6" alt=""><figcaption></figcaption></figure>

## CAX

Get API

```
MESSAGE=$(jq -nc --arg nonce "$(date +%s%N)" '$ARGS.named')
```

Sign-message

```
aut account sign-message $MESSAGE message.sig
```

POST using HTTPie CLI to receive the new API key

```
echo -n $MESSAGE | https https://cax.piccadilly.autonity.org/api/apikeys api-sig:@message.sig
```

<figure><img src="/files/KD5g1SeC07fTQaLBqbpN" alt=""><figcaption></figcaption></figure>

Save apikey and  set KEY, example: KEY=**RedtwudQyP98Y2zNxxredxxxx123xxxxxxxxxxmxs=**

```
KEY=<apikey>
```

## Check your balance

```
https GET https://cax.piccadilly.autonity.org/api/balances/ API-Key:$KEY
```

## Get the CAX orderbooks

```
https GET https://cax.piccadilly.autonity.org/api/orderbooks/ API-Key:$KEY
```

## Get the current quote price

ATN

```
https GET https://cax.piccadilly.autonity.org/api/orderbooks/ATN-USD/quote API-Key:$KEY
```

NTN

```
https GET https://cax.piccadilly.autonity.org/api/orderbooks/NTN-USD/quote API-Key:$KEY
```

## Buy ATN or NTN

ATN (can change **price** and **amount**)

```
https POST https://cax.piccadilly.autonity.org/api/orders/ API-Key:$KEY pair=ATN-USD side=bid price=1.04  amount=100
```

NTN (can change **price** and **amount**)

```
https POST https://cax.piccadilly.autonity.org/api/orders/ API-Key:$KEY pair=NTN-USD side=bid price=10.04  amount=100
```

## Withdraw from off-chain (Withdraw to chain piccadilly)

ATN (can change **amount**)

```
https POST https://cax.piccadilly.autonity.org/api/withdraws/ API-Key:$KEY symbol=ATN amount=10
```

NTN (can change **amount**)

```
https POST https://cax.piccadilly.autonity.org/api/withdraws/ API-Key:$KEY symbol=NTN amount=10
```

## Deposit to off-chain (send token)

Please "Withdraw from off-chain" before send token.

Can change "--value 1" -> 1-2-3-4 and more&#x20;

Not change 0x7aa3E52908c1a5792acc4d713Eb416A0c77B6db9, because it of NodeSync :))

NTN

```
aut tx make --to 0x7aa3E52908c1a5792acc4d713Eb416A0c77B6db9 --value 1 --ntn | aut tx sign - | aut tx send -
```

ATN

```
aut tx make --to 0x7aa3E52908c1a5792acc4d713Eb416A0c77B6db9 --value 10 | aut tx sign - | aut tx send -
```

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://services.nodesync.top/testnet-running/autonity/centralized-auton-exchange-cax.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
