Skip to content

Add platform activity feed, governance escalation, factory registry, and LP position endpoints - #994

Merged
Chucks1093 merged 4 commits into
accesslayerorg:mainfrom
Depo-dev:feat/936-935-983-980-platform-endpoints
Sep 28, 2026
Merged

Chucks1093 merged 4 commits into
accesslayerorg:mainfrom
Depo-dev:feat/936-935-983-980-platform-endpoints

Conversation

@Depo-dev

Copy link
Copy Markdown

Summary

  • GET /activity/feed — reverse-chronological platform activity feed (investment/settlement/new_listing/fully_funded), cursor pagination, 30s cached
  • GET /governance/proposals/escalating — governance proposals in quorum escalation with extended deadline, escalation count, participation rate
  • GET /factory/keys and GET /factory/keys/:contractAddress — key factory deployment registry, is_factory_key flag on key responses
  • GET /lp/positions, GET /lp/positions/:lpId, GET /lp/pool/:keyId — LP position and rewards API

Closes #936, closes #935, closes #983, closes #980

Notes

  • Migration history on main has a pre-existing issue unrelated to this PR (shadow-DB replay fails from scratch due to earlier migration gaps); schema changes here were validated via db push + introspection diff against the hand-written migration SQL.
  • LP reward accrual and pool APR are intentionally simplified placeholders, commented inline.
  • is_factory_key is threaded through the creator profile key summary; not yet threaded through every key-listing call site.

Test plan

  • tsc build passes
  • lint passes
  • 26 new/updated tests pass (route-level via supertest + indexer unit tests)
  • Manual review of migration SQL against target DB before merge, given the pre-existing migration-history issue noted above

GET /activity/feed returns the last 20 platform events (investment,
settlement, new_listing, fully_funded), reverse-chronological with cursor
pagination for older pages. Maps ActivityType enum values onto the public
event type strings and caches the uncursored first page for 30s,
invalidated from the trade and dividend indexers on new activity.
…org#935)

Adds escalationCount/originalDeadline/extendedDeadline/maxEscalations/
escalatedAt to GovernanceProposal, a governance-escalation-indexer service
that syncs state from ProposalExtended contract events (with its own
EventLog for idempotency) and logs a structured admin alert at max
escalations, and GET /governance/proposals/escalating returning
escalating proposals with participation rate (vote weight sum /
totalVotingWeight).

Also registers the new governance, factory, and lp routers in
modules/index.ts (all three land in this branch together).
New FactoryDeployedKey model plus factory-indexer.service.ts syncing
KeyDeployed contract events into it. GET /factory/keys?creator= lists
keys deployed by a wallet in deployment order; GET
/factory/keys/:contractAddress returns the factory summary
(is_factory_key: true) or falls back to the general RegisteredKey
lookup (is_factory_key: false), 404 only when the address isn't a key
anywhere.

Threads is_factory_key through the existing key summary
(getCreatorProfile in creator-profile.service.ts) by checking the
factory registry keyed by the profile id.
New LpPosition/LpEventLog models plus lp-indexer.service.ts handling
LP_ADDED/LP_CLAIMED/LP_REMOVED events. accrueLpRewards pro-rates a
simplified reward pool across active positions by sharePercent, called
from trade-indexer.service.ts after each processed trade.

GET /lp/positions?wallet= and GET /lp/positions/:lpId are JWT-auth'd
and wallet-scoped (404 on any not-owned/not-found lpId, no existence
leakage); GET /lp/pool/:keyId is public and returns pool size plus a
clearly-labelled simplified APR estimate.

Also adds the combined migration for all four issues' schema changes
(activity SUPPLY_FULLY_FUNDED enum value, governance escalation
fields + GovernanceEscalationEventLog, FactoryDeployedKey, LpPosition/
LpEventLog).
@drips-wave

drips-wave Bot commented Sep 28, 2026

Copy link
Copy Markdown

@Depo-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit c0de58f into accesslayerorg:main Sep 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants