QRDXDocs

Exchange operations

Every operation an exchange transaction can carry, its parameters, who may send it, and its gas.

An exchange transaction's op_type is the number or the name. Amounts, sizes and prices are decimal strings with at most 18 decimal places. Every operation is all-or-nothing: one that cannot execute is refused whole, changes nothing, and still pays its gas. Exchange transactions explains the envelope and signing.

Fee = gas × gas_price (at least 1 gwei = 10⁻⁹ QRDX per gas), paid in QRDX and burned. At the minimum price, 40,000 gas costs 0.00004 QRDX.

Spot

Op#ParamsGas
CREATE_POOL1token0, token1, fee_tier (100 | 500 | 3000 | 10000), pool_type (STANDARD | SUBSIDIZED), initial_price (token1 per token0 of the sorted pair), stake_amount (QRDX)150,000
ADD_LIQUIDITY2pool_id (or token0 + token1 [+ fee_tier]), tick_lower, tick_upper (multiples of the tick spacing), amount (the liquidity L)90,000
REMOVE_LIQUIDITY3pool_id, position_id, amount? (L; default all, 0 collects fees only). Owner only60,000
SWAP4token_in, token_out, amount_in, min_amount_out, deadline? (block time), venue? (auto | amm | clob), pool_id?65,000
PLACE_ORDER5pair (tokenA:tokenB, either order), side (buy | sell), order_type (limit), price, amount (base)40,000
CANCEL_ORDER6order_id, pair25,000
REMOVE_POOL17pool_id. The creator, once no position remains; refunds the stake60,000

Native QRDX is named QRDX (any casing) in place of a token address.

Perpetuals

Op#ParamsGas
CREATE_MARKET12base_token (e.g. BTC), max_leverage? (default 20)100,000
PERP_DEPOSIT18amount: collateral from the wallet into the clearinghouse40,000
PERP_WITHDRAW19amount: at most withdrawable40,000
PERP_SET_LEVERAGE20market_id, leverage, mode (cross | isolated)20,000
PERP_ORDER21market_id, side, size, price, reduce_only?, tif? (gtc default | ioc)60,000
PERP_CANCEL22market_id, order_id25,000
VAULT_DEPOSIT23amount: free collateral into the backstop vault, for shares40,000
VAULT_WITHDRAW24shares, after the lockup40,000
ORACLE_VOTE25prices ({"BTC": "65000.5", …}). Validators only30,000

An order's id is the first 16 characters of its transaction hash; the receipt returns it too.

Native tokens

Op#ParamsWhoGas
TOKEN_DEPLOY13name, symbol, decimals (18), total_supply (0), max_supply?, mint_authority?, freeze_authority?, and extension parametersanyone120,000
TOKEN_TRANSFER14token_address, to, amount, memo? (≤ 256 bytes)any holder40,000
TOKEN_MINT26token_address, amount, to?the mint authority40,000
TOKEN_BURN27token_address, amount, from?a holder; another's: its operator or the permanent delegate30,000
TOKEN_APPROVE28token_address, spender, amount (0 revokes)any holder25,000
TOKEN_TRANSFER_FROM29token_address, from, to, amount, memo?a spender, an operator, or the permanent delegate45,000
TOKEN_SET_AUTHORITY30token_address, authority (mint | freeze | metadata | fee | withdraw | pause | permanent_delegate), new_authority (empty renounces)the current authority25,000
TOKEN_FREEZE / TOKEN_THAW31 / 32token_address, accountthe freeze authority25,000
TOKEN_UPDATE_METADATA33token_address, name?, symbol?, uri?, fields?the metadata authority30,000
TOKEN_SET_TRANSFER_FEE34token_address, transfer_fee_bps, max_transfer_fee? (applies 100 blocks later)the fee authority25,000
TOKEN_WITHDRAW_FEES35token_address, to?the withdraw authority40,000
TOKEN_PAUSE / TOKEN_RESUME36 / 37token_addressthe pause authority25,000
TOKEN_AUTHORIZE_OPERATOR / TOKEN_REVOKE_OPERATOR38 / 39token_address, operatorany holder25,000

NFTs

Op#ParamsWhoGas
NFT_CREATE_COLLECTION40name, symbol, uri, max_supply?, royalty_bps?, royalty_recipient?, update_authority?, mint_authority?, non_transferable?anyone120,000
NFT_MINT41collection, to?, uri?, name?, token_id?the mint authority60,000
NFT_TRANSFER42collection, token_id, to, from?, memo?the owner, its approved account or operator35,000
NFT_BURN43collection, token_idthe same25,000
NFT_APPROVE44collection, token_id, spender (empty clears)the owner or its operator25,000
NFT_SET_APPROVAL_FOR_ALL45collection, operator, approved?any owner25,000
NFT_UPDATE46collection, token_id?, name?, symbol?, uri?, royalty_bps?, royalty_recipient?the update authority30,000
NFT_SET_AUTHORITY47collection, authority (update | mint), new_authoritythe current authority25,000

Staking

Op#ParamsGas
STAKE_DEPOSIT15stake_amount (at least 100,000 QRDX, debited from the sender), validator_public_key (ML-DSA-65, hex)150,000
STAKE_EXIT16— : the sender's validator starts exiting80,000

Consensus explains the validator lifecycle.

Retired

Operations 7–10 (OPEN_POSITION, CLOSE_POSITION, PARTIAL_CLOSE, ADD_MARGIN) belonged to an earlier perpetuals engine and are refused; use PERP_*. Operation 11, UPDATE_ORACLE, sets an oracle price from a configured reporter on development networks only; public networks configure none, and prices come from validators' ORACLE_VOTEs.

On this page