NEW YORK, Oct 3 (Reuters) - The cost of raising short-term U.S. dollar funds in Japanese and European currency swap markets surged to more than two-year highs on Monday, suggesting increased demand for the greenback as funding pressure grew due to volatile financial markets characterized by global central bank tightening.

The cross-currency basis swap, or relative premium for swapping euro and yen for dollars, has widened since last week due in part to year-end related demand for the U.S. currency to square up corporate balance sheets, analysts said.

Dollar demand typically rises among corporates and asset management firms as the end of the year approaches, with portfolio rebalancing and fund transfers requiring currencies like the euro and yen to be converted to the U.S. currency.

But that spread has remained elevated as investors grew cautious about the global outlook.

The three-month euro cross rate hit -52.250 basis points (bps) on Monday, the highest premium in favor of the dollar since March 2020 just before the pandemic became widespread.

The current euro swap rate meant that investors were willing to pay more than 52 bps over interbank rates to swap three-month euros into dollars.

The three-month yen swap rate was at -63.75, the highest since March 2020 as well, while sterling three-month swap rates were at -27 on Monday. Last Thursday, that premium was at -28 basis points, the highest since March 2022.

"There's a little more funding stress this year than in 2021 and 2020," said Greg Anderson, global head of foreign exchange strategy at BMO Capital Markets in New York.

He added that increased volatility from global tightening, central bank interventions, and high inflation have contributed to the stress.

Anderson pointed out that in 2020 and 2021 some investors would have waited until Nov. 28 or 29 to exchange their currencies for dollars to cover balance sheet needs, noting that liquidity would not be a problem.

"But in this type of environment with wider credit spreads, uneasy markets, and interventions all over the place, even though it costs investors more, they covered that risk for three months in September, instead of waiting and covering for one month in November," said Anderson.

"There is more of a desire to play it safe because the liquidity may not be there when they need it."

FX swaps allow investors to raise funds in a particular currency, such as the dollar, from other funding currencies such as the euro. For example, an institution which has dollar funding needs can raise euros in euro funding markets and convert the proceeds into dollar funding obligations via an FX swap.

Since FX swaps are subject to counterparty and credit risks, the pricing of these contracts is affected by perceptions of creditworthiness of the banking system or external risks that can affect liquidity, analysts said.

In the fixed income market, investors are keeping track of U.S. front-end spreads on interest rate swaps tied to the Secured Overnight Financing Rate (SOFR). Those spreads over Treasuries have been volatile the last few weeks, and reflect changing demand for U.S. government debt.

SOFR, the Libor replacement backed by the Federal Reserve, is a broad measure of the cost of borrowing cash overnight, collateralized by Treasury securities.

Last week, U.S. SOFR spreads on the front end narrowed, suggesting declining demand for Treasuries among global central banks as they seek to defend their currencies.

For instance, U.S. five-year SOFR swap spreads over Treasuries tightened by about -27.3 basis points (bps) last Tuesday, the narrowest margin ever since SOFR spreads started trading in 2021.

On Monday, however, that spread has widened to -23.6 bps.

"There were more headlines around central banks selling Treasuries to defend their currencies or at least broaching the possibility given that the U.S. dollar has been so strong," said Dan Belton, fixed income strategist at BMO in Chicago.

Last week's data from the Federal Reserve showed that foreign official holdings of Treasury securities fell by $38 billion in par value terms last week. According to money market research firm Wrightson, that was the largest weekly decline since the early weeks of the pandemic. (Reporting by Gertrude Chavez-Dreyfuss; Editing by Richard Chang and Jonathan Oatis)