@@ -189,10 +189,10 @@ pub mod pallet {
189189 pub ip_type : u8 ,
190190 }
191191
192- /// Struct for ChainIdentities.
192+ /// Struct for ChainIdentities. (DEPRECATED for V2)
193193 pub type ChainIdentityOf = ChainIdentity ;
194194
195- /// Data structure for Chain Identities.
195+ /// Data structure for Chain Identities. (DEPRECATED for V2)
196196 #[ crate :: freeze_struct( "bbfd00438dbe2b58" ) ]
197197 #[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
198198 pub struct ChainIdentity {
@@ -210,9 +210,32 @@ pub mod pallet {
210210 pub additional : Vec < u8 > ,
211211 }
212212
213- /// Struct for SubnetIdentities.
213+ /// Struct for ChainIdentities.
214+ pub type ChainIdentityOfV2 = ChainIdentityV2 ;
215+
216+ /// Data structure for Chain Identities.
217+ #[ crate :: freeze_struct( "ad72a270be7b59d7" ) ]
218+ #[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
219+ pub struct ChainIdentityV2 {
220+ /// The name of the chain identity
221+ pub name : Vec < u8 > ,
222+ /// The URL associated with the chain identity
223+ pub url : Vec < u8 > ,
224+ /// The github repository associated with the identity
225+ pub github_repo : Vec < u8 > ,
226+ /// The image representation of the chain identity
227+ pub image : Vec < u8 > ,
228+ /// The Discord information for the chain identity
229+ pub discord : Vec < u8 > ,
230+ /// A description of the chain identity
231+ pub description : Vec < u8 > ,
232+ /// Additional information about the chain identity
233+ pub additional : Vec < u8 > ,
234+ }
235+
236+ /// Struct for SubnetIdentities. (DEPRECATED for V2)
214237 pub type SubnetIdentityOf = SubnetIdentity ;
215- /// Data structure for Subnet Identities
238+ /// Data structure for Subnet Identities. (DEPRECATED for V2)
216239 #[ crate :: freeze_struct( "f448dc3dad763108" ) ]
217240 #[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
218241 pub struct SubnetIdentity {
@@ -223,6 +246,28 @@ pub mod pallet {
223246 /// The subnet's contact
224247 pub subnet_contact : Vec < u8 > ,
225248 }
249+
250+ /// Struct for SubnetIdentitiesV2.
251+ pub type SubnetIdentityOfV2 = SubnetIdentityV2 ;
252+ /// Data structure for Subnet Identities
253+ #[ crate :: freeze_struct( "e002be4cd05d7b3e" ) ]
254+ #[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
255+ pub struct SubnetIdentityV2 {
256+ /// The name of the subnet
257+ pub subnet_name : Vec < u8 > ,
258+ /// The github repository associated with the subnet
259+ pub github_repo : Vec < u8 > ,
260+ /// The subnet's contact
261+ pub subnet_contact : Vec < u8 > ,
262+ /// The subnet's website
263+ pub subnet_url : Vec < u8 > ,
264+ /// The subnet's discord
265+ pub discord : Vec < u8 > ,
266+ /// The subnet's description
267+ pub description : Vec < u8 > ,
268+ /// Additional information about the subnet
269+ pub additional : Vec < u8 > ,
270+ }
226271 /// ============================
227272 /// ==== Staking + Accounts ====
228273 /// ============================
@@ -703,7 +748,7 @@ pub mod pallet {
703748 #[ pallet:: type_value]
704749 /// Default value for applying pending items (e.g. childkeys).
705750 pub fn DefaultPendingCooldown < T : Config > ( ) -> u64 {
706- 7200
751+ 1
707752 }
708753
709754 #[ pallet:: type_value]
@@ -717,7 +762,7 @@ pub mod pallet {
717762 /// Default staking fee.
718763 /// 500k rao matches $0.25 at $500/TAO
719764 pub fn DefaultStakingFee < T : Config > ( ) -> u64 {
720- 500_000
765+ 50_000
721766 }
722767
723768 #[ pallet:: type_value]
@@ -732,6 +777,18 @@ pub mod pallet {
732777 T :: InitialDissolveNetworkScheduleDuration :: get ( )
733778 }
734779
780+ #[ pallet:: type_value]
781+ /// Default moving alpha for the moving price.
782+ pub fn DefaultMovingAlpha < T : Config > ( ) -> I96F32 {
783+ // Moving average take 30 days to reach 50% of the price
784+ // and 3.5 months to reach 90%.
785+ I96F32 :: saturating_from_num ( 0.000003 )
786+ }
787+ #[ pallet:: type_value]
788+ /// Default subnet moving price.
789+ pub fn DefaultMovingPrice < T : Config > ( ) -> I96F32 {
790+ I96F32 :: saturating_from_num ( 0.0 )
791+ }
735792 #[ pallet:: type_value]
736793 /// Default value for Share Pool variables
737794 pub fn DefaultSharePoolZero < T : Config > ( ) -> U64F64 {
@@ -910,6 +967,11 @@ pub mod pallet {
910967 pub type TotalStake < T > = StorageValue < _ , u64 , ValueQuery > ;
911968 #[ pallet:: storage] // --- ITEM ( dynamic_block ) -- block when dynamic was turned on.
912969 pub type DynamicBlock < T > = StorageValue < _ , u64 , ValueQuery > ;
970+ #[ pallet:: storage] // --- ITEM ( moving_alpha ) -- subnet moving alpha.
971+ pub type SubnetMovingAlpha < T > = StorageValue < _ , I96F32 , ValueQuery , DefaultMovingAlpha < T > > ;
972+ #[ pallet:: storage] // --- MAP ( netuid ) --> moving_price | The subnet moving price.
973+ pub type SubnetMovingPrice < T : Config > =
974+ StorageMap < _ , Identity , u16 , I96F32 , ValueQuery , DefaultMovingPrice < T > > ;
913975 #[ pallet:: storage] // --- MAP ( netuid ) --> total_volume | The total amount of TAO bought and sold since the start of the network.
914976 pub type SubnetVolume < T : Config > =
915977 StorageMap < _ , Identity , u16 , u128 , ValueQuery , DefaultZeroU128 < T > > ;
@@ -1409,14 +1471,22 @@ pub mod pallet {
14091471 PrometheusInfoOf ,
14101472 OptionQuery ,
14111473 > ;
1412- #[ pallet:: storage] // --- MAP ( coldkey ) --> identity
1474+ #[ pallet:: storage] // --- MAP ( coldkey ) --> identity. (DEPRECATED for V2)
14131475 pub type Identities < T : Config > =
14141476 StorageMap < _ , Blake2_128Concat , T :: AccountId , ChainIdentityOf , OptionQuery > ;
14151477
1416- #[ pallet:: storage] // --- MAP ( netuid ) --> identity
1478+ #[ pallet:: storage] // --- MAP ( coldkey ) --> identity
1479+ pub type IdentitiesV2 < T : Config > =
1480+ StorageMap < _ , Blake2_128Concat , T :: AccountId , ChainIdentityOfV2 , OptionQuery > ;
1481+
1482+ #[ pallet:: storage] // --- MAP ( netuid ) --> identity. (DEPRECATED for V2)
14171483 pub type SubnetIdentities < T : Config > =
14181484 StorageMap < _ , Blake2_128Concat , u16 , SubnetIdentityOf , OptionQuery > ;
14191485
1486+ #[ pallet:: storage] // --- MAP ( netuid ) --> identityV2
1487+ pub type SubnetIdentitiesV2 < T : Config > =
1488+ StorageMap < _ , Blake2_128Concat , u16 , SubnetIdentityOfV2 , OptionQuery > ;
1489+
14201490 /// =================================
14211491 /// ==== Axon / Promo Endpoints =====
14221492 /// =================================
0 commit comments