Skip to content

Commit 65aad3c

Browse files
committed
add fee for swap stake
1 parent 9b05314 commit 65aad3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pallets/subtensor/src/staking/move_stake.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,9 @@ impl<T: Config> Pallet<T> {
288288
);
289289

290290
// 6. Unstake from the origin subnet, returning TAO (or a 1:1 equivalent).
291+
let fee = DefaultMinStake::<T>::get().saturating_div(2);
291292
let tao_unstaked =
292-
Self::unstake_from_subnet(&hotkey, &coldkey, origin_netuid, alpha_amount);
293+
Self::unstake_from_subnet(&hotkey, &coldkey, origin_netuid, alpha_amount, fee);
293294

294295
// 7. Check that the unstaked amount is above the minimum stake threshold.
295296
ensure!(
@@ -298,7 +299,7 @@ impl<T: Config> Pallet<T> {
298299
);
299300

300301
// 8. Stake the unstaked amount into the destination subnet, using the same coldkey/hotkey.
301-
Self::stake_into_subnet(&hotkey, &coldkey, destination_netuid, tao_unstaked);
302+
Self::stake_into_subnet(&hotkey, &coldkey, destination_netuid, tao_unstaked, fee);
302303

303304
// 9. Emit an event for logging.
304305
log::info!(

0 commit comments

Comments
 (0)