I am writing a science-fiction story that takes place some million years in a future Earth. There is a species of lepidopterans that evolved to become eusocial. They are my gnomes. My species is a sequential omnivore: caterpillars eat other insects, and adults are nectarivores, but queens need some blood in order to produce a huge quantity of eggs. Also, there are up to five queens in each colony. Queens need to be constantly with a king in order to reproduce (so, their way of reproducing is halfway between ants and termites, which are infamous to be mortal rivals). The castes are (from highest to lowest): royal couple(s) (the queen and the king or the queens and the kings), vice-royal couples (princesses and princes), soldiers, and workers. Colonies range from 10,000 to ten millions members. Colonies are formed in trees. Finally, my species lives in temperate and subtropical regions of the northern hemisphere, North America to be exact, and is a descendant of the harvester (Feniseca tarquinius).
I know that most eusocial insect species (ants, eusocial bees, and eusocial wasps) are hymenopterans. That said, some are blattopterans (termites). Apparently, there is at least one species of eusocial coleopterans.
Genetically speaking, lepidopterans, dipterans, trichopterans, nannomecopterans, mecopterans, neomecopterans, and siphonapterans form the Panorpida superorder. Also, most Panorpida species are solitary when they become adults.
So, I wonder how could lepidopterans evolve to be eusocial.