[Backend] AVE Cloud Integration - Data and Trading APIs #22
Reference in New Issue
Block a user
Delete Branch "fix/issue-11"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
- Add tier field to User model for plan detection (free/normal/pro) - Create AVE Cloud API client with all Data API endpoints: - Token search (GET /v2/tokens) - Batch prices (POST /v2/tokens/price) - Token details (GET /v2/tokens/{id}) - Kline data (GET /v2/klines/token/{id}) - Trending tokens (GET /v2/tokens/trending) - Token risk (GET /v2/contracts/{id}) - Add Trading API endpoints: - Chain wallet quote (POST /v1/chain/quote) - Chain wallet swap (POST /v1/chain/swap) - Add tier gating with upsell messaging for Pro features - Handle rate limiting gracefully with 429 responses - Add Pydantic schemas for AVE API requests/responses Fixes #11Summary
Changes
src/backend/app/db/models.py: Addedtierfield to User modelsrc/backend/app/db/schemas.py: Added AVE Cloud API schemassrc/backend/app/api/ave.py: New router with all AVE Cloud endpointssrc/backend/app/services/ave/: New AVE Cloud API client servicesrc/backend/app/main.py: Added ave routerAPI Endpoints
All endpoints require authentication and are prefixed with
/api/ave:GET /tokens- Token searchPOST /tokens/price- Batch pricesGET /tokens/{token_id}- Token detailsGET /klines/{token_id}- Kline dataGET /tokens/trending- Trending tokensGET /contracts/{contract_id}- Token riskPOST /chain/quote- Chain wallet quotePOST /chain/swap- Chain wallet swapTier Gating
Fixes #11
lgtm