Testnet, tokens have no value. Do not send real assets.
Skip to Content
Testnet appsTrade desk

Trade desk

The testnet trade desk quotes every test asset, the whole share and each kind on its own, around the DEX pool’s price, and trades by settlement: you ask for a quote (an RFQ), the desk proposes a settlement to you with its side escrowed, and your accept moves both sides in one block or not at all. Selling only the INCOME kind is selling a dividend strip: the next dividends go to the buyer, and you keep the ECON and VOTE kinds. Testnet, tokens have no value.

Run the setup block first, and hold a test stock (Hold a test stock). The examples use tAAPL; use the symbol the faucet gave you.

1. Quotes

curl -s "$AEVA_APP/api/desk/quotes" | jq -r '.quotes[] | select(.symbol == "tAAPL") | "\(.name) (kind \(.kind)): bid \(.bid) / ask \(.ask) aeusd base units"'
Expected output
tAAPL share (kind -1): bid <…> / ask <…> aeusd base units tAAPL ECON (kind 0): bid <…> / ask <…> aeusd base units tAAPL INCOME (kind 1): bid <…> / ask <…> aeusd base units tAAPL VOTE (kind 2): bid <…> / ask <…> aeusd base units

Prices are per whole unit (six decimals: 200000000 is 200 aeUSD). Kind -1 is the whole share; a kind alone is a fixed fraction of it (ECON 60 %, INCOME 30 %, VOTE 10 %), and the desk’s spread is 2 % either side of the mid.

2. Sell one share’s dividend strip

R=$(curl -s -X POST -H 'content-type: application/json' -d "{\"address\":\"$ME\",\"symbol\":\"tAAPL\",\"kind\":1,\"side\":\"sell\",\"units\":\"1000000\"}" "$AEVA_APP/api/desk/rfq") jq '{settlement_id, instrument, side, units, price, amount}' <<<"$R" ID=$(jq -r .settlement_id <<<"$R")
Expected output
{ "settlement_id": <id>, "instrument": "tAAPL INCOME", "side": "sell", "units": "1000000", "price": "<bid>", "amount": "<aeusd base units>" }

The desk has proposed settlement $ID to you: it escrowed the aeUSD amount and asks for 1 000 000 units of tAAPL’s INCOME kind. The proposal expires after 10 minutes. Look at it before you accept:

curl -s "$AEVA_INDEXER/v1/settlements/$ID" | jq -r '.settlement | "status \(.status); \(.legs | length) legs; expires \(.expiry)"' R=$(alias_tx settlement accept "$ID" --from me); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null curl -s "$AEVA_INDEXER/v1/settlements/$ID" | jq -r '.settlement.status' echo "$AEVA_EXPLORER/settlements/$ID"
Expected output
status STATUS_PENDING; 2 legs; expires … STATUS_SETTLED https://explorer.aevachain.com/settlements/<id>

Both legs moved in the accept’s block. Your INCOME units are now one share short of your ECON and VOTE units, so the next dividends accrue a little less to you and a little more to the desk.

The other way round

  • Buy: "side":"buy", the desk proposes to give the units for aeUSD at its ask.
  • Propose to the desk: any settlement addressed to the desk with one asset’s kinds in equal units against one aeUSD leg, at or better than its quote, is accepted automatically within a few seconds.

Limits

At most 5 000 aeUSD a trade, and a few RFQs per address every 10 minutes (HTTP 429 beyond). The desk’s inventory is finite; when it runs low it stops quoting that side.

Last updated