1 of 38

Building on BentoBox

With Core Dev: Sarang Parikh

2 of 38

Agenda

  1. What’s broken? Why Bentobox?

  • What is BentoBox?

  • Features of Bentobox

  • Get started on BentoBox

  • Use the Bentobox template and boilerplate hardhat

  • Strategies on Bentobox

  • YieldBox

3 of 38

Sablier Finance has $1B+ locked

$100B+ stored in Gnosis Safe

4 of 38

5 of 38

6 of 38

Approval Hell

7 of 38

Permit Function with signature approvals

8 of 38

9 of 38

10 of 38

11 of 38

What is BentoBox?

BentoBox is a token vault that can support any dapp. Users can interact with these many Dapps in a gas-efficient manner, in addition to leveraging the benefits of using a mutual token vault to improve capital efficiency.

All the value locked in the Bentobox will be used via strategies in different protocols, to generate yield for bentobox users

12 of 38

Developing Dapps without BentoBox

13 of 38

Developing Dapps with BentoBox

14 of 38

Developing Dapps with BentoBox

Bentobox

Your Dapp

Some other Dapp

15 of 38

Features of Bentobox

Strategies

Tokens deposited on bentobox automatically earns yield through strategies, such as Aave, Compound, Yearn, xSushi e.t.c

Gas Optimization

Users only require single usage of approval across all the bento apps, transfers inside bentobox is also highly gas optimized.

Flash Loans

Bentobox supports Flash loan out of the box, users can take flash loan from the wide range of deposited tokens, the fees from the flash loan would be distributed among bentobox users

Batching Support

Interact with multiple features and protocols on bentobox in a single transaction for peak efficiency

16 of 38

Features of Bentobox

Strategies

Tokens deposited on bentobox automatically earns yield through strategies, such as Aave, Compound, Yearn, xSushi e.t.c

Gas Optimization

Users only require single usage of approval across all the bento apps, transfers inside bentobox is also highly gas optimized.

Flash Loans

Bentobox supports Flash loan out of the box, users can take flash loan from the wide range of deposited tokens, the fees from the flash loan would be distributed among bentobox users

Batching Support

Interact with multiple features and protocols on bentobox in a single transaction for peak efficiency

17 of 38

BentoBox

==

Dapp App Store

+

Saving Accounts

+

Smart Contract Infra Layer

18 of 38

Key Points

  • User only approves the Bentobox contract via an approval transaction.

  • All the funds are always stored in the bentobox contract. Bento apps work with the virtual balance / shares.

  • Whenever there are transfers between users <> dapps or dapps <> dapps inside bento, it’s just an update of balance on the bentobox contract, the token contracts are untouched.

19 of 38

Dapps not on BentoBox

Users and Developers

Dapps built upon BentoBox ~ earning extra yield

20 of 38

Projects on Bentobox

Sushi Limit Orders

Abracadabra Finance

Isolated Lending and Borrowing (Kashi)

Bentobox TVL: $2B+

Trident

Furo Stream and Vesting

21 of 38

Projects on Bentobox

22 of 38

Amounts v/s Shares

  • Amounts are the actual amount that the user owns, whereas shares are the virtual balance inside bentobox.

  • Whenever a user deposits any amount, it gets converted into shares and stored in bentobox.

  • Whenever a user withdraws, the shares gets converted into amounts and is sent to users wallet.

  • Ideally, you should be using only shares inside your dapp.

Convert Amount to Shares:

Shares = (supplied amount * total shares) / total amount

Convert Shares to Amount:

Amount = (supplied shares * total amount) / total shares

23 of 38

Let’s take an example:

A -> 1000 USDC

Share of A: 1000

Bentobox Balance: 1000 USDC

Amount of A: 1000 USDC

From a strategy bentobox gains 200 USDC

Share of A: 1000

Bentobox Balance: 1000 + 200 = 1200 USDC

Amount of A: (1000 * 1200) / 1000 = 1200 USDC

B -> 1000 USDC

Share of A: 1000

Share of B: (1000 * 1000) / 1200 = 833.333…

Bentobox Balance: 1200 + 1000 = 2200 USDC

Amount of B: (833.333... * 2200) / 1833.333… = 1000 USDC

From a strategy bentobox gains 200 USDC

Share of A: 1000

