Self-dealing takes place when a fiduciary such as a broker, trustee, attorney, or other person in a position of trust takes advantage of their position to act for their own interests as opposed to those of their clients, corporate shareholders, etc.
In the case of a stock broker, when a broker agrees to carry out an order, they and their firm have a fiduciary duty to not place their interest before their clients, as well as to execute the order at the best market price available. Failure to do so constitutes a breach of fiduciary duty, and is a crime under New York state law.