At the beginning of time there was a mighty war on the topmost branch of Yggdrasil. The Gods were engaged in a terrible conflict, and Aesir fought Vanir almost to annihilation. During this terrible war the very walls of Asgard were toppled before peace was finally broken between Aesir and Vanir (read more here).
Asgårdsreien "The Wild Hunt of Odin" (1872) by Peter Nicolai Arbo
With peace, came the need for a speedy reconstruction, as the enemies of the Gods, - specially the Giants – were always ready to strike.
At this time a “humble” master builder came to the halls of the Allfather and offered to rebuild the mighty walls in mere three seasons, claiming that the new – and improved – wall around Asgard would be secure against the giants, even if they should come from the direction of Midgard.
The proposal was certainly very appealing to the Gods, but the price the builder demanded was steep: The Sun, the Moon and The hand of the Goddess Freyja in marriage.
The Gods took counsel together. Freyja was understandably adamantly against the builder’s terms from the start, and the Gods had no intention of going against the beloved Freya’s wishes. It was Loki, as always, who came with a cunning plan for the situation. He proposed a counteroffer for the builder, which he managed to convince the Gods to agree upon.
Under Loki’s counteroffer, the builder would receive his payment only if he completed the job in a single winter and did so without assistance from any man. The builder's payment would be forfeit if the job were not completed by the end of the season.
Much to everyone surprise, the builder agreed, as long as he could use his stallion, Svaðilfari, to help him on the job and that the Gods swore unbreakable oaths to ensure that, if their conditions were met, they would fulfill their end of the bargain, and that he himself would be safe in Asgard while he worked.
Oaths were made and the builder began the constructing the wall.
The Gods were marveled at how quickly the structure was raised. What was even more perplexing was that the builder’s stallion, Svadilfari (“Unlucky Traveler”) seemed to be doing almost twice as much work as the builder himself. By night, the builder hauled the stones with Svaðilfari, and by day, he set the stones in place.
When the end of winter was only three days ahead, the wall was strong enough to be impenetrable by almost any enemy, and – alarmingly – lacking little before it was finished. Only the stones around the gate had yet to be put in place.
The Gods assembled in council to decide what was to be done, rebuking Loki for giving them foul advice. It was clear by this time that the builder must be a giant, for no one else could have completed the work so quickly. Yet the Gods had no proof and were still bonded by their oaths. Something had to be done. The very thought of losing not only Freyja, but also the sun and the moon, bringing never-ending darkness and dreariness to the Nine Realms was too much to bear.
The After a very short deliberation, the Gods agreed that the one responsible for solving the situation should be the same one who created it: Loki.
The Gods threatened Loki with death if he couldn’t find a way to prevent the builder from finishing his task and making off with their beloved Goddess Freya, the sun and moon. Loki pleaded with the Gods to spare his life, and swore an oath that he would prevent the builder from finishing the wall, come what may.
That evening, as the builder drove Svaðilfari out for more stones, Loki, in the guise of a mare, ran out from the woods towards the stallion and neighed at him. When Svaðilfari saw the mare, he went wild with desire. He tore apart his harness and chased after the mare. The mare ran into woods with the stallion close behind, and the builder chased after the two of them, trying to catch the stallion. All night long, the three tore through the woods.
When morning came, the builder’s horse was still missing, and the now-despairing builder knew that there was no way that he could now finish the wall in time. His part in the bargain would go incomplete and he would receive no payment.
The builder fell into a mighty rage, revealing himself as a jotun and verbally abusing the Gods for their trickery. The Aesir now had definitive proof that the builder was a giant in disguise. With no more oaths restraining them, the Gods called upon Thor to pay the giant the wage he deserved: a fatal blow from Thor’s hammer Mjolnir, which shattered the giant's skull into fragments and sent him down to the darkest recesses of Helheim.
A number of months passed before Loki was seen again. His romp with Svaðilfari had resulted in him giving birth to a foal. He returned to Ásgarð leading the colt. The colt was gray and had eight legs, and was called Sleipnir. He is the best horse amongst Gods and men, and Loki gave him to Odin.
Sleipnir is the fastest horse in the nine realms, able to carry his rider safely to Helheim and back, a feat performed by Odin himself and the God Hermod, when he went to Hel’s hall to bargain for Balder’s release (read more here).
During Ragnarok, Odin will ride Sleipnir into glorious battle, leading the charge against all chaos.
Simek, Rudolf. 1993. Dictionary of Northern Mythology. Translated by Angela Hall. ISBN-10 0859915131
Jesse Byock (2005) Snorri Sturluson, The Prose Edda. 1st. edition. London, England: Penguin Books Ltd. ISBN-13 978-0-140-44755-2
Anthony Faulkes (1995) Snorri Sturluson, Edda. 3rd. edition. London, England: Everyman J. M. Dent. ISBN-13 978-0-4608-7616-2