What Happens When a Broker Represents Both Sides of a Sale?

What Happens When a Broker Represents Both Sides of a Sale?
In New York, it is legal (though discouraged) for an agent to represent both the buyer and seller, or for members of the same team to represent both parties.