(Adds share performance, background about ownership in paragraphs 6, 11)
By Guillermo Parra-Bernal
SAO PAULO, Nov 3 (Reuters) - BM&FBovespa SA, Latin America's largest bourse, and rival clearinghouse Cetip SA Mercados Organizados have discussed merging, seeking to bolster their strength amid eroding confidence in Brazil's capital markets and a potential ratings downgrade of the country.
The companies, which are based in São Paulo, are working on a plan that could be presented to their respective boards and then put to vote among shareholders, BM&FBovespa said on Tuesday, adding the talks may not necessarily result in a deal.
The announcement comes after years of speculation that BM&FBovespa could bid for Cetip to grow in registration and custody of fixed-income and credit market instruments - segments in which the bourse has failed to gain market share. Cetip is Latin America's largest securities clearinghouse.
A tie-up would make it harder for foreign rivals to expand in Brazil, which is the world's No. 2 emerging market economy, while helping the combined firm cope better with deteriorating perceptions about market risks in Brazil. The country's economy could shrink the most in a quarter century this year.
In September, Standard & Poor's stripped Brazil of its investment-grade credit rating, increasing concern a second such move could soon follow as the country wrestles with a swelling budget gap and political turmoil.
Shares in Cetip rose the most since the company went public in 2009, while those in BM&FBovespa had their largest gain in 5 1/2 years.
A deal could seek to replicate recent industry tie-ups in which growing trading volumes inorganically helped boost the profitability and value of so-called market structure firms, said Domingos Falavina, an analyst at JPMorgan Securities. Rival exchanges usually combine operations to trim fixed costs, although revenue synergies can be harder to extract.
"Our initial thought would be to view a potential merger as positive to consolidate market structure, but wonder what cost synergies can realistically be extracted," Frederic de Mariz, an analyst with UBS Securities, wrote in a client note.
The combined market value of the two firms is $7.7 billion, Thomson Reuters data showed.
BM&FBovespa was created at the end of 2008 from the merger of commodities and futures exchange Bolsa de Mercadorias & Futuros SA and Bovespa Holding SA, which owns the São Paulo Stock Exchange.
Rivals CME Group Inc and Intercontinental Exchanges Inc own stakes in both firms, and it is unclear how that could affect BM&FBovespa-Cetip merger talks, said Carlos Macedo, an analyst with Goldman Sachs. (Editing by Franklin Paul and Frances Kerry)