From 6ef90583f39380c49a29378a769a510063a8c9dd Mon Sep 17 00:00:00 2001 From: unconst Date: Mon, 25 May 2026 16:40:21 +0200 Subject: [PATCH 1/4] Record miner burn as TAO outflow in coinbase When the SN-owner-hotkey path skips a miner incentive (and the alpha is then recycled or burned), reflect the corresponding TAO leaving the pool by calling record_tao_outflow. The skipped incentive is denominated in alpha, so it is valued at the current spot price for the outflow accounting (no swap occurs, so no slippage applies). Co-authored-by: Cursor --- pallets/subtensor/src/coinbase/run_coinbase.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index e3e98c7a88..3103f5af4b 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -617,6 +617,17 @@ impl Pallet { log::debug!( "incentives: hotkey: {hotkey:?} is SN owner hotkey or associated hotkey, skipping {incentive:?}" ); + + // Record the miner burn as a TAO outflow. The incentive is + // denominated in alpha, so convert to its TAO equivalent at + // the current spot price (no slippage, since no swap occurs). + let current_price: U96F32 = + T::SwapInterface::current_alpha_price(netuid.into()); + let tao_equivalent: TaoBalance = current_price + .saturating_mul(asfloat!(incentive)) + .saturating_to_num::() + .into(); + Self::record_tao_outflow(netuid, tao_equivalent); // Check if we should recycle or burn the incentive match RecycleOrBurn::::try_get(netuid) { Ok(RecycleOrBurnEnum::Recycle) => { From 72a001dfe4072f12ec6c29f44a59b8bcc7b2189f Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 31 May 2026 11:17:25 -0700 Subject: [PATCH 2/4] Apply suggestion from @github-actions[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- pallets/subtensor/src/coinbase/run_coinbase.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index 3103f5af4b..129f6561f6 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -626,8 +626,8 @@ impl Pallet { let tao_equivalent: TaoBalance = current_price .saturating_mul(asfloat!(incentive)) .saturating_to_num::() + .min(i64::MAX as u64) .into(); - Self::record_tao_outflow(netuid, tao_equivalent); // Check if we should recycle or burn the incentive match RecycleOrBurn::::try_get(netuid) { Ok(RecycleOrBurnEnum::Recycle) => { From ce144d58dfed84b3393ea86dfca651b3b193225c Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 31 May 2026 11:18:21 -0700 Subject: [PATCH 3/4] fmt --- pallets/subtensor/src/coinbase/run_coinbase.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index 129f6561f6..56df8bcd34 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -621,8 +621,7 @@ impl Pallet { // Record the miner burn as a TAO outflow. The incentive is // denominated in alpha, so convert to its TAO equivalent at // the current spot price (no slippage, since no swap occurs). - let current_price: U96F32 = - T::SwapInterface::current_alpha_price(netuid.into()); + let current_price: U96F32 = T::SwapInterface::current_alpha_price(netuid.into()); let tao_equivalent: TaoBalance = current_price .saturating_mul(asfloat!(incentive)) .saturating_to_num::() From d29bb96e4d3fbb9684e988591de81b242e7d29cb Mon Sep 17 00:00:00 2001 From: John Reed <87283488+JohnReedV@users.noreply.github.com> Date: Sun, 31 May 2026 11:22:35 -0700 Subject: [PATCH 4/4] Update pallets/subtensor/src/coinbase/run_coinbase.rs Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- pallets/subtensor/src/coinbase/run_coinbase.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index 56df8bcd34..78440dbd80 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -627,6 +627,7 @@ impl Pallet { .saturating_to_num::() .min(i64::MAX as u64) .into(); + Self::record_tao_outflow(netuid, tao_equivalent); // Check if we should recycle or burn the incentive match RecycleOrBurn::::try_get(netuid) { Ok(RecycleOrBurnEnum::Recycle) => {