The extent of emerging markets' foreign-currency borrowing binge is laid bare in new number-crunching from CreditSights.

With EM currencies down a collective 15 percent since the start of the year, the cost of repaying debt and loans denominated in foreign currencies, such as the U.S. dollar and the euro for EM countries, is likely to increase.

With that scenario in mind, CreditSights analysts Richard Briggs and David Watts have analyzed cross-border lending data from the Bank for International Settlements and corporate bond index data from Bank of America Merrill Lynch to try to figure out just how big EM's foreign debt bill could be.

First up are the BIS data on cross-border lending, scaled against a country's foreign currency revenue (i.e. exports). Figures range from a mere 6 percent in South Korea to a whopping 56 percent in Brazil.

Next up are corporate bonds, via BofAML's hard-currency, emerging-market corporate bond index, as a percent of foreign-currency revenue. Brazil dominates again, with a big chunk of its foreign FX bonds having been sold by energy companies.

Combine cross-border lending, plus foreign FX corporate bonds, then add a smattering of government debt, and you get a CreditSights chart showing total hard-currency borrowing by country.

Brazil is the standout, followed by Turkey and Columbia.

It's not a pretty chart, and unfortunately, as the CreditSights analysts note, the real picture of emerging markets' foreign-currency borrowing is probably even uglier. (When it comes to corporate bonds, for instance, the BofAML index excludes dollar or euro-denominated debt that exceeds certain thresholds.)

Say the analysts: "We have tried to capture as much of the hard currency debt as we can reliably get for a cross country comparison using BIS and the bond index data but the actual total will almost certainly be higher given that only BIS reporting banks are included and the bond debt only includes the index eligible deals."

Oh dear.