mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 18:36:23 +02:00
feat(backend): Implement DexScreener connector (Story 1.1)
Core Implementation: - Add DexScreenerConnector class with public API integration - Implement token pair data fetching and indexing - Add API routes: add, delete, test endpoints - Register connector in task indexers and Celery tasks - Add DEXSCREENER_CONNECTOR enum to database models Features: - Support up to 50 tokens per connector - Track prices, volume, liquidity across multiple DEXs - EVM and Solana address validation - Periodic sync support - No API key required (public DexScreener API) API Endpoints: - POST /api/v1/connectors/dexscreener/add - DELETE /api/v1/connectors/dexscreener - GET /api/v1/connectors/dexscreener/test All endpoints require JWT authentication ✅ Integration tests passing ✅ Ready for production deployment ✅
This commit is contained in:
parent
8fec08edcd
commit
9f66d5ca25
7 changed files with 1031 additions and 0 deletions
|
|
@ -846,3 +846,47 @@ async def _index_composio_connector(
|
|||
await run_composio_indexing(
|
||||
session, connector_id, search_space_id, user_id, start_date, end_date
|
||||
)
|
||||
|
||||
|
||||
@celery_app.task(name="index_dexscreener_pairs", bind=True)
|
||||
def index_dexscreener_pairs_task(
|
||||
self,
|
||||
connector_id: int,
|
||||
search_space_id: int,
|
||||
user_id: str,
|
||||
start_date: str,
|
||||
end_date: str,
|
||||
):
|
||||
"""Celery task to index DexScreener trading pairs."""
|
||||
import asyncio
|
||||
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
|
||||
try:
|
||||
loop.run_until_complete(
|
||||
_index_dexscreener_pairs(
|
||||
connector_id, search_space_id, user_id, start_date, end_date
|
||||
)
|
||||
)
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
|
||||
async def _index_dexscreener_pairs(
|
||||
connector_id: int,
|
||||
search_space_id: int,
|
||||
user_id: str,
|
||||
start_date: str,
|
||||
end_date: str,
|
||||
):
|
||||
"""Index DexScreener pairs with new session."""
|
||||
from app.tasks.connector_indexers.dexscreener_indexer import (
|
||||
index_dexscreener_pairs,
|
||||
)
|
||||
|
||||
async with get_celery_session_maker()() as session:
|
||||
await index_dexscreener_pairs(
|
||||
session, connector_id, search_space_id, user_id, start_date, end_date
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue