I don't know the answer, but this is known as a "uniform-price auction", as opposed to "pay-as-bid auction". There is a lot of literature on the subject. For electricity markets, things are complicated by the finite capacity of transmission links and lack of storage.