The foundation is: marginal price > executed price > price after swap. And this check is verified for multiple amounts