Skip to content

Commit

Permalink
added points + change addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSacha committed May 11, 2024
1 parent f0ce6f2 commit 47caac1
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 11 deletions.
151 changes: 151 additions & 0 deletions docs/concepts/guide/04-points.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
id: points
title: Points
sidebar_position: 4
---


## What are Crypto Points?

**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 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.

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.

### Types of Crypto Points:

- **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).

## How are on-chain points calculated?

### Borrow

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.

| 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 |

### Earn

We employ a similar methodology to calculate the points for Yield DEX strategies. For instance, in the EtherFi strategy, we determine the points by converting the balance of `ETH`-equivalent yield-bearing tokens. The median daily price sourced from Pragma oracles is utilized in this calculation process.

| Day | User’s daily ETH balance | ETH price (USD) | pts earn |
| --- | --- | --- | --- |
| 1 | 1 | 3000 | 3000 |
| 2 | 0.5 | 3200 | 1600 |
| 3 | 0.1 | 2800 | 280 |
| / | total pts earn | | 4880 |

### 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.

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

For example, we have this referral table:

| parent | child |
| --- | --- |
| Alice | Bob |
| Alice | Carlo |
| Bob | Sarah |
| Carlo | Alex |

and this is the daily pts per user

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

First, we boost the users’ pts

| 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)`

Using the boosted pts we calculate the referral pts.

- `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.

The following table was calculated using boosted balances.

| User | Alice | Bob | Carlo | Sarah | Alex | TOTAL |
| --- | --- | --- | --- | --- | --- | --- |
| Alice | - | 22 | 33 | 11 | 11 | 77 |
| Bob | - | - | - | 11 | - | 11 |
| Carlo | - | - | - | - | 11 | 11 |
| Sarah | - | - | - | - | - | - |
| Alex | - | - | - | - | - | - |

### Rank

This is the user’s total pts

| 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 |

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:

| Rank | total pts | rank pts |
| --- | --- | --- |
| 1 | 341 | 68 |
| 2 | 221 | 33 |
| 3 | 187 | 18 |
| 4 | 110 | 5 |
| 5 | 110 | 0 |

### Social

TBD
19 changes: 8 additions & 11 deletions docs/contracts/deployed/mainnet_contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ sidebar_position: 2

## L1 Mainnet contracts

| Contract Name | Class Hash |
| Contract Name | Description |
|----------------------------------------------------------------------------------------------------|----------------------------------------|
| [Pooling Manager](https://etherscan.io/address/0x56B4518E4053eB3C24f68852899F7a6d57530caF) | Communication between L1-L2 strategies |
| [Saving Dai Strategy](https://etherscan.io/address/0xAFa27423F3bb4c0337946dDcd1802588807571bf) | sDAI strategy |
| [wstETH Strategy](https://etherscan.io/address/0xE5e2134e536fbfD7513094646E27C401bbb03eF6) | Liquid Staking strategy with wstETH |
| [Pooling Manager](https://etherscan.io/address/0x189D3191A55B160A2A7BE16bA2d614C4908dFc76) | Communication between L1-L2 strategies |
| [Pendle Lp EtherFi Strategy](https://etherscan.io/address/0x5ECCc513eFB6B3e7D70579AA81780b6d5e904D2B) | Pendle Lp EtherFi Strategy strategy |



## L2 Mainnet Contracts
You can declare a contract only once on each network. So if you don't do any modification into our current contract implementation you may face an error while declaring. Therefore here you can find the current class hash of each contract on Mainnet.


| Contract Name | Class Hash |
| Contract Name | Description |
|--------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [Pooling Manager](https://starkscan.co/contracts/0x065a953f89a314a427e960114c4b9bb83e0e4195f801f12c25e4a323a76da0a9) | Register and communication between L1-L2 strategies |
| [Factory](https://starkscan.co/contract/0x04a1436a5b9074d1682b58d368e4c4d5cafccc3f048b8e96c5c815bae7c7d466) | Deploy new strategies |
| [Token Manager sDAI](https://starkscan.co/contract/0x02ab4c62add88f102f1f1f3ff6185e5fc00a3ffccf1b7b85505615f68096feed) | Strategy accountability |
| [Nimbora Token sDAI](https://starkscan.co/contract/0x23309ad3a5d9f7311460d6c65181dca024c4067a1fb68dfd6dae370551f2098) | L1 strategy yield-bearing sDAI token |
| [Token Manager ETH](https://starkscan.co/contract/0x0790370ce248020ee58e413a0d6c82e8250248aa346a90abc293c52d8bef9c1b) | L1 strategy yield-bearing token |
| [Nimbora Token ETH](https://starkscan.co/contract/0xe7cf77a75239f3e704ff11160ac5935971115e5c359a679fc9612900e8ce19) | L1 strategy yield-bearing token |
| [Pooling Manager](https://starkscan.co/contracts/0x6abf2636072eb8716d55cb1a9f885cb2c5ed9013c69d8c8e035a8fb49c414e3) | Register and communication between L1-L2 strategies |
| [Factory](https://starkscan.co/contract/0x8e18cd8edf7a8b80fc838ae88167f4b6f44ab65c3387ad96d394e7688e5895) | Deploy new strategies |
| [Token Manager Pendle Lp EtherFi](https://starkscan.co/contract/0x3759ed21701538d2e1bc5896611166a06585cdbbeeddd1fbdd25da10b2174d3) | Manage share accountability |
| [Token Pendle Lp EtherFi Strategy](https://starkscan.co/contract/0x316ec509f7ad89b7e6e03d15a436df634454f95e815536d616af03edc850fa3) | Tokenized share |

0 comments on commit 47caac1

Please sign in to comment.