I've had cramps whether I'm hydrated or not, taken electrolytes or not, am hungry or not. The one pattern I've observed is that I've never gotten cramps when I'm well-trained. So my working hypothesis is that it's not about something I can ingest, it's mostly about whether the effort is more than I was ready to handle. Volume corrects a multitude of sins.