Skip to content
Open
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
25 changes: 25 additions & 0 deletions indexer/modules/custom/address_index/endpoint/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
get_address_assets,
get_address_base_info,
get_address_developer_info,
get_all_udf_dashboards,
get_all_udf_dashboards_data,
get_contract_deployed_events,
get_contract_deployer_profile,
get_daily_active_address,
get_wallet_address_volumes,
)
from indexer.modules.custom.address_index.utils.score import calculate_aci_score
Expand Down Expand Up @@ -128,3 +131,25 @@ class ACIVolumes(Resource):
@cache.cached(timeout=360, query_string=True)
def get(self, address):
address_bytes = bytes.fromhex(address[2:])


@address_profile_namespace.route("/v1/aci/udf_dashboards")
class UDFDashboards(Resource):
# @cache.cached(timeout=360, query_string=True)
def get(self):
return get_all_udf_dashboards()


@address_profile_namespace.route("/v1/aci/udf_dashboards_data")
class UDFDashboards(Resource):
@cache.cached(timeout=10, query_string=True)
def get(self):
return get_all_udf_dashboards_data()


@address_profile_namespace.route("/v1/aci/daily_active_address")
class DailyAddress(Resource):
@cache.cached(timeout=10, query_string=True)
def get(self):
time_range = flask.request.args.get("time_range", "7d")
return get_daily_active_address(time_range)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from sqlalchemy import Column, Date, PrimaryKeyConstraint
from sqlalchemy.dialects.postgresql import INTEGER

from common.models import HemeraModel


class AFDashboardDailyAddressStats(HemeraModel):
__tablename__ = "af_dashboard_daily_address_stats"

block_date = Column(Date, nullable=False, primary_key=True)
active_addresses = Column(INTEGER, nullable=False)
new_addresses = Column(INTEGER)

__table_args__ = (PrimaryKeyConstraint("block_date"),)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from sqlalchemy import VARCHAR, Column, Date, Double, Numeric, PrimaryKeyConstraint

from common.models import HemeraModel


class AFDistributionDailyStats(HemeraModel):
__tablename__ = "af_distribution_daily_stats"

distribution_name = Column(VARCHAR, nullable=False)
block_date = Column(Date, nullable=False)
x = Column(Numeric, nullable=False)
value = Column(Numeric)
percentage = Column(Double)
total_value = Column(Numeric)

__table_args__ = (PrimaryKeyConstraint("distribution_name", "block_date", "x"),)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from sqlalchemy import VARCHAR, Column, Date, Double, Numeric, PrimaryKeyConstraint

from common.models import HemeraModel


class AFMetricsDistributionDailyStats(HemeraModel):
__tablename__ = "af_metrics_distribution_daily_stats"

distribution_name = Column(VARCHAR, nullable=False)
block_date = Column(Date, nullable=False)
avg = Column(Numeric)
stdev = Column(Numeric)

__table_args__ = (PrimaryKeyConstraint("distribution_name", "block_date"),)
Loading