All perfectly legal according to the rules set up for the sale of public utilities to privately owned companies. Better still, the new Tesla battery (Hornsdale Power Reserve) is using its non contracted 30MW component to rake in the cash by buying cheap and selling dear.
https://hornsdalepowerreserve.com.au/
(scroll down)

