My homebrew recipe:
1 Cup Sugar
4 Tsp Salt
2 Tsp Potassium Chloride (Salt Substitute)
2 Tsp Sodium Bicarbonate (Baking Soda)
Use 3 Tbsp per liter of water
For calcium and magnesium I just swallow capsules separately, although I know there are liquid forms available.
Mostly I just use HEED and Endurolytes - more expensive but simpler. On longer rides I can get calories from just about anything except fruit. On longer runs I use Hammer Gel and Endurolytes. I tried a lot of natural substitutes for gels (molasses, barley malt syrup, rice syrup, combinations of those), but they were all too high in fructose for my digestive system.
Speed comes from what you put behind you. - Judi Ketteler