Alfprotocol, Solana-based yield farming and liquidity protocol

Alfprotocol

Solana-based yield farming and liquidity protocol with enhanced leverage and farming rewards

  • Blockchain
  • Web
  • Smart Contracts
  • DeFi
  • Yield Farming
  • Blockchain
  • Web
  • Smart Contracts
  • DeFi
  • Yield Farming

About the client

The client, Alfprotocol, is an ambitious technology-driven startup aiming to build a liquidity provision protocol as a step toward third-generation DeFi.

Details

The PixelPlex team delivered the Alfprotocol — an efficient, decentralized application for liquidity provision and yield farming. It allows users to borrow funds by offering collateral and supply tokens to pools, thus earning yield and token rewards for being liquidity providers.

Team

  • Backend developer

    3
  • Frontend developer

    2
  • UI/UX designer

  • QA specialist

  • Project manager

  • Business analyst

Business opportunity

Aware of the flaws of centralized exchanges such as hacks, scams, and market manipulation, the client has been closely watching innovations introduced by the Decentralized Finance (DeFi) market. Among the innovations are automated market makers (AMMs) that facilitate the decentralized exchange of digital assets by using liquidity pools.

But the DeFi community hasn’t stopped there. The second generation of DeFi introduced token incentives for liquidity provision (yield farming), margin trading and leveraged positions.

In the light of all these advances, the startup decided to edge towards the third generation of DeFi and build their own solution that would offer leverage for liquidity providers in AMMs.

That’s how the startup came up with the Alfprotocol.

Project goals

Having come up with their idea the startup approached PixelPlex as a reliable blockchain development vendor to take care of the solution development.

Together, we worked out the following goals:

  • 1

    Implement the core protocol for leveraged liquidity provision in AMMs

  • 2

    Implement a protocol for lending and overcollateralized borrowing

  • 3

    Provide traders and investors of various risk appetites with a platform that facilitates liquidity flows and maximizes capital efficiency

Three pink shields on a purple background

Work done

  • A set of smart contracts on the Solana blockchain
  • A protocol for leveraged liquidity provision and yield farming
  • A protocol for overcollateralized borrows
  • Frontend app and SDK for interacting with Alfprotocol
  • Quality assurance tests

Solution

Our team helped the customer build the Alfprotocol — a Solana-based protocol for liquidity provision and yield farming. The protocol allows users to participate in isolated pools as lenders and borrowers and provides for enhanced leverage and farming rewards with up to a 200x liquidity margin.

The solution comprises several key products, including:

Project features at a glance

    A white icon of a lightning bolt

    Leveraged yield farming and liquidity provision with margin of up to 200x

    A white icon of a dollar

    Incentivized liquidity pools with and without leverage

    A white icon of assets

    Single-asset liquidity pools for lenders and overcollateralized debt positions for borrowers

    A white icon of a brush

    Intuitive UI/UX which ensures seamless user experience

    A white icon of a chat cloud

    Liquidation bot that ensures the highest leveraged yield farming positions

Got an idea? We’re ready to discuss it

Alf Leverage

Alf Leverage provides a smooth leveraged yield farming experience for users with superior rewards. To implement it, our team integrated Alf Leverage with the Raydium protocol and ensured their interoperability.

When interacting with the protocol, traders can choose from different liquidity pools and enter positions by supplying their assets as collateral. They can increase their position size when investing in liquidity provision. Traders can also remove their position at any time by withdrawing the collateral or closing the entire position.

The mechanism as a whole proceeds as follows:

  • The user sees the list of available positions
  • The user borrows external liquidity
  • The user adds their liquidity to yield farm
  • Having more liquidity in their yield farm, the user gains more rewards
The UI of the farm page of the Alfprotocol project

Allotment Alf

Our team helped the customer implement Allotment Alf — a protocol for lending and overcollateralized borrowing. The protocol uses single-asset liquidity pools for lenders and overcollateralized debt positions for borrowers.

Allotment Alf allows users to deposit their assets and earn an annual percentage yield on top. Alternatively, users can borrow against their deposited assets or leverage borrowed capital anywhere in Web3.

The UI of the balance page of the Alfprotocol project

Treasury

Our team implemented a Treasury smart contract — a solution for connecting lending and borrowing protocols. The unique feature of the protocol is that it provides for routing liquidity between multiple protocols, thereby allowing Alf Leverage to use funds from Allotment Alf or any other lending protocol.

Treasury is responsible for all financial flows on the platform. It aggregates data about current loan conditions, enables borrowing, tracks position health, and keeps collaterals in its custody.

The UI of the borrow page of the Alfprotocol project

Liquidation bot

To ensure the highest leveraged yield farming positions in the Solana ecosystem, we implemented the liquidation bot run by the Allotment Alf team. The task of the bot is to ensure that underwater positions are liquidated, thus protecting lenders from loss.

Also, to mitigate risks for the platform, we’ve implemented partial liquidations. This means that the bot will not liquidate the entire position but only a specific part of it. For example, suppose a trader has a debt of $140 and collateral worth $150. To cover the debt, the bot can partially liquidate this position by selling $130 of the user’s collateral. As a result, the trader will have $10 debt and $20 collateral left.

The UI of the positions page of the Alfprotocol project

Have a new project in mind?

Technologies & tools

  • Solana
  • JavaScript
  • Pyth Network
  • Oracle
  • Rust
  • Anchor
  • React
  • Next.js
  • TypeScript
  • Web3
  • Sass
  • HTML5
  • Serum
  • Raydium

Solana-based protocol

Together with the client, we opted for the Solana blockchain as the basis of the project for the following reasons:

  • 1

    Fast transactions and low fees. Solana can handle up to 65,000 tps versus Ethereum’s 13-15 tps.

  • 2

    A large and well-developed ecosystem with multiple projects built on top of the platform.

  • 3

    A lot of institutional attention with more and more developers moving to this blockchain.

Modular approach

The protocol consists of two major components:

  • A set of smart contracts on the Solana blockchain
  • Frontend application that interacts with smart contracts

We built the Alfprotocol using a modular approach to ensure the solution's scalability. As a result, we can expand the protocol’s functionality and add new modules without having to redeploy existing contracts.

One of the key modules of the platform is the Treasury module, which contains the logic for the borrowing and lending protocols, such as how to spend the borrowed funds. To take Allotment Alf as an example, the protocol will send the borrowed funds to the user’s wallet while Alf Leverage will use them for staking on Raydium.

To track utilization rates, we used Price Oracles — a set of programs that enable the retrieval of price information for a given asset.

Results

  • up to 200x

    yield farming and liquidity provision

  • 892K

    initial market cap (as of Aug 2022)

  • 6 months

    time taken to develop the solution