An agency with a buyer and seller does not have to be in writing. It can be created by implication by your actions or the buyer's or seller's assumptions. It is your duty to let them know who you represent.
Most agents assume the person paying the commission is their client.
This is not necessarily true. An agent may be a buyers broker while the seller pays the commission. Agency is not tied to the commission. Counseled a friend or relative in the purchase of a home through you. If so you may have acted as the buyer's agent.