Skip to main content

Supported Transactions

taoflash relay supports ALL Bittensor transactions. Below are common examples organized by category to demonstrate the integration workflow. Any transaction that works on Bittensor can be submitted through the relay for MEV protection.

Staking Operations

addStake

Basic stake operation without price limits.

{
"call_module": "subtensorModule",
"call_function": "addStake",
"call_params": {
"hotkey": "5FHneW46...",
"netuid": 1,
"amountStaked": 1000000000
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address
netuidnumberSubnet network UID
amountStakednumberAmount in RAO (1 TAO = 1e9 RAO)

addStakeLimit

Stake with price protection (recommended for MEV protection).

{
"call_module": "subtensorModule",
"call_function": "addStakeLimit",
"call_params": {
"hotkey": "5FHneW46...",
"netuid": 1,
"amountStaked": 1000000000,
"limitPrice": 999999999999,
"allowPartial": false
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address
netuidnumberSubnet network UID
amountStakednumberAmount in RAO (1 TAO = 1e9 RAO)
limitPricenumberMaximum price willing to pay
allowPartialbooleanAllow partial fills

removeStake

Basic unstake operation.

{
"call_module": "subtensorModule",
"call_function": "removeStake",
"call_params": {
"hotkey": "5FHneW46...",
"netuid": 1,
"amountUnstaked": 1000000000
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address
netuidnumberSubnet network UID
amountUnstakednumberAmount to unstake in RAO

removeStakeLimit

Unstake with price protection.

{
"call_module": "subtensorModule",
"call_function": "removeStakeLimit",
"call_params": {
"hotkey": "5FHneW46...",
"netuid": 1,
"amountUnstaked": 1000000000,
"limitPrice": 50000000,
"allowPartial": false
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address
netuidnumberSubnet network UID
amountUnstakednumberAmount to unstake in RAO
limitPricenumberMinimum price willing to accept
allowPartialbooleanAllow partial fills

removeStakeFullLimit

Unstake entire position with optional price protection.

{
"call_module": "subtensorModule",
"call_function": "removeStakeFullLimit",
"call_params": {
"hotkey": "5FHneW46...",
"netuid": 1,
"limitPrice": 50000000
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address
netuidnumberSubnet network UID
limitPricenumber/nullMinimum price (null for no limit)

unstakeAll

Unstake from all positions for a hotkey.

{
"call_module": "subtensorModule",
"call_function": "unstakeAll",
"call_params": {
"hotkey": "5FHneW46..."
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address

unstakeAllAlpha

Unstake all alpha tokens.

{
"call_module": "subtensorModule",
"call_function": "unstakeAllAlpha",
"call_params": {
"hotkey": "5FHneW46..."
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address

Stake Movement

swapStake

Move stake between subnets.

{
"call_module": "subtensorModule",
"call_function": "swapStake",
"call_params": {
"hotkey": "5FHneW46...",
"originNetuid": 1,
"destinationNetuid": 2,
"alphaAmount": 1000000000
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address
originNetuidnumberSource subnet UID
destinationNetuidnumberTarget subnet UID
alphaAmountnumberAmount of alpha to swap

swapStakeLimit

Move stake between subnets with price protection.

{
"call_module": "subtensorModule",
"call_function": "swapStakeLimit",
"call_params": {
"hotkey": "5FHneW46...",
"originNetuid": 1,
"destinationNetuid": 2,
"alphaAmount": 1000000000,
"limitPrice": 50000000,
"allowPartial": false
}
}
ParameterTypeDescription
hotkeystringValidator hotkey SS58 address
originNetuidnumberSource subnet UID
destinationNetuidnumberTarget subnet UID
alphaAmountnumberAmount of alpha to swap
limitPricenumberPrice limit for the swap
allowPartialbooleanAllow partial fills

transferStake

Transfer stake to another coldkey.

{
"call_module": "subtensorModule",
"call_function": "transferStake",
"call_params": {
"destinationColdkey": "5Grw...",
"hotkey": "5FHneW46...",
"originNetuid": 1,
"destinationNetuid": 2,
"alphaAmount": 1000000000
}
}
ParameterTypeDescription
destinationColdkeystringRecipient coldkey SS58 address
hotkeystringValidator hotkey SS58 address
originNetuidnumberSource subnet UID
destinationNetuidnumberTarget subnet UID
alphaAmountnumberAmount of alpha to transfer

moveStake

Move stake between hotkeys.

{
"call_module": "subtensorModule",
"call_function": "moveStake",
"call_params": {
"originHotkey": "5FHneW46...",
"destinationHotkey": "5GHt...",
"originNetuid": 1,
"destinationNetuid": 2,
"alphaAmount": 1000000000
}
}
ParameterTypeDescription
originHotkeystringSource hotkey SS58 address
destinationHotkeystringTarget hotkey SS58 address
originNetuidnumberSource subnet UID
destinationNetuidnumberTarget subnet UID
alphaAmountnumberAmount of alpha to move

Key Management

swapHotkey

Swap hotkey for a subnet (or all subnets if netuid is null).

{
"call_module": "subtensorModule",
"call_function": "swapHotkey",
"call_params": {
"hotkey": "5FHneW46...",
"newHotkey": "5GHt...",
"netuid": 1
}
}
ParameterTypeDescription
hotkeystringCurrent hotkey SS58 address
newHotkeystringNew hotkey SS58 address
netuidnumber/nullSubnet UID (null for all subnets)

scheduleSwapColdkey

Schedule a coldkey swap.

{
"call_module": "subtensorModule",
"call_function": "scheduleSwapColdkey",
"call_params": {
"newColdkey": "5Hxy..."
}
}
ParameterTypeDescription
newColdkeystringNew coldkey SS58 address

Registration

burnedRegister

Register with burned TAO.

{
"call_module": "subtensorModule",
"call_function": "burnedRegister",
"call_params": {
"netuid": 1,
"hotkey": "5FHneW46..."
}
}
ParameterTypeDescription
netuidnumberSubnet network UID
hotkeystringHotkey SS58 address to register

register

Register with proof of work.

{
"call_module": "subtensorModule",
"call_function": "register",
"call_params": {
"netuid": 1,
"blockNumber": 123456,
"nonce": 789,
"work": "0x...",
"hotkey": "5FHneW46...",
"coldkey": "5Grw..."
}
}
ParameterTypeDescription
netuidnumberSubnet network UID
blockNumbernumberBlock number for PoW
noncenumberPoW nonce
workstringHex-encoded PoW solution
hotkeystringHotkey SS58 address
coldkeystringColdkey SS58 address

rootRegister

Register on root network.

{
"call_module": "subtensorModule",
"call_function": "rootRegister",
"call_params": {
"hotkey": "5FHneW46..."
}
}
ParameterTypeDescription
hotkeystringHotkey SS58 address to register

Network Management

registerNetwork

Register a new subnet.

{
"call_module": "subtensorModule",
"call_function": "registerNetwork",
"call_params": {
"hotkey": "5FHneW46..."
}
}
ParameterTypeDescription
hotkeystringHotkey SS58 address for the new subnet

Transfers

transfer

Transfer TAO between accounts.

{
"call_module": "balances",
"call_function": "transfer",
"call_params": {
"dest": "5Grw...",
"value": 1000000000
}
}
ParameterTypeDescription
deststringRecipient SS58 address
valuenumberAmount in RAO

Alpha Token Operations

burnAlpha

Burn alpha tokens.

{
"call_module": "subtensorModule",
"call_function": "burnAlpha",
"call_params": {
"hotkey": "5FHneW46...",
"amount": 1000000000,
"netuid": 1
}
}
ParameterTypeDescription
hotkeystringHotkey SS58 address
amountnumberAmount of alpha to burn
netuidnumberSubnet network UID

recycleAlpha

Recycle alpha tokens.

{
"call_module": "subtensorModule",
"call_function": "recycleAlpha",
"call_params": {
"hotkey": "5FHneW46...",
"amount": 1000000000,
"netuid": 1
}
}
ParameterTypeDescription
hotkeystringHotkey SS58 address
amountnumberAmount of alpha to recycle
netuidnumberSubnet network UID

Batch Operations

batch

Execute multiple calls (continues on failure).

{
"call_module": "utility",
"call_function": "batch",
"call_params": {
"calls": []
}
}
ParameterTypeDescription
callsarrayArray of call objects to execute

batchAll

Execute multiple calls (atomic - all or nothing).

{
"call_module": "utility",
"call_function": "batchAll",
"call_params": {
"calls": []
}
}
ParameterTypeDescription
callsarrayArray of call objects (all must succeed)

forceBatch

Force batch execution.

{
"call_module": "utility",
"call_function": "forceBatch",
"call_params": {
"calls": []
}
}
ParameterTypeDescription
callsarrayArray of call objects to force execute

Proxy Operations

proxy

Execute a call on behalf of another account.

{
"call_module": "proxy",
"call_function": "proxy",
"call_params": {
"real": "5Grw...",
"forceProxyType": null,
"call": {}
}
}
ParameterTypeDescription
realstringAccount to act on behalf of
forceProxyTypestring/nullForce specific proxy type
callobjectCall to execute

addProxy

Add a proxy account.

{
"call_module": "proxy",
"call_function": "addProxy",
"call_params": {
"delegate": "5FHn...",
"proxyType": "Any",
"delay": 0
}
}
ParameterTypeDescription
delegatestringProxy account SS58 address
proxyTypestringProxy type (Any, Staking, etc.)
delaynumberAnnouncement delay in blocks

Amount Conversion

TAO uses RAO as its base unit (1 TAO = 10^9 RAO):

const RAO_PER_TAO = 1_000_000_000n

// TAO to RAO
const rao = BigInt(tao * 1e9)

// RAO to TAO
const tao = Number(rao) / 1e9

Price Limits

The limitPrice parameter protects against slippage:

OperationLimit MeaningNo Limit Value
Buy (addStakeLimit)Maximum price999999999999
Sell (removeStakeLimit)Minimum price1