He had to clear the seas in that area to ensure uninterrupted trade between Lima, Túmbez, Guayaquil, and Panama. In 1799, he reinforced the military garrisons of the Santa Marta and Túmbez rivers, captured an English whaling frigate, destroyed a corsair schooner, and visited Guayaquil three times. In 1804, Gaínza pacified the rebellious Indigenous peoples of Lambayeque, then became the Military Chief of the Province of Trujillo, fortified the port of Paita, and captured several English schooners.
He had to clear the seas in that area to ensure uninterrupted trade between Lima, Túmbez, Guayaquil, and Panama. In 1799, he reinforced military positions along the Santa Marta and Túmbez rivers, captured an English whaling ship, destroyed a corsair schooner, and visited Guayaquil three times. In 1804, Gaínza subdued the rebellious Indigenous peoples of Lambayeque, then became the Military Chief of the Province of Trujillo, fortified Paita's port, and seized several English schooners.