LayerPixel: How to Combine Uniswap and Balancer on TON? 

Detective spotted a good article about #LayerPixel. And translate it into English with the author's permission.

For those who don't know what is #LayerPixel. #LayerPixel is building an all-in-one #DeFi solution on TON, basically bringing the best of #Uniswap and Balancer to the table.

From token launches to trading and staking, #LayerPixel's got it all covered. Plus, it's introducing the Layer 1.5 into TON. If you're interested in what is Layer 1.5, then this article is a must-read.

|2047.5134168157429x1213.3747963469277

DeFi has now entered its sixth year of development, spanning three growth cycles during the “2017-2018,” “2020-2021,” and “2023-2024” periods, each marked by rapid expansion phases.

In 2018, DeFi was in its early stages, building foundational technologies like token swapping, AMM, and staking. The year 2021 marked the beginning of DeFi Summer, leveraging a well-established infrastructure to achieve exponential growth in trading volume and total value locked (TVL).

Post-2021, DeFi applications began to iterate towards more refined functionalities. For instance, Uniswap evolved from v2 to v4, almost perfecting the DEX AMM business. On Ethereum, platforms like Balancer and Aave built upon Uniswap’s AMM and liquidity provision technologies with deeper, complementary developments.

Other popular ecosystems followed suit. In recent cycles, DeFi on high-speed chains like Solana transitioned from basic functionalities to more feature-rich developments. Solana, for example, not only boasts Raydium but also more advanced platforms like Jupiter and Meteora, which focus on liquidity provision.

Every ecosystem enhances its data and technological richness during growth periods, a necessary direction for ecosystem growth. In the 2024 bull market, TON is rapidly expanding. However, TON’s DEX functionalities are not yet complete; the primary DEX offers only basic Uniswap v1 features. There is an urgent need to quickly develop additional complementary functionalities.

In DEXs, investors swap tokens for three main purposes: firstly, to obtain tokens at lower prices; secondly, to exit from liquidity; and thirdly, to conduct reasonable asset allocation and compounding, which Balancer excels the best.

In TON ecosystem, LayerPixel is a modular middleware platform attempting to supplement the entire process of TON asset trading. It is introducing the combined capabilities of Uniswap and Balancer into TON.

Why Do We Need Balancer?

Uniswap is the pioneer of AMM. In the trading market dominated by order books, Uniswap’s AMM technology has become a household name and a basic function of DEXs. In its v1 version, the main functions were swap and LP. In v2, the trading routing function in swap was modified, which is the precise matching of transactions in AMM. v3 implemented liquidity provision within a “fixed price range”. The upcoming v4 will continue to supplement the refined functions of liquidity provision, allowing LPs to better manage liquidity.

In addition to handling swaps, because of the large number of token trading pairs, Uniswap also has its own oracle, which can provide data for other DeFi applications.

Given the capabilities of Uniswap, why do we need Balancer?

Balancer can help on three other aspects:

  1. Adding weighted settings in the LP part of AMM.
  2. Providing tokens through LBP pools during IDO openings.
  3. Offering multiple liquidity pools as compounding products.

Clearly, Balancer’s role is complementary, enhancing the liquidity supply function of AMM pools on a foundational level.

Unlike other AMM pools that only offer a 50/50 weight, Balancer’s weighted pools allow users to create pools with more than two tokens and custom weights, such as 80/20 or 60/20/20.

 


Source: Balancer docs

 

The benefits of weighted pools include adjusting the liquidity levels of different tokens and enabling directional management of token market capitalization, making it more suitable for small and medium-sized project teams. For LPs, the higher the weight of a token in the pool, the less impermanent loss they suffer when the price spikes. Weighted pools allow users to choose the proportion of liquidity assets they invest, using a more flexible amount of assets and avoiding larger impermanent losses.

For IDO operations, the Liquidity Bootstrapping Pool (LBP) can play a significant role. Most tokens listed on DEXs experience extreme premiums for a short period. LBP uses a time-weighted algorithm, with initial and final weights and times selected by the pool owner. During an IDO, LBP gradually reduces the token price until it reaches market equilibrium or an acceptable market level.

In the current cycle, most newly listed tokens bear high premiums at launch, and price plunges often occur when BTC or ETH prices fluctuate, highlighting the importance of token price control post-launch.

Additionally, for market capitalization management, most projects lack sufficient funds for effective management. Using LBP to launch under-allocated tokens allows projects to achieve listing and market capitalization management with minimal initial funds.

LayerPixel Originates from Complementary Development

TON is flourishing, with TON Foundation actively promoting its growth, including price control for TON token, and support for project tokens, on-chain transaction volumes, and total value locked (TVL). However, tools that lack refined functionalities struggle to effectively boost ecosystem growth.

Currently, the TON ecosystem is on an upward trend, and both investors and projects have clear demands for the ecosystem:

  1. Investors want to find early-stage projects and secure early tokens.
  2. Small and medium-sized projects want to reduce development costs.
  3. Small and medium-sized projects aim to conduct market making at minimal cost.

These needs all point to open-source application protocols and middleware-type platform projects.

