PembRock Finance

The DeFi sector is constantly expanding with new products and developments, bringing in greater investment from both individuals and institutional players. Yield farming became popular at the start of 2020, helping to spur the development of projects and grow liquidity across different blockchains.

PembRock Finance is the first leveraged yield farming project built on NEAR, integrating with Ref Finance, Jumbo Exchange and other Dapps in the blockchain’s ecosystem. With a focus on automation and user-friendliness, the platform aims to bring in new users with stable lending returns and the ability to obtain undercollateralized loans for yield farming with up to 3x leverage.

As a NEAR Guild, our team at INC4 was tasked with supporting the project, and in just a few months, we were able to take PembRock from the idea stage to a lean and functional product.



Challenge

NEAR was a natural choice for PembRock as a blockchain as it is innovative, fast, inexpensive, EVM-compatible, and has a fantastic community. We saw the success of farming on Ref Finance and noticed that NEAR didn't have any leveraged yield farming projects deployed; however, we knew that with a rapidly growing ecosystem of Dapps, this wouldn’t be the case forever. For this reason, time was of the essence.

Quick development on NEAR involved upskilling our specialists in the Rust programming language, and identifying the differences in how smart contracts in this language are written, as opposed to those deployed on other blockchains using Solidity, Vyper, or JavaScript.

Next there are the technical and financial aspects of the protocol, which needed to be reconciled within the smart contract. Leveraged yield farming brings a lot of complexity in terms of the many pathways a farmer can take when borrowing. Then there is the calculation of liquidation thresholds and reward distribution that mean the contract needs to incorporate some detailed and precise mathematical formulas.

Solution

While the challenges above were by no means small, the depth of experience and expertise in our team meant it was simply a matter of working methodically to get the outcome we needed.

Research

Firstly, we undertook research on leveraged yield farming. This is a relatively new development in DeFi, so we worked to understand best practices and things that we should avoid.

Smart contract architecture

Next, we drew up the contract architecture, which was a big scope of work involving multiple developers. We calculated all possible scenarios, in terms of putting money in, leveraging, adjusting open positions, closing positions, and so on. Only when we finalized this overall scheme could we actually start to create other parts of the platform.

With PembRock having received a $75,000 grant from the NEAR Foundation to aid with development, we had already established a working relationship with the NEAR team, and consulted with them on the technical and mathematical aspects of the contract.

Interface development and tokenomics

Once the smart contract architecture was in place, we began building the application flow, then moving onto the design of the interface and development of the front end.

At this time, tokenomics were finalized with the aid of three experienced financial analysts. They looked at aspects of token distribution and the flow of funds to model different strategies for how the project can be best secured over the long term.

Testnet deployment and audit

With the platform having taken shape, we deployed the smart contracts to the testnet with the following audit processes followed:

  • Technical and security audit with Certik and BlockSec
  • Internal testing
  • Inspection by the NEAR community

In regards to the last point, we are confident in the fact that PembRock is a robust and transparent project. Providing our open-source code to the NEAR community means that they can be sure that we have a quality platform, can provide any feedback, and get a sneak preview of the project by connecting their wallet and putting their funds into the sandbox version of PembRock.

Release on the mainnet

Before launch, we ran token sale fundraisers to bring in locked value. This would ensure the project works efficiently and brings confidence. With the completion of these events we launched PembRock on the mainnet!

It was a big job, but we were able to go about our operations with such confidence due to the NEAR Foundation’s grant and the team’s ongoing support throughout project development.

Results

As a result, PembRock is already making waves, offering:

  • A reliable, bug-free user interface.
  • Lending and yield farming that is largely automated.
  • Integration on launch with Ref Finance, further integration with Jumbo Exchange and others in the NEAR ecosystem. Auto-reinvest feature.

In addition, we continue to:

  • Integrate with other great Dapps in the NEAR ecosystem, strengthening our partnerships.
  • Work closely with the NEAR team.
  • Establish a great relationship with our users — as well as our relationship with other projects and NEAR Guilds, we are working on community care as a top priority.
  • Expand our token pairs, giving our users more options to securely lend and farm with leverage!

How We Built PembRock

Blockchain development

DevOps

  • Front-end development
  • Back-end development
  • Blockchain development

Technologies

Back-end
  • Smart contract on NEAR Protocol
  • RUST
  • Nodejs
  • TypeScript
Front-end
  • ReactJS
  • TypeScript

We continue to ROCK!

While PembRock gains momentum, we are hard at work introducing new coin pairing and opportunities for lenders and farmers within a blockchain that has incredible momentum. We are committed to supporting the rest of the PembRock team throughout what we believe to be a long term project.

To realize your most daring ideas with an expert development team, contact our specialists today.