SEATTLE — Five times in the last week, President Trump has pointed his Twitter arrows at Amazon over what he insists is a bad deal for the United States Postal Service.

Mr. Trump wrote on Tuesday that the agreement, which sets what Amazon pays the Postal Service for many orders, costs American taxpayers billions of dollars. “I am right about Amazon costing the United States Post Office massive amounts of money for being their Delivery Boy,” he wrote.

The details about the deal are not public — they are considered commercially sensitive information — but some of the available evidence suggests the opposite: that Amazon has been a boon to the Postal Service.

The Postal Service has experienced a steady decline in the amount of mail it ships as more of its customers turn away from postcards and letters in favor of email, texting and other forms of digital communication. The total pieces of mail it shipped last year was 149 billion, down from 212 billion a decade earlier.