Is Vote Swapping Legal?

Yes!!

Vote swapping is protected by the First Amendment

During the 2000 election, the California Secretary of State shut down a vote swapping website, claiming it violated various state election regulations. Another site also shut itself down as a result. They took their case to court, and finally in 2007, a US Federal Appeals Court ruled that vote swapping was fully protected by First Amendment and cannot be made illegal by state law.

“Both the websites’ vote-swapping mechanisms and the
communication and vote swaps that they enabled were therefore constitutionally protected. At their core, they amounted
to efforts by politically engaged people to support their preferred candidates and to avoid election results that they feared
would contravene the preferences of a majority of voters in
closely contested states. Whether or not one agrees with these
voters’ tactics, such efforts, when conducted honestly and
without money changing hands, are at the heart of the liberty
safeguarded by the First Amendment
.
” Cf. Brown, 456 U.S. at
52-53; Buckley, 424 U.S. at 14-15; Monitor Patriot, 401 U.S.
at 271-72; Mills, 384 U.S. at 218-19.12

In the 2016 election, numerous vote swapping websites were functioning without any threat of legal action. Vote swapping is also common practice in the UK and in many other countries.

Selling your vote, however, is definitely illegal

Under Title 18 of the US Code, chapter 29, code no. 597, whoever makes or offers to make an expenditure to any person to either vote or withhold his vote, or to vote for or against candidates, and whoever solicits, accepts or receives any such consideration for his vote or withholding his vote shall be fined under this title or imprisoned not more than one year or both, and if the violation was wilful, shall be fined under this title for not more than 2 years or both.

So definitely no offers to exchange money (or gifts in kind) allowed!