This answer is an exact reproduction of Rubiksmoose’s answer to a similar question (speeds adjusted to be appropriate to beholders).
Movement not speed
There is no way to calculate the swim speed (as asked in the question) for a creature without one. You can however, calculate how far the creature would be able to move while swimming using other (non-swim) speeds.
Creatures can swim using any speed they have
The rules for swimming and climbing say:
While climbing or swimming, each foot of movement costs 1 extra foot (2 extra feet in difficult terrain), unless a creature has a climbing or swimming speed. (PHB p. 182)
Note that no speed is specified. In fact, only movement matters at all, not speed. Since you can turn any of your speeds into movement, there is no reason why you would be forced to use one speed over another. Thus, you can use any speed to swim.
This has been confirmed by Jeremy Crawford:
The rule on swimming doesn't specify that you're using your walking speed. You use whatever speed you can to paddle, kick, and otherwise swim.
Since you can use any speeds you have, you can of course use your fly speed. Swimming with a fly speed of [20] would allow you to move [10] feet swimming.