Over the past few years, Brazilian-based fintech StoneCo (STNE -2.23%) has experienced its fair share of ups and downs. After going public in 2018, the company's stock skyrocketed and reached $95 per share in 2021. However, the tides turned, and the company grappled with a pile of bad debt in the face of macroeconomic pressures in Brazil.

This year the stock is up 30% while it works to expand its payments business and improve its balance sheet. Here's why StoneCo could be an intriguing investment opportunity long term.

This part of the business has been a drag in recent years

StoneCo provides software and financial services to small and medium-sized businesses across Brazil. It provides payment solutions, digital banking, and credit to those customers. StoneCo caught investors' eyes when it went public in 2018, largely because Warren Buffett's Berkshire Hathaway opened a position in the fintech. At the end of the first quarter, Berkshire has 10.7 million shares in the fintech worth about $102 million.

In the years after its initial public offering (IPO), the company did quite well for investors. However, its credit business encountered major setbacks a couple of years ago. Brazil's economy faced headwinds from high inflation and a weak recovery following the pandemic.

Not only that, but StoneCo relied on Brazil's national registry database to underwrite loans and found out that this registry contained bad data. It extended loans to businesses that weren't creditworthy. As a result, it lost hundreds of millions of dollars on its credit portfolio and still had $80 million in bad debt on its books at the end of last year. 

This part of the business has thrived

While its credit business has suffered, StoneCo's payment processing business is thriving. StoneCo enables merchants to accept payments, deal with fraud, obtain banking and credit info, and gain insights through its platform -- which has drawn comparisons to Block's Square payment ecosystem.

Its revenue rose 31% in the first quarter, while payment volume among small and medium-sized businesses increased 25%. Its customer base of 2.75 million active payments clients jumped 48% from the same period last year, while banking deposits jumped 65%. 

Two people shop in an outdoor market.

Image source: Getty Images.

It is improving its credit business and being more efficient

StoneCo has done a good job working through its bad debt and improving its credit business. It's focused on leveraging technology to improve its risk assessment models, underwriting, and credit monitoring mechanisms to mitigate risk and offer more reliable credit solutions to clients. 

It looks to take a conservative approach to expansion, increasing the portfolio in alignment with market conditions in a more cautious and sustainable manner. It is also focused on cost management initiatives to improve operating leverage while maintaining solid growth.

Is it a buy?

StoneCo has an intriguing story. The company is working on improving its credit business, which has been a drag on earnings and its stock over the last couple of years. And its payment business continues to grow at a solid pace. For the second quarter, management estimates that its total payments volume will rise between 19% and 20%, while total revenue growth is expected to be around 25%.  

STNE P/S Ratio Chart.

Data source: YCharts STNE P/S Ratio

StoneCo trades at a price-to-sales ratio of 2.3, well below its historical average of 15 since going public in 2018.

The fintech benefits from being one of the few e-commerce software providers for small and medium-sized businesses in Brazil and will likely remain a popular option for merchants in the area. The company continues expanding, and its current valuation looks like an appealing stock to buy today and add to over time.