Extensions allow you to create reusable constants for your bots.
You can create extensions that allow you to reuse same logic in many bots, e.g. checking if NFT from a patricular collection belongs to some SubDAO or doing some calculations based on traits.
Example
Every owl from Owlpha has staking multiplier that's calculated based on traits. This multiplier doesn't necessary increase with the NFT rarity so sniping based on that multiplier is more profitable.
Let's say we want to create an extension that will calculate multipliers for every trait and the total multiplier. Based on the official traits cheatsheet that can be found on their Discord, such extension would look like this:
defbrain_multiplier=switch{case nft.traits["BRAIN"] in["giga glow", "Giga"]=>5casenft.traits["BRAIN"]in["gold", "chip"]=>2casenft.traits["BRAIN"]in["floating"]=>1.9casenft.traits["BRAIN"]in["black", "orange"]=>1.8casenft.traits["BRAIN"]in["polygon", "Splitting"]=>1.7casenft.traits["BRAIN"]in["metal", "bitten"]=>1.6casenft.traits["BRAIN"]in["red and blue", "blue"]=>1.5casenft.traits["BRAIN"]in["purple", "red"]=>1.4casenft.traits["BRAIN"]in["regular glow"]=>1.3casenft.traits["BRAIN"]in["electric", "lightning"]=>1.2casenft.traits["BRAIN"]in["receptor"]=>1.1casenft.traits["BRAIN"]in["regular"]=>1#LegendaryOwldefault=>12}defcrown_multiplier=switch{casenft.traits["CROWN"]!="none"=>7default=>0}defheadgear_multiplier=switch{casenft.traits["HEADGEAR"]in["Wrath", "Thrasher", "Tanium", "Ranger", "Tundra"]=>2casenft.traits["HEADGEAR"]in["Tropics", "Invader", "Rebel"]=>1.8casenft.traits["HEADGEAR"]in["Samurai", "Recon"]=>1.7casenft.traits["HEADGEAR"]in["Morph", "Cyberpunk"]=>1.6casenft.traits["HEADGEAR"]in["Woodland", "Starbird", "Death Star"]=>1.5casenft.traits["HEADGEAR"]in["Covert", "Nature", "Gundam"]=>1.4casenft.traits["HEADGEAR"]in["Cardinal", "Night King"]=>1.3casenft.traits["HEADGEAR"]in["Firecracker", "Azure"]=>1.2casenft.traits["HEADGEAR"]in["Nocturnal", "Cosmo"]=>1.1default=>1}defbody_multiplier=switch{casenft.traits["BODY"]in["Midnight", "Visionary", "Kinetic", "Toxic"]=>2casenft.traits["BODY"]in["Emperor", "Optimus", "Assassin"]=>1.8casenft.traits["BODY"]in["Foxfire", "Cyborg"]=>1.6casenft.traits["BODY"]in["Pharaoh", "Alliance"]=>1.5casenft.traits["BODY"]in["Magma", "Incognito"]=>1.4casenft.traits["BODY"]in["Frost", "Darkside"]=>1.3casenft.traits["BODY"]in["Stealth", "Berserk"]=>1.2casenft.traits["BODY"]in["Excalibur"]=>1.1default=>1}defwings_multiplier=switch{casenft.traits["WINGS"]in["black and gold"]=>2casenft.traits["WINGS"]in["metal", "red gold"]=>1.8casenft.traits["WINGS"]in["gold", "galaxy"]=>1.7casenft.traits["WINGS"]in["green and silver"]=>1.6casenft.traits["WINGS"]in["dark purple", "cyan"]=>1.5casenft.traits["WINGS"]in["maroon", "orangish brown", "dark blue"]=>1.4casenft.traits["WINGS"]in["blue"]=>1.3 case nft.traits["WINGS"] in ["white and black dot", "white snow", "white and brown", "strip white and brown"] => 1.2
casenft.traits["WINGS"]in["black", "brown"]=>1.1default=>1}deftotal_multiplier=brain_multiplier+crown_multiplier+headgear_multiplier+body_multiplier+wings_multiplier-3
Once such extension is created you can use it in your bots to do pretty much anything you want. Let's say that we want to snipe every owl that has a total multiplier greater than 3 and price lower than 2000 MATIC:
Note that even if you're not using other constants like "brain_multiplier" in your config directly, you need to import them from the extension as well if you'd like to embed such information in your message templates. By doing so you can create templates customized to your collection.