According to Cornell University, a bottle-style feeder, which drips the sugar solution, often leaks and invites ants. A saucer-type hummingbird feeder, which contains the solution in a basin, doesn't leak as much.
An ant moat consists of a small pool of water placed around the feeder wire above the feeder. According to Cornell University, it prevents ants from reaching the sugar solution. Don't fill an ant moat with petroleum jelly or vegetable oil, because these substances could mat bird feathers.
A barrier of sticky grease or cooking oil can prevent ants from reaching the sugar solution. Iowa State University Extension recommends applying the grease or oil on the feeder pole or hanger line.