LayerPixel is a mature team rooted in the TON ecosystem. Guided by the approach of complementary development, it integrates a middleware platform covering the entire business process, including token issuance, token trading, liquidity provision, oracle services, and staking pools.

LayerPixel can provide services for early-stage projects across the ecosystem through its overall business capabilities, provide an entry point for users to discover early-stage projects, and also provide support for front-end, SDK, and API on the technical side.

LayerPixel’s DeFi Solutions

 

LayerPixel’s solution encompasses four main components: TonUP, PixelSwap, Pixacle, and PixelWallet.

TonUP is a launchpad on TON, launched in August 2023 with the support of the TON Foundation. It has hosted several IDOs for DeFi, GameFi, and other projects within the TON ecosystem. The UP token reached a peak market cap of over $100 million. LayerPixel, incubated by TonUP, includes foundational elements such as the decentralized exchange PixelSwap.

PixelSwap is currently the only DEX on TON that supports AMM, weighted pools, and LBP simultaneously. It allows users to customize specific token exposures while providing liquidity. Additionally, PixelSwap enables direct exchanges between Jetton assets, even without a liquidity pool for the specific trading pair. PixelSwap helps liquidity providers maximize their income through various staking pools. By seamlessly integrating staking, lending, and liquidity mining, users can enjoy optimal returns.

 

 

Due to the differences between TON’s native asset protocol Jetton and Ethereum’s technical framework, Ethereum’s functionalities are challenging to implement directly in TON’s native environment. To address this, LayerPixel designed the Settlement Layer on the existing TON network Jetton standard. This set of smart contracts functions like a bank, allowing users to deposit funds and authorize third-party contracts that meet the standards to call these assets. This mechanism enables asset authorization and atomic swaps.

In Telegram Mini App scenarios, users only need to invoke a TON wallet (like Tonkeeper) once to allow mini-app developers to call a specified amount of tokens. This significantly enhances user experience, and LayerPixel is currently the first protocol on TON to achieve this functionality.

Moreover, PixelSwap retains the interface for basic asset liquidity provision, allowing other projects to use this liquidity. In the future, it might become a liquidity provision node on TON, similar to how Balancer is on Ethereum and Meteora is on Solana.

Leveraging PixelSwap’s natural pricing capability, LayerPixel has expanded to include an oracle module called Pixacle. This lightweight oracle based on PixelSwap allows developers to obtain the latest asset prices by calling smart contracts directly.

These components—launchpad, swap, and oracle—enable the development of various application types, such as aggregators, more refined DEXs, lending platforms, and derivatives platforms.

PixelWallet, a future addition, will offer an external wallet entry point. This entry point and functional modules will be open to all collaborators, assisting projects in user acquisition through the wallet. Naturally, the wallet will integrate all functionalities, providing a unified design.

Lastly, beyond business operations, developer-friendliness is a crucial focus for LayerPixel. In addition to collaborating with platforms like Bot Gameyard and game developers, LayerPixel aims to lower user barriers by offering its SDK as an embedded service for Telegram Mini App developers.

TON’s development language is entirely different from EVM-compatible languages, making FunC and Tact programming challenging. Integrating DeFi into Telegram Mini App frontends is also difficult, compounded by the sensitivity of user asset security and systematic risk control.

Hence, for developers, lightweight modularity for easy composition is essential, as well as developer-friendly support and adaptation.

LayerPixel addresses this issue with a middleware approach. It can be considered a Layer 1.5 solution based on the TON network. Unlike Layer 2 solutions with independent consensus and sequencers, it creates a set of smart contracts that interact with the TON network to facilitate atomic transactions and contract interactions.

Furthermore, leveraging the features of Telegram Mini Apps, LayerPixel has first adapted the frontend and is advancing SDK and API-level convenient development. In LayerPixel’s vision, future Telegram Mini App developers won’t need to understand complex blockchain support or learn new programming languages; they will simply use LayerPixel’s tools and functional modules.

LayerPixel’s team has shared their perspective on TON assets during an online event. They believe that many long-tail assets will exist on TON, possibly based on Telegram Mini Apps, such as mini-games. These long-tail assets typically have low market capitalization and liquidity but possess native trading communities with a certain volume of transactions. LayerPixel aims to help such projects issue assets more quickly and efficiently.

Final Thoughts

The emergence of LayerPixel has introduced a standard business loop example to TON ecosystem’s DeFi track. On Ethereum or Solana, such DeFi loops are the most common process for ecosystem asset operations and are crucial in supporting ecosystem value.

In previous cycles, the richness of Ethereum’s DeFi has consistently maintained high TVL data, steadily supporting the ETH economic model.

For TON, while LayerPixel aims to address the ecosystem’s functional deficiencies, its most significant contribution is providing ecosystem developers with the opportunity for creative, divergent thinking. The essence of a middleware platform is to standardize replication, offering the momentum for scalable development. The rapidly growing TON ecosystem needs LayerPixel and developers who will engage in secondary development based on LayerPixel’s liquidity, data, and development modules.

LayerPixel’s role in TON is not just about filling gaps but about enabling a vibrant, innovative, and scalable future for all involved.

This article was updated on July 2, 2024