PENSACOLA, Fla. (AP) _ A ''sweet old lady'' who played the stock market with pension money left the Social Security Administration more than $30,000 in her will, her daughter said.

Ann Roselle Hundley Hayne, who was 87 when she died June 15, received a total of $45,000 in monthly Social Security payments during the last 20 years of her life.

''She believed in giving back from whence it came,'' said her niece, Marjorie Hughey, who would not say how much her aunt's estate was worth.

Mrs. Hayne also left thousands to Christ Episcopal Church, the Disabled American Veterans and the Rockefeller Foundation, according to her recently executed will.

A check for $30,707 was forwarded to Social Security headquarters in Baltimore, Md., and deposited in a general trust fund, said Joe Black, assistant manager of the Pensacola Social Security office.

Mrs. Hayne's husband, who died of yellow fever in Africa in the 1930s, had worked for the Rockefeller Foundation, which granted Mrs. Hayne a lifetime pension upon her husband's death.