Skip to content

Commit

Permalink
Merge pull request #2154 from zmcNotafraid/hotfix-revert-market-data
Browse files Browse the repository at this point in the history
hotfix: revert market data total_supply
  • Loading branch information
zmcNotafraid authored Aug 27, 2024
2 parents 1fb20e2 + 8e37c1a commit 72ce1e9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/models/market_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def parsed_dao

def total_supply
result = if current_timestamp > first_released_timestamp_may
parsed_dao.c_i - BURN_QUOTA - (parsed_dao.s_i - unmade_dao_interests)
parsed_dao.c_i - BURN_QUOTA - yesterday_treasury_amount.to_i
else
parsed_dao.c_i - BURN_QUOTA
end
Expand Down Expand Up @@ -167,4 +167,9 @@ def third_released_timestamp_other
lock_address.present? ? lock_address.lock_script.lock_info[:estimated_unlock_time].to_i : CkbUtils.time_in_milliseconds(Time.find_zone("UTC").parse("2022-12-31"))
end
end

def yesterday_treasury_amount
treasury_amounts = DailyStatistic.order(created_at_unixtimestamp: :desc).first(2).pluck(:treasury_amount)
treasury_amounts[0] == "0" ? treasury_amounts[1] : treasury_amounts[0]
end
end

0 comments on commit 72ce1e9

Please sign in to comment.