South of the market is a park with a shrine to Queen Chama Devi. You'll see a number of offerings at the shrine and probably a few Thais offering prayers to the queen as well.
If legends are to be believed, the Queen was quite a remarkable woman. She was the daughter of the King of Luovo [now known as Lopburi] in the central plains, who left the kingdom in the seventh century to find Haripunchai, now known as Lamphun. The legend has it that the location was chosen by shooting an arrow into the air and founding the town where it landed.
Lamphun became the center of a small federation of northern kingdoms some of which were founded by relatives of the Queen. Lampang was reportedly founded by one of her sons. While Thai history is dotted with many famous women, the Queen is one of the times when a woman is credited with the founding of a kingdom.
In 663, Princess Cham Thewi was invited to become a queen then the Haripunchai kingdom started. She brought civilization from Dvaravati [the kingdom in central Thailand around the 6th to the 13th centuries] to Northern Thailand for the first time.
She gathered various native tribes and ruled them under her Ten Royal Virtues, then proclaimed Buddhism by establishing temples throughout the land and extended the civilization to other river basins such as Wang river and Ping river. While she was in the order of the ten-precept nun, she performed countless good deeds and that's why she was called "the Beloved Queen" of Lanna people.