On July 26, 2017, the San Francisco Giants traded reliable infielder Eduardo Nunez to the Boston Red Sox for two low-level minor league pitchers.

It was a rental trade at the time with Nunez headed into free agency. He eventually re-signed on a two-year, $9 million contract and helped Boston win the 2018 World Series.

But nearly two years later, Nunez's time with the Red Sox is up. On Monday, the 32-year-old was designated for assignment.

The Boston #RedSox today announced the following roster moves: pic.twitter.com/ANsWg4lqCj — Red Sox (@RedSox) July 15, 2019

Meanwhile, the Giants are quite pleased with the two pitchers they got in return.

The main piece of that trade, Shaun Anderson, has reached the major league level and has a 4.48 ERA in 60 1/3 innings for the Giants. At 24 years old, he's shown flashes of brilliance and looks like a part of San Francisco's rotation for years to come.

The other player in the trade, right-handed pitcher Gregory Santos, was just 17 years old at the time of the trade and was playing in the Dominican Summer League.

Now, Santos is finding success stateside. In 34 2/3 innings for Class A Augusta, Santos has a 2.86 ERA. MLB Pipeline has the 19-year-old ranked as the Giants' No. 7 overall prospect.

[RELATED: Rodriguez shows energy in Giants' win]

The Giants liked Nunez's versatility, but they made the smart move to trade him for prospects. Two years after that trade, they are reaping the benefits and are the clear winners in that rental deal.

The Nunez trade should serve as a roadmap for the Giants as the 2019 trade deadline approaches. They still can get valuable pieces for players that are seen as rentals. It might take a few years for the major league team to see the benefits of trades made over the next two weeks, but the Giants are playing the long game. They can afford to take on lower-level prospects and let them develop.