Wilmer Flores and the Giants agreed to a contract that guarantees $16.5 million over the next three seasons and could be worth up to $21.5 million.