There are many myths about how Matsyendranath became a realized adept, all of them illustrating the transformational possibilities of yoga. Some legends say that as a baby, Matsyendranath was thrown into the ocean because he was born under inauspicious stars. He was then swallowed by a fish where he lived for 12 years. He began to practice yoga sadhana inside the fish's belly after overhearing Lord Shiva imparting the secrets of yoga to his consort at the bottom of the ocean. After 12 years, he finally emerged as an enlightened siddha. This story is the origin for his name, lord of the fishes. Another myth states that Matsyendranath was born as a fish and turned into a siddha by Shiva.
Matsyendranath is credited with composing some of the earliest texts on Hatha yoga in Sanskrit in the 11th century, such as the "Matsyendrasanhita" (a collection of mantras and hymns) and the "Kaulajnananirnaya" (discussion of the knowledge pertaining to the Kaula tradition).