Skip to content

Commit

Permalink
hotfix: revert market data total_supply
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid committed Aug 27, 2024
1 parent 1fb20e2 commit 8e37c1a
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 8e37c1a

Please sign in to comment.