Composable Finance
Published in

Composable Finance

Active Liquidity Bots Allow LPing to Keep Pace with the Cross-Chain Expansion of DeFi

In any financial system, liquidity is a paramount concern; without appropriate levels of liquidity, transactions come to a screeching halt. DeFi is no exception, In fact, liquidity providing has been a major driver behind DeFi’s boom and sustained success.

However, existing liquidity provisioning measures are insufficient to support transactions in the burgeoning cross-chain ecosystem. Within this space, an unlimited number of possible transactions are being facilitated, meaning that liquidity is needed in innumerable very specific scenarios — i.e. no longer just ETH being traded for USDC on Ethereum and similar basic swaps, but transfers of any sort of token between any sort of layer and chain. Thus, very specific liquidity is required at relatively short notice, and often in large quantities.

In this article, I describe how Composable Finance’s (Composable’s) active liquidity bots are the first tool to effectively tackle the unique needs of cross-chain liquidity, ensuring the uninterrupted flow of transactions in the chain-agnostic blockchain ecosystem of the future.

I also explore how actively liquidity provisioning (LPing) on Mosaic can unlock new cross-chain LPing strategies positioned to revolutionize the DeFi space, just as the origination of LPing revolutionized crypto.

Active Versus Passive Liquidity

Before we can discuss Composable’s active liquidity bots, it is important to understand the difference between active and passive means of LPing.

Passive liquidity involves providing generic liquidity, where the capital is provided up-front/proactively before any particular transactions are identified needing this liquidity. In contrast, active liquidity can be thought of as “just in time” (JIT) liquidity, where a particular immediate need of liquidity is identified and actively met by a liquidity provider (LP).

JIT liquidity is provided when someone makes a request to transfer an amount of tokens greater than the available liquidity, and another individual provides liquidity for that transfer. This can be compared to the way orders are filled on TradFi exchanges, where orders are seen and then filled only after being specifically identified and met by a provider.

One key advantage to this strategy involves providing single-sided liquidity. This contrasts to the primary means of LPing in DeFi, where users provide a token pair on a decentralized exchange (DEX) like Uniswap or SushiSwap. For instance, most DEXs have limitations due to the constant product market maker model that they rely upon, as these use the formula x*y=k. In contrast, a system that makes use of JIT liquidity helps mitigate a few inherent issues with DEXs. Specifically, price impact can be lessened due to dynamic volume from active liquidity. In other words, there is a maximum fee compared to most DEXs’ exponential fee curves, meaning that the user is not paying an exorbitant amount in fees.

Of course, both forms of liquidity are important. Passive liquidity provides a readily available means of facilitating transactions. Yet, often, passive liquidity is insufficient and specific needs for liquidity arise that are beyond the available liquidity in the system. This is projected to be more true than ever for DeFi as it enters its cross-chain era, as more and more very specific transactions are facilitated, and will naturally need liquidity to occur. This is where active liquidity becomes important, allowing LPs to step in and meet specific needs for liquidity. Currently, there is not a sufficient system for meeting these needs in DeFi, and this must be addressed as the space expands cross-chain.

Composable’s Active Liquidity Bots & Their Advantages

Composable Finance steps in with a novel solution to this pressing concern with our active liquidity bots, which represent just our first step into mechanisms for active LPing cross-layer.

When applying these liquidity concepts to Composable’s Mosaic product, passive liquidity is made available from users who are providing liquidity on paired tokens on Mosaic. This liquidity is currently being routed into liquidity vaults on Mosaic, where it can be utilized as needed. Passive LPs are rewarded with a proportion of platform fees for providing liquidity in this manner. The introduction of our active liquidity bots will serve as an invaluable means to meet the needs of liquidity beyond this passive liquidity provisioning, additionally allowing users a novel form of yield: a proportion of generated transaction fees from the transactions they support will be split between themselves and passive LPs.

Essentially, users will be able to program active liquidity bots on Mosaic that provide temporary liquidity (with the option for providing passive liquidity if needed) when a liquidity gap is identified in a pending transaction — with increased compensation for meeting these immediate liquidity needs.

These active liquidity bots provide a new yield-generating opportunity on the Mosaic platform. In the event of active LPing, a higher proportion of generated fees will be awarded to bot owners, splitting fees with passive liquidity providers (70:30 active: passive LPs). Platform fees on Mosaic will be generated along the fee model indicated here, which Composable will adapt to have a maximum of 4% fee and a threshold of 50% liquidity.

