Estate agent fees are normally payable on completion of the sale. The deposit is refundable so it wouldn't make sense to dip into that for fees anyway. If this is not just an academic question then ask your EA what their procedure is for collecting their remuneration.