Subnet Swap Quote
Fetch one subnet's simulated swap at the finalized head, from the runtime itself (SwapRuntimeApi.sim_swap_tao_for_alpha or sim_swap_alpha_for_tao, with current_alpha_price): for amount rao of TAO staked in, or raw alpha unstaked, the TAO and alpha amounts, the fee on each side and the slippage against spot, each the runtime's u64 as a decimal string. Simulated, never submitted. A failed read is the decline: block_number null and every value null. ?direction=tao_for_alpha|alpha_for_tao and ?amount= are required; an invalid one is a 400.
Path Parameters
The subnet's numeric id on the Bittensor network, as used by the chain itself.
0 <= valueQuery Parameters
tao_for_alpha simulates staking amount rao of TAO into the pool; alpha_for_tao simulates unstaking amount raw alpha (10^9 to one alpha).
Value in
- "tao_for_alpha"
- "alpha_for_tao"
The amount as a decimal integer: rao of TAO (10^9 to one TAO) or raw alpha (10^9 to one alpha), at most 18446744073709551615.
^\d{1,20}$Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/subnets/1/swap-quote?direction=tao_for_alpha&amount=string"{ "data": { "amount": "example", "block_hash": "a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1", "block_number": 5000000, "direction": "tao_for_alpha", "netuid": 7, "queried_at": "2026-06-01T00:00:00.000Z", "quote": { "alpha_amount": "example", "alpha_fee": "example", "alpha_slippage": "example", "tao_amount": "example", "tao_fee": "example", "tao_slippage": "example" }, "schema_version": 1, "spot_price": "example" }, "meta": { "artifact_path": "example", "cache": "short", "catalog_paging": { "reason": "catalog_changed" }, "contract_version": "2026-06-29.1", "generated_at": "2026-06-01T00:00:00.000Z", "observed_through": "2026-06-01T00:00:00.000Z", "pagination": { "collection": "example", "cursor": 1, "limit": 1, "next_cursor": 1, "order": "asc", "returned": 1, "snapshot": "v1.a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1", "sort": "example", "total": 1 }, "published_at": "2026-06-01T00:00:00.000Z", "source": "live-cron-prober", "stale_contract": { "built_under": "example", "live": "example" } }, "ok": true, "schema_version": 1}