The basic profit equation used by these active liquidity bots is:

total profit = liquidity * reward fee — total gas fees — Mosaic fees

Beyond this new means of income, an advantage of participating in active LPing on Mosaic is the many-to-one relationship between a bot and the Mosaic liquidity vaults. Specifically, a user can run multiple instances of the active liquidity bot for each network they want to provide liquidity for. The bot then listens for transfer events from other networks to the target network where liquidity is needed. Thus, this opportunity is broadened.

Additionally, when compared to passive LPing, running your own active liquidity bot puts your money to work for you without having to lock up your funds as an LP pair and deal with impermanent loss.

These advantages all compound to deliver a new, optimized means of yield generation for LPs.

Bot Design

Composable is making this opportunity user-friendly and accessible by making active liquidity bots easily configurable and simple to set up.

Removing barriers to entry is an important tenet of DeFi, and a core mission for Composable Finance. Thus, we make our active liquidity bots incredibly easy to work with. A user can configure this bot using a free public RPC endpoint for interacting with the blockchain or a paid-for custom RPC endpoint.

The following diagram depicts the design and flow of Composable’s active liquidity bots:

As you can see above, one can start up and initialize a Composable active liquidity bot by using the Composable SDK and following these steps. Once the bot is initialized to monitor certain parameters, it can begin watching for opportunities to provide or withdraw liquidity actively as opportunities arise.

While the concept of an active liquidity bot is relatively novel in the DeFi space, we are able to construct it with existing popular tools, making it very easy for developers and those familiar with crypto to work with. Specifically, this includes Node.js, Typescript, and Ether.js.

By using these highly familiar tools, we hope to even further break down barriers to entry and foster a community of developers that make this built-in maximal extractable value (MEV) opportunity more accessible.

Interesting Applications & Future Uses

Using these active liquidity bots on Mosaic opens endless possibilities for the future:

In just one example, imagine a fully autonomous active liquidity bot that uses its profits to swap on a DEX for gas tokens. Thus, it operates like a self-driving car that fills up its tank in order to continue providing a low-cost ride-sharing service. This means that the bot owner can generate a passive yield (one of the benefits normally associated with passive LPing — but here generated from active LPing) while allowing the bot to “steer” and “refuel” itself.

Further, active liquidity bots can allow for smart contract integration with automated market makers (AMMs). This would enable active LPs to provide liquidity for one asset and withdraw into another asset — unlocking additional currently non-existent opportunities.

The possibilities here are truly endless, facilitating a vast range of different strategies that were previously not possible, but now are opening up within a cross-layer, cross-chain environment.

Summary:

Everyone in DeFi has come to recognize the importance of liquidity, just as everyone in the space is beginning to realize how critical cross-chain interoperability is. Yet, as a community, we have not fully grasped the vast opportunity that the combination of the two — cross-chain liquidity — represents.

At Composable Finance, we believe that cross-chain LPing, particularly via our active liquidity bots, could lead to the next era of DeFi: Cross-Layer Cross-Chain Liquidity. Just as the advent of LPing with token pairings revolutionized the space, we believe that active means of LPing cross-layer will be even more revolutionary.

For a DeFi user, this functionality helps to ensure that swaps across layers and chains are seamless. For a liquidity provider, this functionality helps to have LP reward exposure across layers and chains. More volume due to interoperability drives more rewards to the provider.

Thanks to these active liquidity bots, providing active liquidity on Mosaic is like providing a high-speed rail to the cross-layer, cross-chain ecosystem, whereas network bridges are the slow and clunky toll roads of the blockchain highway.

Yet, these advantages are just the tip of the iceberg. Our active liquidity bot is merely a proof of concept, using the most basic strategy for providing active liquidity. We can’t wait for people to innovate these ideas and build more utility for the space as a whole.

— — —

If you are a developer with a project you think fits our ecosystem and goals, and you would like to participate in our interactive testing landscape at Composable Labs, reach out to me on Telegram at @brainjar.

--

--

Composable Finance is building the interoperable infrastructure for modular DeFi.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
0xbrainjar

Composable Finance Founder & CEO. I write about R&D at Composable Finance. Physicist by training