Currency Swap and the negative basis

So I just tried to solve a problem with currency swap and I didn’t really get about the negative basis.

Where is this negative basis coming from and why do we use it to subtract it from the rate we are receiving?

Because uncovered interest rate parity doesn’t hold, each party paying the risk-free rate in its own currency will not lead to an expected value of zero at the initiation of the swap.

The basis adjusts for that. It’s probably calculated using historical data on interest rates and exchange rates: some sort of least squares best fit regression thing.

Of more concern (to me) is that the curriculum seems to default to the basis being applied to the USD rate, without saying so explicitly. I hope that if a currency swap basis appears on the real exam, they’ll be explicit about the currency to which it applies. Especially if the swap involves two currencies neither of which is USD.

exactly, I have been following what the curriculum did, but I am not sure if there is a logic as to which rate to apply the basis