compose_order
Compose a DEX order to trade Counterparty assets on Bitcoin. Specify total amounts for assets to automatically calculate the per-unit price.
Instructions
Compose a DEX order to trade Counterparty assets. IMPORTANT: give_quantity and get_quantity are TOTAL amounts, not per-unit prices. The price per unit is the ratio between them. Example: to buy 1000 TOKENA at 0.5 XCP each, set give_asset=XCP, give_quantity=50010^8 (500 XCP total), get_asset=TOKENA, get_quantity=1000. Example: to sell 50 XCP for BTC at 0.001 BTC per XCP, set give_asset=XCP, give_quantity=5010^8, get_asset=BTC, get_quantity=50*100000 (0.05 BTC total).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Source Bitcoin address | |
| get_asset | Yes | Asset to receive/buy | |
| expiration | Yes | Number of blocks until order expires (max 8064, ~2 months) | |
| give_asset | Yes | Asset to give/sell | |
| inputs_set | No | Comma-separated UTXOs to use as inputs (txid:vout) | |
| fee_required | No | BTC fee required from counterparty for BTC trades (in satoshis). Use 0 (recommended) unless you specifically need to require a fee. | |
| get_quantity | Yes | TOTAL raw integer amount to receive (not per-unit). For divisible assets: human amount * 10^8. For BTC: satoshis. Price = give_quantity / get_quantity. | |
| give_quantity | Yes | TOTAL raw integer amount to give (not per-unit). For divisible assets: human amount * 10^8. For BTC: satoshis. | |
| sat_per_vbyte | No | Fee rate in satoshis per virtual byte (e.g. 1, 5.5, 0.15). Check get_fee_estimate for current market rates. |