Skip to content

Commit

Permalink
Merge pull request #25 from IndigoProtocol/cody/isol-distribution
Browse files Browse the repository at this point in the history
iSOL Distirbution
  • Loading branch information
codybutz authored Dec 1, 2024
2 parents 16a5b70 + db1c94e commit fe4a81a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions indy_rewards/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
IAsset.iUSD: datetime.date(2022, 11, 21), # Epoch 377's first day.
IAsset.iBTC: datetime.date(2022, 11, 21),
IAsset.iETH: datetime.date(2023, 1, 6), # Epoch 386's second day.
IAsset.iSOL: datetime.date(2024, 11, 26), # Epoch 525's second day.
}


Expand Down
1 change: 1 addition & 0 deletions indy_rewards/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class IAsset(Enum):
iUSD = auto()
iBTC = auto()
iETH = auto()
iSOL = auto()

@classmethod
def from_str(cls, name: str):
Expand Down
18 changes: 15 additions & 3 deletions indy_rewards/sp/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ def get_pool_weights(
new_iassets: set[IAsset],
has_stakers: set[IAsset],
) -> dict[IAsset, float]:
if day >= datetime.date(2024, 11, 26):
return {
IAsset.from_str("ibtc"): (2469.29 / 19664.35),
IAsset.from_str("ieth"): (1504.89 / 19664.35),
IAsset.from_str("iusd"): (14690.17 / 19664.35),
IAsset.from_str("isol"): (1000.00 / 19664.35),
}
if day >= datetime.date(2024, 7, 14):
return {
IAsset.from_str("ibtc"): (2469.29 / 18664.35),
Expand Down Expand Up @@ -334,6 +341,11 @@ def _get_unique_iassets(accounts: list[dict]) -> set[IAsset]:


def _is_at_least_24h_old(account: dict, snapshot_day: datetime.date) -> bool:
"""Ignore iSOL accounts opened before 2024-11-27 (first day of asset
whitelisting)."""
if snapshot_day < datetime.date(2024, 11, 27) and account["asset"] == "iSOL":
return True

"""Returns whether the SP account was opened within 24h relative to the snapshot."""
snap = time_utils.get_snapshot_time(snapshot_day)
open = datetime.datetime.utcfromtimestamp(account["opened_at"]).replace(
Expand All @@ -343,6 +355,9 @@ def _is_at_least_24h_old(account: dict, snapshot_day: datetime.date) -> bool:


def sp_epoch_emission(epoch: int) -> float:
if epoch >= 524:
return 19664.35

if epoch >= 497:
return 18664.35

Expand All @@ -353,9 +368,6 @@ def sp_epoch_emission(epoch: int) -> float:


def gov_epoch_emission(epoch: int) -> float:
if epoch >= 524:
return 5315

if epoch >= 488:
return 6046.11

Expand Down

0 comments on commit fe4a81a

Please sign in to comment.