If a permanent on the battlefield has X in its mana cost, X is 0 for the purpose of determining its mana value.

Artwork
Loading artwork…
Feed the Swarm
Avatar: The Last Airbender Eternal · #257 · EN
Nonfoil—Foil—
Card rules
Destroy target creature or enchantment an opponent controls. You lose life equal to that permanent's mana value.
Buzzard-wasps single-mindedly scour the Si Wong Desert in search of dead or dying prey.
Common · Illustrated by Kotakan
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Future Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Tlr Legal
Vintage Legal
Old School Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If the target permanent is an illegal target by the time Feed the Swarm tries to resolve, the spell doesn't resolve. You don't lose any life. If the target is legal but not destroyed (most likely because it has indestructible), you do lose life.
The amount of life you lose is determined by the permanent's mana value as it last existed on the battlefield.