Bowerbird was most heavily inspired by Compound and Anchor. The past couple of years have shown that a good DeFi stablecoin lending protocol with high yields can drastically increase the TVL of a L1 blockchain. Bowerbird hopes to achieve this for Neo N3.

For those who are curious, Bowerbird is named after the Austro-Papuan bird famous for being the premier architect of the avian world. We hope to build your nest egg with Bowerbird - or something like that.

A note for the judges, the Planathon entry was submitted under "Macaw" but has been since renamed to a more apt bird.

What it does

Bowerbird is a DeFi lending protocol that collateralizes bNEO - a divisible version of NEO that votes and receives GAS rewards, and lends out USDL - a USD-pegged algorithmic stablecoin recently deployed by Lyrebird.

Lenders can deposit USDL to Bowerbird and receive a corresponding quantity of Bowered USDL (bUSDL), which can be thought of as a deposit slip for the deposited USDL. They can later convert the bUSDL back into USDL at a more favorable exchange rate due to the interest repayments made within the interval.

Note that this is the Compound model for accruing interest; it is also possible to keep the exchange rate the same and update the bUSDL balances of each wallet (the AAVE model), but our view is that this makes transferring and providing liquidity more complicated to reason about.

Borrowers can then deposit their bNEO as collateral and borrow USDL against it. The loan position accrues interest every block, so the borrower must be aware of their loan health and either make timely repayments or increase the collateral to ensure that their collateral does not get liquidated. The solvency of the platform is secured by the minimum loan-to-value ratio (initially set to 75%) and a liquidating mechanism similar to Compound. If a loan position is under-collateralized, a liquidator can purchase up to 50% of the underlying collateral with a 5% bonus by submitting USDL to repay part of the under-collateralized loan.

Although this part has not been implemented for Polaris, the key feature of Bowerbird is that it will periodically claim GAS rewards from the collateralized bNEO in order to boost lender yields. It will then swap the GAS for USDL on Flamingo and add this to the yields earned by depositors. We estimate that Bowerbird can yield 10.8-12%+ yields on USDL deposits based on current bNEO APR, 80% utilization rate, and 150% collateralization ratio.

Another planned feature not implemented for Polaris is the Bowerbird Token (BWB). BWB will be distributed to early lenders and borrowers and will hold governance rights over the protocol, including minimum loan-to-value ratios, interest rates, and future BWB emission rates.

Finally, the current model simply sets the borrowing APR at 100%. This will be changed to be variable with a target utilization rate. Interest rates will be lower when below this rate and higher when above this rate to incentivize participants to move the utilization rate close to the optimal number.

How we built it

There are two smart contracts, both written with neo3-boa: BoweredUSDL and BowerbirdNest.

BoweredUSDL keeps track of the underlying supply and loaned supply of USDL, the desired annualized APR, and conversions between USDL and bUSDL. In short, it is responsible for loans and interest rates.

BowerbirdNest keeps track of collateralization and liquidation. It consults the Oracle to get the most recent price feed since many of its operations are based on asset value and not just asset quantity. In short, it is responsible for anything that deals with collateralized positions.

The front-end was written with React.js, Next.js, and various N3 dAPI libraries (neon-js, NeoLine, O3, WalletConnect, OneGate).

The liquidator script was written with neon-js.

We run a neo-go relay node to query the blockchain, transmit transactions, and subscribe to the notification subsystem.

Finally, we have a couple of lines of Flask that returns a static JSON of USDL and bNEO prices for the Oracle. This will be later replaced by a real price feed.

Challenges we ran into

There were no significant challenges. We did have some minor frustrations dealing with numerical precision, but we have found that Neo is much less likely to run into overflow issues compared with many other L1 chains due to the extremely large max integer size.

Accomplishments that we're proud of

Building a fully working prototype within one month and learning enough Adobe Illustrator to make vector images look not great but not terrible.

What we learned

Applying interest and representing floating-point numbers with integers needs to be approached carefully.

What's next for Bowerbird

The most important next step is legal consultation to ensure that the product can launch without violating lending laws and/or regulations. We expect this to be a fairly costly task, but one that is possible given the presence of competitors already on the market.

For a project with grand ambitions such as Bowerbird, it is also necessary to assemble a team including a UI/UX designer and operational/marketing experts.

After that, the next steps are:

  • Implement a variable rate APR based on the target utilization. Rates will be low when below the target utilization to encourage borrowing and high when over the target utilization to encourage lending.
  • Implement the Bowerbird Token and emission mechanism.
  • Implement the bNEO GAS claiming mechanism.
  • Add FLM as a supported collateral asset, boosting deposit yields by entering Flund with the collateralized FLM.
  • Add LRB as a supported collateral asset, boosting deposit yields by staking the collateralized LRB.

For those who want to test out the demo, you can send any amount of any NEP-17 token on Testnet T4 to Nbht3istSQJqtw1PEwUtsyahhBG519Sk4P (scriptHash: 0x519f963c3dae55479c99a2fbe6bfd0b749bb38ad) to receive 100 USDL. You can obtain Testnet bNEO by going to the N3 Testnet Faucet to get NEO, and then sending NEO to NPmdLGJN47EddqYcxixdGMhtkr7Z5w4Aos to receive an equivalent amount of bNEO.

All source code can be found under

Built With

Share this project: