Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Pendle strategy #30

Merged
merged 14 commits into from
Jun 6, 2024
30 changes: 20 additions & 10 deletions docs/concepts/guide/01-first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,36 @@ title: First Steps
sidebar_position: 1
---

## Getting Started on Starknet
## Getting Started on Starknet[](https://docs.nimbora.io/docs/concepts/guide/first_steps#getting-started-on-starknet)

The first step consists of installing Starknet wallets and bridging funds to your account. The entire setup process is explained in detail [here](https://www.starknet.io/en/content/getting-started-using-starknet-setting-up-a-starknet-wallet).
1. The first step is installing a Starknet wallet ([Braavos](https://braavos.app/) or [ArgentX](https://argent.xyz/)).
2. Deposit funds (ETH on Starknet for starters) to your account.
3. To interact with Starknet dApps, you will need to deploy your account.

The process can be done with the following steps:

## Connect to Nimbora
1. Deposit ETH on Starknet to your wallet address.
2. Send ETH to your own or external address.
3. Your wallet will be ready to use as soon as the transaction is processed.

The process begins by visiting the Nimbora platform at https://app.nimbora.io/
The entire setup process, including bridging of the funds is explained in detail [here](https://www.starknet.io/en/content/getting-started-using-starknet-setting-up-a-starknet-wallet).

Click “**Connect Wallet**” in the top right corner
## Getting started with Nimbora

![Untitled](https://i.imgur.com/SaXJ9qq.png)
Launch Nimbora at https://app.nimbora.io/.

Nimbora is in alpha stage, so you will need a referral code to access the dApp.
![Untitled](https://i.ibb.co/J5mnmTv/Screenshot-549.png)

Select one of the two available wallet options ([Braavos](https://braavos.app/) or [ArgentX](https://argent.xyz/))
You can [join our Discord](https://www.notion.so/Nimbora-MKT-Dashboard-e5cd8af2cd214955b1067075b3888c28?pvs=21) and ask for an invite in the #invites channel.

![Untitled](https://i.imgur.com/pwjsKxV.png)
Once you’ve secured the invite, click “Connect Wallet” in the top right corner.

![Untitled](https://i.imgur.com/SaXJ9qq.png)

For the sake of this tutorial we will be using **Argent X** wallet extension.
Select one of the available wallet options ([Braavos](https://braavos.app/) or [ArgentX](https://argent.xyz/))

![Untitled](https://i.imgur.com/517pTc6.png)
![Untitled](https://i.ibb.co/ftRGfGr/Screenshot-548.png)

Follow the notification prompt and click on “**Connect**”

Expand Down
36 changes: 22 additions & 14 deletions docs/concepts/guide/02-earn.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ sidebar_class_name: hidden

There are several yield strategies with different underlying tokens and APR (Annual Percentage Rate). Each card represent a certain strategy, it can be a lending pool, a strategy aggregator, an AMM liquidity pool...

![alt](/content/earn.png)
![alt](/content/strategy_nsdai/strategy_nsdai.png)

**APR is the percentage of assets you will earn on your deposit after a year**. If you want to deposit $100 of a certain token in a strategy, if APR is 10% avergae you'll earn $10 after a year.


**APR is not fixed**. APR can change based on several factor such as market condition or the net asset value of the L1 strategy.

**Here's an APR breakdown of the nsDAI strategy**

![alt](https://i.ibb.co/P4Vbc55/Screenshot-556.png)

1. **Base**: Represents default strategy yield.
2. **Boost**: Represents incentives added by the Nimbora team to enable higher APR.
3. **Incentives**: Represents incentives provided by the Starknet Foundation.

**Underlying protocols**. Underlying protocols linked to the strategy are displayed, you can choose the one you are the most comfortable with.

**Underlying token**. The underlying token is the token used to deposit into the strategy, strategy yield bearing token is correlated to the underlying, just providing additional rewards.
Expand All @@ -28,25 +37,24 @@ Choose the strategy that you want and click on the card for next steps

Enter the amount you want to deposit or click on the buttons to set a desired percentage of your balance you want to deposit.

![alt](/content/hdeposit.png)
![alt](/content/strategy_nsdai/strategy_nsdai_deposit.png)


When you've selected the token amount to deposit, click on "deposit" and follow the prompts on your wallet (Argent or Braavos) to complete the transaction.
When you've selected the token amount to deposit, click on "deposit" and follow the prompts on your wallet ([Braavos](https://braavos.app/) or [ArgentX](https://argent.xyz/)) to complete the transaction.

![alt](/content/rdeposit.png)
![alt](/content/strategy_nsdai/strategy_nsdai_deposit_wallet.png)


Once the transaction has been accepted on the network, a popup will appear at the bottom right of the screen to let you know.

![alt](/content/fdeposit.png)
![alt](/content/strategy_nsdai/strategy_nsdai_deposit_confirm.png)


You can consult all of your recent deposits in the wallet section, your transaction should be here.

![alt](/content/cdeposit.png)

![alt](/content/strategy_nsdai/strategy_nsdai_deposit_recent.png)

And that's it, you should be able to see your balance of nimbora yield token into the portfolio section or directly into your wallet browser.
And that's it, you should be able to see your balance of Nimbora yield token into the portfolio section or directly into your wallet browser.



Expand All @@ -57,24 +65,24 @@ Withdrawal are not synchronous such as deposits they take an average of 1 day to

First, you need to decide on the amount you want to withdraw. This could be all or a portion of your assets.

![alt](/content/hwithdraw.png)
![alt](/content/strategy_nsdai/strategy_nsdai_withdraw.png)

Once you've made up your mind, locate and click on the 'withdraw' button and follow the prompts on your wallet (Argent or Braavos) to complete the transaction.

![alt](/content/rwithdraw.png)
![alt](/content/strategy_nsdai/strategy_nsdai_withdraw_wallet.png)


Once the transaction has been accepted on the network, a popup will appear at the bottom right of the screen to let you know.

![alt](/content/fwithdraw.png)
![alt](/content/strategy_nsdai/strategy_nsdai_withdraw_confirm.png)

You can consult all of your recent deposits in the wallet section, your transaction should be here.

![alt](/content/cwithdraw.png)
![alt](/content/strategy_nsdai/strategy_nsdai_withdraw_recent.png)

And that's it, you should see your pending request in the navbar.

![alt](/content/pwithdraw.png)
![alt](/content/strategy_nsdai/strategy_nsdai_withdraw_pending.png)

Nimbora takes over the task of processing this request. This involves preparing your assets in order to be transferred back to your Wallet, a process that is handled entirely behind the scenes to ensure a smooth and efficient operation. Once the request is ready to be claimed, nimbora relayer will handle it and send it directly into your wallet.
Nimbora takes over the task of processing this request. This involves preparing your assets in order to be transferred back to your wallet, a process that is handled entirely behind the scenes to ensure a smooth and efficient operation. Once the request is ready to be claimed, Nimbora relayer will handle it and send it directly into your wallet.

161 changes: 75 additions & 86 deletions docs/concepts/guide/04-points.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,104 @@ id: points
title: Points
sidebar_position: 4
---
## What are Nimbora Points?[](https://docs.nimbora.io/docs/concepts/guide/points#what-are-crypto-points)

![Untitled](https://i.ibb.co/LzNKDpn/Untitled-27.png)

## What are Crypto Points?
Nimbora points are designed to incentivize and reward users for actively engaging with our platform. These points serve as a metric for off-chain measuring user activity and contribution within the Nimbora ecosystem, providing rewards based on participation levels.

**Crypto points**, within the context of Nimbora Protocol, are digital units designed to incentivize and reward users for actively engaging with our platform. These points serve as a metric for off-chain measuring user activity and contribution within the Nimbora ecosystem, providing insights and rewards based on participation levels.
### Key Features of Nimbora Points:[](https://docs.nimbora.io/docs/concepts/guide/points#key-features-of-crypto-points)

1. **Incentivization**: Points encourage participation and engagement by rewarding users for their contributions to the Nimbora ecosystem. These contributions may include providing liquidity (borrow and yield strategies) or promoting adoption (referrals)
2. **Utility**: Beyond their monetary value, Nimbora points will offer utility within the Nimbora ecosystem. Users will be able to utilize these tokens to access premium features and get additional rewards.

### Key Features of Crypto Points:
### Types of Nimbora Points:
[](https://docs.nimbora.io/docs/concepts/guide/points#types-of-crypto-points)

1. **Incentivization**: Crypto points encourage participation and engagement by rewarding users for their contributions to the Nimbora ecosystem. These contributions may include providing liquidity or promoting adoption.
![Untitled](https://i.ibb.co/qDFcNpc/Untitled-28.png)

2. **Utility**: Beyond their monetary value, crypto points offer utility within the Nimbora ecosystem. Users can utilize these tokens to access premium features and get for additional rewards.
- **Earn Points**: Earn points for depositing assets to any of our earn strategies.
- **Borrow Points**: Earn points for borrowing LUSD against ETH in our borrow module.
- **Referral Points**: Earn a fraction of the points your referrals and their invitees make.
- **Rank Points**: Earn extra points based on your leaderboard position, with the top performers having higher earning rate.

### Types of Crypto Points:
## How are on-chain points calculated?[](https://docs.nimbora.io/docs/concepts/guide/points#how-are-on-chain-points-calculated)

- **Borrow Points**: Earn points while using borrow strategies.
- **Earn Points**: Earn points while using earn strategies.
- **Rank Points**: Earn points based on your performance.
- **Referral Points**: Earn points by inviting your friends.
- **Social Points**: Earn points by engaging with the protocol (unactivated for now).
### Earn[](https://docs.nimbora.io/docs/concepts/guide/points#earn)

## How are on-chain points calculated?
The earn points are calculated daily based user assets deposited in all earn troves.

### Borrow
**Example**:

The borrow points are calculated based on the daily user collateral `ETH` deposited in all Liquity troves. We use the ETH median daily price fetched from Pragma oracles to calculate the pts.
nsDAI strategy enables users to put their DAI to use. Users participating in the strategy will get nsDAI token - representing `DAI`-equivalent yield-bearing tokens.

| Day | User’s daily ETH collateral balance | ETH price USD | earn pts |
| --- | --- | --- | --- |
| 1 | 1 | 3000 | 3000 |
| 2 | 0.5 | 3200 | 1600 |
| 3 | 0 | 2800 | 0 |
| / | total pts earn | | 4600 |
![Untitled](https://i.ibb.co/12QVsLr/Untitled-29.png)

### Earn
The median daily price sourced from Pragma oracles (if not stablecoin) is utilized in this calculation process.

We employ a similar methodology to calculate the points for Yield DEX strategies. In the Sdai strategy, we determine the points by converting the balance of `DAI`-equivalent yield-bearing tokens. The median daily price sourced from Pragma oracles (if not stablecoin) is utilized in this calculation process.

| Day | nsDAI balance | USD equivalent | pts earn |
| Day | nsDAI balance | USD equivalent | Points |
| --- | --- | --- | --- |
| 1 | 3000 | 3000 | 3000 |
| 2 | 3000 | 3200 | 3200 |
| 3 | 3000 | 3400 | 3400 |
| / | total pts earn | | 9600 |
| / | Total points | | 9600 |

### Borrow[](https://docs.nimbora.io/docs/concepts/guide/points#borrow)

The borrow points are calculated based on the daily user collateral `ETH` deposited in all Liquity troves.

![Untitled](https://i.ibb.co/tby62s0/Untitled-32.png)

We use the ETH median daily price fetched from Pragma oracles to calculate the pts.

| Day | User’s daily ETH collateral balance | ETH price USD | Earn points |
| --- | --- | --- | --- |
| 1 | 1 | 3000 | 3000 |
| 2 | 0.5 | 3200 | 1600 |
| 3 | 0 | 2800 | 0 |
| / | total points earn | | 4600 |

### Referral

Before calculating the referral pts for each user, a boost is applied to the on-chain users pts (borrow + earn). By default, the boost is `10%`, but some users who used partner links (boosted links) can receive a higher boost.
Before calculating the referral points for each user, a boost is applied to the on-chain users pts (borrow + earn). By default, the boost is `10%`, but strategic partners and users joining through them can receive a higher boost.

![Untitled](https://i.ibb.co/Gxj7TsW/Untitled-30.png)

The referral pts are calculated based on the referral relation between users.
The referral points are calculated based on the referral relation between users.

For example, we have this referral table:

| parent | child |
| Referral | Invited User |
| --- | --- |
| Alice | Bob |
| Alice | Carlo |
| Bob | Sarah |
| Carlo | Alex |

and this is the daily pts per user
and this is the daily points per user

| User | pts |
| User | Points |
| --- | --- |
| Alice | 100 |
| Bob | 200 |
| Carlo | 300 |
| Sarah | 100 |
| Alex | 100 |

First, we boost the users’ pts
First, we boost the users’ points

| User | pts |
| --- | --- |
| Alice | 100 |
| Bob | 200 |
| Carlo | 300 |
| Sarah | 100 |
| Alex | 100 |

`referral pts = (User points * boost) + (10% Bob + 10% Carlo + 5% Sarah + 5% Alex)`
`referral points = (User points * boost) + (10% Bob + 10% Carlo + 5% Sarah + 5% Alex)`

Using the boosted pts we calculate the referral pts.
Using the boosted points we calculate the referral points.

- `Alice` receives:
- `10%` from `Bob` and `Carlo`direct child
- `5%` from `Sarah` and `Alex` first child of a direct child.
- `Bob` receives:
- `10%` from `Sarah` direct child
- `Carlo` receives:
- `10%` from `Alex` direct child
- `Sarah` and `Alex` receive nothing because they don’t have a child.
- `Alice` receives:
- `10%` from `Bob` and `Carlo` direct invitee
- `5%` from `Sarah` and `Alex` first invitee of a direct invitee.
- `Bob` receives:
- `10%` from `Sarah` direct invitee
- `Carlo` receives:
- `10%` from `Alex` direct invitee
- `Sarah` and `Alex` receive nothing haven’t invited anyone.

The following table was calculated using boosted balances.

Expand All @@ -106,46 +112,29 @@ The following table was calculated using boosted balances.
| Sarah | - | - | - | - | - | - |
| Alex | - | - | - | - | - | - |

### Rank
### Rank[](https://docs.nimbora.io/docs/concepts/guide/points#rank)

This is the user’s total pts
Rank points represent extra points earned based on your leaderboard position, with the top performers having higher earning rate.

| User | earn pts | borrow pts | referral pts | total pts |
| --- | --- | --- | --- | --- |
| Alice | 50 | 50 | 87 | 187 |
| Bob | 150 | 50 | 31 | 231 |
| Carlo | 100 | 200 | 41 | 341 |
| Sarah | 80 | 20 | 10 | 110 |
| Alex | 30 | 70 | 10 | 110 |
![Untitled](https://i.ibb.co/3TSwx37/Screenshot-550.png)
This table represents points bonus based on the leaderboard position:

Sort the users by total pts ( the following are only examples for more details about prod setup check this [[link](https://www.notion.so/Point-system-Tech-bbaba9b312f4402d842547bb4579a8e4?pvs=21)])

1. The first receives 20% boost
2. The second receives 15% boost
3. The second receives 10% boost
4. The second receives 5% boost
5. The second receives 0% boost

`Info: When users have the same pts the register timestamp is used to order them.`

| Rank | user | total pts | rank pts |
| --- | --- | --- | --- |
| 1 | Carlo | 341 | 68 |
| 2 | Bob | 221 | 33 |
| 3 | Alice | 187 | 18 |
| 4 | Sarah | 110 | 5 |
| 5 | Alex | 110 | 0 |

So, the total pts earn by each user during the last 24 hours:
| Leaderboard | Boost % |
| --- | --- |
| 1-50 | 20% |
| 51-200 | 15% |
| 201-500 | 10% |
| 501-1000 | 5% |
| 1001+ | 0% |

| Rank | total pts | rank pts |
| --- | --- | --- |
| 1 | 341 | 68 |
| 2 | 221 | 33 |
| 3 | 187 | 18 |
| 4 | 110 | 5 |
| 5 | 110 | 0 |
This table represents points breakdown with the Rank points taken into the account:

### Social
| Leaderboard | Earn points | Borrow points | Referral points | % boost | Rank points | Total |
| --- | --- | --- | --- | --- | --- | --- |
| 1-50 | 100 | 50 | 50 | 20% | 40 | 240 |
| 51-200 | 80 | 20 | 0 | 15% | 15 | 115 |
| 201-500 | 70 | 0 | 10 | 10% | 8 | 88 |
| 501-1000 | 30 | 10 | 0 | 5% | 2 | 42 |
| 1001+ | 30 | 5 | 0 | 0% | 0 | 35 |

TBD
`Info: When users have the same points the register timestamp is used to order them.`
Loading
Loading