Run this against testnet first. Same API, same flow, test tokens.
Base URL
https://api.testnet.aura.markets, node
https://node.testnet.alephium.org.Before you start
You need three things:A wallet key
An Alephium private key you can sign with in your process. A browser
extension works for interactive apps, but a bot needs a local key.
USDT for collateral
Buy orders lock collateral. Aura settles in USDT at 18 decimals.
A little ALPH
Around 0.21 ALPH per order covers gas plus the refundable storage deposits
Alephium charges for the order entries.
Step 1: Request a challenge
Authentication is a wallet signature. Ask for a challenge string first.Step 2: Sign the challenge
Sign it with Alephium’s message hasher. The'alephium' prefix matters, and
signing the raw bytes instead will be rejected.
Step 3: Create a session
Exchange the signature for a session. Bots should passissueToken: true to get
a bearer token in the response body instead of relying on cookies.
keyType must match your address. Use default for a standard Alephium wallet
(addresses starting 1), or gl-secp256k1 for an Aura embedded wallet
(addresses starting 3). The same value has to be passed again in step 4.x-csrf-token
header on every mutating request.
Step 4: Build the unsigned transaction
Now the actual order. Pick a market from your first API call, then:Order constraints
Sell orders lock shares rather than USDT, so
collateralRequired comes back zero
for them.
Step 5: Sign the transaction
Aura built it. You sign it.Step 6: Submit to Alephium
Submit to a node, not to Aura. Aura has no submit endpoint, by design.txId against the one Aura predicted is a cheap integrity
check. If they differ, the transaction you signed is not the transaction Aura
built, and you should stop rather than retry.
Confirm it landed
Chain confirmation and indexer visibility are separate. Once the transaction is in a block, poll until Aura’s indexer has picked it up:indexed is true, the order shows up in the book and in
GET /v1/markets/{market}/orders. For anything real-time, subscribe to the
realtime stream rather than polling this.
The whole thing
When it goes wrong
401 on the build call
401 on the build call
The bearer token expired or the header is malformed. It must be
Authorization: Bearer <token>. Bearer sessions do not slide, so re-run
steps 1 through 3 on a 401 rather than retrying the build.Signer address does not match session
Signer address does not match session
signerAddress in step 4 has to be the wallet that signed the challenge in
step 2. You cannot build a transaction for a different address than the one
you authenticated as.Transaction reverts with error code 12
Transaction reverts with error code 12
INVALID_FILL, and almost always a quantity that is not a multiple of
10000000. See Error codes.Transaction reverts with error code 13
Transaction reverts with error code 13
INVALID_PRICE. Ticks must be 1 to 999 inclusive.Not enough ALPH
Not enough ALPH
Each order writes storage entries on Alephium, which requires a refundable
deposit on top of gas. Keep at least 0.21 ALPH free per order in flight. You
get the deposit back when the order is filled or cancelled.
Next
Integrator guide
Cancels, elevated rate limits, and running this at volume.
Build-tx flow
Every other transaction Aura can build: stakes, votes, claims, proposals.
Realtime stream
Watch your order fill instead of polling for it.
Error codes
Decode an on-chain revert.

