@@ -359,19 +359,6 @@ async def stake_extrinsic(
359
359
# Temporary workaround - calculations without slippage
360
360
current_price_float = float (subnet_info .price .tao )
361
361
rate = 1.0 / current_price_float
362
- received_amount = rate * amount_to_stake
363
-
364
- # Add rows for the table
365
- base_row = [
366
- str (netuid ), # netuid
367
- f"{ hotkey [1 ]} " , # hotkey
368
- str (amount_to_stake ), # amount
369
- str (rate )
370
- + f" { Balance .get_unit (netuid )} /{ Balance .get_unit (0 )} " , # rate
371
- str (received_amount .set_unit (netuid )), # received
372
- str (stake_fee ), # fee
373
- # str(slippage_pct), # slippage
374
- ]
375
362
376
363
# If we are staking safe, add price tolerance
377
364
if safe_staking :
@@ -395,24 +382,33 @@ async def stake_extrinsic(
395
382
price_limit = price_with_tolerance ,
396
383
)
397
384
prices_with_tolerance .append (price_with_tolerance )
398
- base_row .extend (
399
- [
400
- str (extrinsic_fee ),
401
- f"{ rate_with_tolerance } { Balance .get_unit (netuid )} /{ Balance .get_unit (0 )} " ,
402
- f"[{ 'dark_sea_green3' if allow_partial_stake else 'red' } ]"
403
- # safe staking
404
- f"{ allow_partial_stake } [/{ 'dark_sea_green3' if allow_partial_stake else 'red' } ]" ,
405
- ]
406
- )
385
+ row_extension = [
386
+ f"{ rate_with_tolerance } { Balance .get_unit (netuid )} /{ Balance .get_unit (0 )} " ,
387
+ f"[{ 'dark_sea_green3' if allow_partial_stake else 'red' } ]"
388
+ # safe staking
389
+ f"{ allow_partial_stake } [/{ 'dark_sea_green3' if allow_partial_stake else 'red' } ]" ,
390
+ ]
407
391
else :
408
392
extrinsic_fee = await get_stake_extrinsic_fee (
409
393
netuid_ = netuid ,
410
394
amount_ = amount_to_stake ,
411
395
staking_address_ = hotkey [1 ],
412
396
safe_staking_ = safe_staking ,
413
397
)
414
- base_row .append (str (extrinsic_fee ))
415
-
398
+ row_extension = []
399
+ received_amount = rate * (amount_to_stake - stake_fee - extrinsic_fee )
400
+ # Add rows for the table
401
+ base_row = [
402
+ str (netuid ), # netuid
403
+ f"{ hotkey [1 ]} " , # hotkey
404
+ str (amount_to_stake ), # amount
405
+ str (rate )
406
+ + f" { Balance .get_unit (netuid )} /{ Balance .get_unit (0 )} " , # rate
407
+ str (received_amount .set_unit (netuid )), # received
408
+ str (stake_fee ), # fee
409
+ str (extrinsic_fee ),
410
+ # str(slippage_pct), # slippage
411
+ ] + row_extension
416
412
rows .append (tuple (base_row ))
417
413
418
414
# Define and print stake table + slippage warning
@@ -611,17 +607,17 @@ def _define_stake_table(
611
607
"Hotkey" , justify = "center" , style = COLOR_PALETTE ["GENERAL" ]["HOTKEY" ]
612
608
)
613
609
table .add_column (
614
- f "Amount ({ Balance . get_unit ( 0 ) } )" ,
610
+ "Amount (τ )" ,
615
611
justify = "center" ,
616
612
style = COLOR_PALETTE ["POOLS" ]["TAO" ],
617
613
)
618
614
table .add_column (
619
- f "Rate (per { Balance . get_unit ( 0 ) } )" ,
615
+ "Rate (per τ )" ,
620
616
justify = "center" ,
621
617
style = COLOR_PALETTE ["POOLS" ]["RATE" ],
622
618
)
623
619
table .add_column (
624
- "Received" ,
620
+ "Est. Received" ,
625
621
justify = "center" ,
626
622
style = COLOR_PALETTE ["POOLS" ]["TAO_EQUIV" ],
627
623
)
0 commit comments