[Backend] AVE Cloud Integration - Data and Trading APIs #22

Merged
shoko merged 1 commits from fix/issue-11 into main 2026-04-08 16:49:13 +02:00
Owner
No description provided.
shoko added 1 commit 2026-04-08 16:42:10 +02:00
- 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 #11
Author
Owner

Summary

  • Implement AVE Cloud API client with all Data API endpoints (token search, batch prices, token details, klines, trending tokens, token risk)
  • Implement Trading API endpoints (chain wallet quote, chain swap)
  • Add tier field to User model for plan detection (free/normal/pro)
  • Add tier gating with upsell messaging for Pro features
  • Handle rate limiting gracefully with 429 responses
  • Add Pydantic schemas for AVE API requests/responses

Changes

  • src/backend/app/db/models.py: Added tier field to User model
  • src/backend/app/db/schemas.py: Added AVE Cloud API schemas
  • src/backend/app/api/ave.py: New router with all AVE Cloud endpoints
  • src/backend/app/services/ave/: New AVE Cloud API client service
  • src/backend/app/main.py: Added ave router

API Endpoints

All endpoints require authentication and are prefixed with /api/ave:

  • GET /tokens - Token search
  • POST /tokens/price - Batch prices
  • GET /tokens/{token_id} - Token details
  • GET /klines/{token_id} - Kline data
  • GET /tokens/trending - Trending tokens
  • GET /contracts/{contract_id} - Token risk
  • POST /chain/quote - Chain wallet quote
  • POST /chain/swap - Chain wallet swap

Tier Gating

Feature Free Normal Pro
Data REST Yes Yes Yes
WebSocket No No Yes
Chain Wallet Yes Yes Yes
Proxy Wallet No Yes Yes

Fixes #11

## Summary - Implement AVE Cloud API client with all Data API endpoints (token search, batch prices, token details, klines, trending tokens, token risk) - Implement Trading API endpoints (chain wallet quote, chain swap) - Add tier field to User model for plan detection (free/normal/pro) - Add tier gating with upsell messaging for Pro features - Handle rate limiting gracefully with 429 responses - Add Pydantic schemas for AVE API requests/responses ## Changes - `src/backend/app/db/models.py`: Added `tier` field to User model - `src/backend/app/db/schemas.py`: Added AVE Cloud API schemas - `src/backend/app/api/ave.py`: New router with all AVE Cloud endpoints - `src/backend/app/services/ave/`: New AVE Cloud API client service - `src/backend/app/main.py`: Added ave router ## API Endpoints All endpoints require authentication and are prefixed with `/api/ave`: - `GET /tokens` - Token search - `POST /tokens/price` - Batch prices - `GET /tokens/{token_id}` - Token details - `GET /klines/{token_id}` - Kline data - `GET /tokens/trending` - Trending tokens - `GET /contracts/{contract_id}` - Token risk - `POST /chain/quote` - Chain wallet quote - `POST /chain/swap` - Chain wallet swap ## Tier Gating | Feature | Free | Normal | Pro | |---------|------|--------|-----| | Data REST | Yes | Yes | Yes | | WebSocket | No | No | Yes | | Chain Wallet | Yes | Yes | Yes | | Proxy Wallet | No | Yes | Yes | Fixes #11
han approved these changes 2026-04-08 16:48:20 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit b6f99aa8fe into main 2026-04-08 16:49:13 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#22