A week ago, it seemed like the Red Sox were poised to crawl out of the AL East cellar and make a run at a wildcard spot. Now, less than a week from the trade deadline, they’re starting to sell. Jake Peavy is the first piece to go, with Boston sending the struggling right-hander back to the NL West in a deal with the Giants.

Peavy has not been good with the Red Sox this year, but this trade season remains a seller’s market, and Boston seems to have come away with two very serviceable pieces in the deal — lefty starting prospect Edwin Escobar and righty relief prospect Heath Hembree. Baseball America tabbed Escobar as the Giants’ second-best prospect at the start of the year, while Hembree ranked 7th. Escobar even placed in BA’s top 100 prospects, coming in at #56.

Hembree’s been described as a possible late-inning reliever in the future, but problems developing an offspeed pitch have kept him in Triple-A for the past three seasons. He did get a September call-up last season, though, and fared well, striking out 12 and walking just two in 7.2 innings of work. As Red Sox relievers continue to come up in trade rumors, Hembree could find his way to the big leagues with Boston sooner rather than later. Escobar is a bit further off, but could help the Boston rotation as early as sometime next year.

The 33-year-old Peavy was carrying a 4.72 ERA with the Red Sox, which was actually being helped by Boston’s defense. His 4.81 FIP is one of the highest in the majors this year among qualified starters, with only five pitchers faring worse this year — Jeremy Guthrie, Roberto Hernandez, Chris Young, Eric Stults and Marco Estrada.

And yet the Red Sox were able to deal him for a guy who projects as a mid-rotation starter and a hard-throwing reliever that could end up contributing in the late innings. If the Jeff Samardzija and Huston Street deals didn’t show you that GMs looking to buy are mostly over hoarding prospects, this deal should do the trick. Peavy has barely been above replacement level this season (0.7 WAR, according to FanGraphs) and he’s bringing back promising young pitching. Imagine what David Price would command if the Rays hadn’t gone on their recent run.

Brian Sabean’s never been shy about pulling the trigger on deadline deals if he thinks he has a chance to make a real postseason push, though. Remember — this is the same guy who gave up Zack Wheeler for a couple of months of Carlos Beltran in 2011. The Giants were looking for someone to held solidify the back end of their rotation, and while Peavy has struggled in the American League, perhaps he’ll find some better luck with a return to the NL West’s spacious ballparks. Pitches like this will still get crushed, though, and that’s been his problem this year.

He joins San Francisco in the middle of a much-hyped series against the Dodgers, and the team has already announced he’ll be starting tomorrow’s game opposite Hyun-Jin Ryu on Sunday Night Baseball. Aside from the battle for the West, the Giants are also looking to further separate themselves from the slew of teams battling for the NL’s wildcard spots. They enter Saturday with a half-game lead over the Dodgers in the West, but if they were included in the wildcard standings, they would be just two games ahead of Atlanta, Pittsburgh and St. Louis in the loss column.

Speaking of the Cardinals, they were heavily rumored to be looking at Peavy, too. With pitching options drying up in the days leading up to the deadline, it will be interesting to see how they respond. Do they give in and fork over the prospects necessary to make a deal for someone else? Or do they stick with what they’ve typically done in years past, keeping their young talent and letting them figure it out down the stretch?