A unified bilevel programming framework for price-based market clearing under marginal pricing