Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/strategies/forte-staking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,26 @@ The equation of the voting power is:

$votingPower(snapshot) = \sum_{i=1}^n amountStaked(i) * (daysStaked(i) + daysOffset) * \frac{multiplierNumerator}{ multiplierDenominator} * [externalMultiplier]$

where _n_ is the number of batches of staked tokens by the user.
where _n_ is the number of batches of staked tokens by the user, and _daystStaked_ is an integer rounded down that represents the number of days since the batch was created.

Notice that the multiplier is a function of a range due to the ceiling parameter:
Notice that the external multiplier is a function of a range due to the ceiling parameter:

$externalMultiplier =
\begin{cases}
externalMultiplier > externalMultiplierCeiling & \quad externalMultiplierCeiling\\
externalMultiplier > externalMultiplierCeiling & \quad externalMultiplierCeiling\\
externalMultiplier ≤ externalMultiplierCeiling & \quad externalMultiplier
\end{cases}
$
\end{cases}$

## Examples

### Using KYC as an external multiplier

In this example, the external multiplier is the KYC level of the user in an external contract. The KYC level itself can be any positive number. However, any value greater than 2 will be treated as 2 due to the ceiling parameter:
In this example, the external multiplier is the KYC level of the user stored in an external contract. The KYC level itself can be any positive number. However, any value greater than 2 will be treated as 2 due to the ceiling parameter:

```json
{
"stakingAddress": "0x249E662fe228Eff1e7dCE7cF3E78dFD481C7Ba3E",
"externalMultiplierAddress": "0x86f53212865b6fddb99633dc002a7f7aacaaa8db",
"symbol": "FORTE",
"externalMultiplierABI": "function getAccessLevel(address _account) external view returns (uint8)",
"externalMultiplierFunction": "getAccessLevel",
"multiplierNumerator": 4,
Expand All @@ -72,7 +70,6 @@ This is the same example as the one above but without the external multiplier wh
```json
{
"stakingAddress": "0x249E662fe228Eff1e7dCE7cF3E78dFD481C7Ba3E",
"symbol": "FORTE",
"multiplierNumerator": 4,
"multiplierDenominator": 1461,
"daysOffset": -1
Expand Down
1 change: 0 additions & 1 deletion src/strategies/forte-staking/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"params": {
"stakingAddress": "0x249E662fe228Eff1e7dCE7cF3E78dFD481C7Ba3E",
"externalMultiplierAddress": "0x86f53212865b6fddb99633dc002a7f7aacaaa8db",
"symbol": "FORTE",
"externalMultiplierABI": "function getAccessLevel(address _account) external view returns (uint8)",
"externalMultiplierFunction": "getAccessLevel",
"multiplierNumerator": 4,
Expand Down
16 changes: 5 additions & 11 deletions src/strategies/forte-staking/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,32 @@
"title": "Strategy",
"type": "object",
"properties": {
"symbol": {
"type": "string",
"title": "Symbol",
"examples": ["e.g. FOR"],
"maxLength": 16
},
"stakingAddress": {
"type": "string",
"title": "Contract address",
"title": "Staking contract address",
"examples": ["e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"],
"pattern": "^0x[a-fA-F0-9]{40}$",
"minLength": 42,
"maxLength": 42
},
"externalMultiplierAddress": {
"type": "string",
"title": "External multiplier address",
"title": "External-multiplier contract address",
"examples": ["e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"],
"pattern": "^0x[a-fA-F0-9]{40}$",
"minLength": 42,
"maxLength": 42
},
"externalMultiplierABI": {
"type": "string",
"title": "External multiplier ABI",
"title": "External multiplier ABI (string version)",
"examples": [
"e.g. function getAccessLevel(address _account) external view returns (uint8)"
]
},
"externalMultiplierFunction": {
"type": "string",
"title": "External multiplier ABI",
"title": "External-multiplier function name",
"examples": ["e.g. getAccessLevel"]
},
"multiplierNumerator": {
Expand All @@ -52,7 +46,7 @@
},
"daysOffset": {
"type": "number",
"title": "offset",
"title": "Days offset",
"examples": ["e.g. -1"]
},
"externalMultiplierCeiling": {
Expand Down
Loading