Creating intelligent energy markets