* Funds pay record fees for German, French bonds
* Scarcity undoes ECB stimulus, threatens stability
* Chart on collateral squeeze since QE:
By Francesco Canepa
FRANKFURT, Jan 5 (Reuters) - The European Central Bank's bond-buying programme was intended to rescue the euro zone's economy by flooding it with cash, but it is also siphoning off one of its most valuable assets: high-quality government debt.
The worst drought of German and French bonds on record is undoing some of the ECB's own stimulus and raising questions about the functioning of the financial system, bankers and analysts said.
Aggressive ECB bond buying have deprived investment funds of collateral they need to raise money and guarantee their trading positions: high-rated and liquid debt such as that issued by Germany.
For a chart: reut.rs/2hymSHD
The cost of borrowing German and other high-rated bonds has risen to record highs over the past week, despite ECB efforts to make more of the bonds it owns available to borrowers .
The bonds have historically been used to raise cash against collateral in so-called repurchase agreements, or repos. But the ECB's negative interest rates has turned the system on its head: companies are now paying to swap their cash for German debt.
Last Friday, they were paying some 4.9 percent to borrow German debt, more than on any day on ICAP records going back to 2006. The rate had since eased to 1.5 percent, but that was still twice as high as before Christmas.
Consequently, investors have no incentive to sell those relatively safe bonds and invest in riskier assets - contradicting one of the objectives that the ECB's quantitative easing programme (QE) aims to achieve.
"QE is about the quantitative aspect but also getting investors to take on more risk, and that simply doesn't have to happen if the repo market gets more expensive," Peter Chatwell, head of euro rates strategy.
Worse, the scarcity of bonds to borrow could leave banks and investment funds struggling to meet sudden obligations to post collateral - in a market sell-off, for example. In extreme cases, that could lead to the firm's being put into default by its clearing house, the middle man between parties in a trade.
"The bond scarcity increases systemic risk," one senior banker said. "If one bank fails to deliver to a central clearing counterparty, this could put it into default."
The rise in the cost of borrowing bonds was probably exacerbated by thin supply over New Year, when banks that lend the paper are reluctant to deploy resources before their full-year results.
But the record rates, far higher than at any point thus far, suggested the problem was more fundamental and likely to occur again at crunch times, such as the end of quarters.
That raises questions about the effectiveness of the ECB's bond-for-cash scheme, begun in December to allow banks to borrow ECB holdings of government bonds in return for cash.
Market participants said one of the faults of the scheme was that euro zone central banks were only allowed to lend bonds at existing market rates, meaning their power to influence them was limited.
The problem was exacerbated by tougher post-crisis regulation, which had limited banks' ability to make the market while increasing funds' need for high-quality bonds to use as collateral.
"Maybe the ECB will take more action, the door is not shut for them never to change the rules again," David Schnatz, rates strategist at Commerzbank, said.
"But the whole repo problem is likely to stay with us for some time and it is likely to get worse before it gets better."
The ECB declined to comment. (Additional reporting By Dhara Ranasinghe, editing by Larry King)