Share of B: 833.333…

Bentobox Balance: 2200 + 200 = 2400 USDC

Amount of A: (1000 * 2400) / 1833.333… = 1309 USDC

Amount of B: (833.333… * 2400) / 1833.333… = 1091 USDC

Amount of A + Amount of B (1309 + 1091) = Bentobox Balance (2400)

24 of 38

Let’s take an example:

A -> 1000 USDC

Share of A: 1000

Bentobox Balance: 1000 USDC

Amount of A: 1000 USDC

From a strategy bentobox gains 200 USDC

Share of A: 1000

Bentobox Balance: 1000 + 200 = 1200 USDC

Amount of A: (1000 * 1200) / 1000 = 1200 USDC

B -> 1000 USDC

Share of A: 1000

Share of B: (1000 * 1000) / 1200 = 833.333…

Bentobox Balance: 1200 + 1000 = 2200 USDC

Amount of B: (833.333... * 2200) / 1833.333… = 1000 USDC

From a strategy bentobox gains 200 USDC

Share of A: 1000

Share of B: 833.333…

Bentobox Balance: 2200 + 200 = 2400 USDC

Amount of A: (1000 * 2400) / 1833.333… = 1309 USDC

Amount of B: (833.333… * 2400) / 1833.333… = 1091 USDC

Amount of A + Amount of B (1309 + 1091) = Bentobox Balance (2400)

25 of 38

Steps to integrate your app into Bentobox

  1. Every dapp built on BentoBox has to register itself. This would register your dapp and make it BentoApp.

26 of 38

Steps to integrate your app into Bentobox

2. Approve your BentoApp to access user’s funds using their signature. This can also be used by users to revoke access to your BentoApp.

27 of 38

Steps to integrate your app into Bentobox

3. Deposit users funds to BentoBox. Make sure that the user has already approved BentoBox for the particular token and the amount. Once, tokens are deposited it’ll start earning yield from BentoBox strategies.

28 of 38

Steps to integrate your app into Bentobox

4. Transfer allow the transfer of balance between users <> dapp or dapp <> dapp inside bentobox.

29 of 38

Steps to integrate your app into Bentobox

5. Use withdraw, to take token out of BentoBox and use it somewhere else. Once, tokens are withdrawn it’ll not earn yield from strategies.

30 of 38

31 of 38

  • Users can lose funds if the underlying strategy gets compromised

  • General DeFi and Smart Contract Risk

Risks

32 of 38

  • Only Sushi has the control to activate strategy to any token inside bentobox.

  • There is a 14 day timelock before a strategy gets activated.

  • Sushi only add strategy capital to “safe” protocols.

  • Sushi cannot invest more than 95% of the bentobox capital into strategies.

Currently, there have been strategies for Aave and xSushi.

Strategies

33 of 38

  • Strategies cannot be put for protocols that have a lock or delayed withdraw mechanism

  • Bentobox funds should be readily available to withdraw from strategy, and rebalance

  • Strategies should be added to protocols having parameters behind timelock and multisig control, and protocols should be audited and battle tested

Steps for Strategies

34 of 38

Permissionless Bentobox

  • Tokens can have multiple strategies

  • Anyone can write those strategies

  • Support for Rebasing Tokens

  • Token Creation support for better standardization

  • Strategies handling tokens and reporting it to yield box

Yield Box

35 of 38

These are just sample ideas, but you can build whatever dapp you want on top of Bentobox

  • Indices Protocol

  • Prediction Markets

  • Derivative Platform

  • Crowdfunding Platform ~ BentoFund Challenge

  • Multi Sig Treasury Management / DAO Management

Free Ideas for everyone

36 of 38

Thank You!

You can reach me via the

Twitter - @sarangparikh22

37 of 38

Any dapp build on bentobox is eligible for the prizes. Make sure you participate in our bounty.

  • 1st Place - $4000 USD

  • 2nd Place - $3000 USD

  • 3rd Place - $1500 USD

Any dapp built on bentobox at this hackathon, would be considered for a grant or incubation from Sushi.

You would also get featured on sushiswap website, if you are going to launch your protocol on bentobox (Additional marketing boost)

Prizes

38 of 38

Thank You!

You can reach me via the sushi-support channel in the hackathon discord

Twitter - @sarangparikh22