Context:
StellarSwipe supports trading various asset pairs on Stellar SDEX. We need to manage supported assets, validate pairs, and fetch current prices.
Problem:
Create a system to manage tradable assets, validate signal asset pairs, and provide price data for the feed.
What Done Looks Like:
- Asset entity with Stellar asset codes
- Supported asset pairs configuration
- Price fetching from SDEX
- Asset validation for signals
- Asset metadata (name, issuer, logo)
Folder Structure:
src/
├── assets/
│ ├── entities/
│ │ ├── asset.entity.ts
│ │ └── asset-pair.entity.ts
│ ├── assets.service.ts
│ ├── assets.controller.ts
│ ├── assets.module.ts
│ └── dto/
│ ├── create-asset.dto.ts
│ └── asset-price.dto.ts
Implementation Guidelines:
- Store Stellar asset format:
CODE:ISSUER
- XLM as native asset
- Maintain list of verified/popular assets
- Fetch orderbook from Horizon for price data
- Cache prices in Redis (60s TTL)
- Support custom assets if verified on Stellar
Core Assets (Initial):
- XLM (native)
- USDC (Circle)
- AQUA (AquaNetwork)
- yXLM (Ultra Stellar)
API Endpoints:
- GET
/assets - List all supported assets
- GET
/assets/pairs - List tradable pairs
- GET
/assets/price/:pair - Current price
Validation:
- Asset creation works
- Price fetching from SDEX succeeds
- Invalid asset pairs rejected
Context:
StellarSwipe supports trading various asset pairs on Stellar SDEX. We need to manage supported assets, validate pairs, and fetch current prices.
Problem:
Create a system to manage tradable assets, validate signal asset pairs, and provide price data for the feed.
What Done Looks Like:
Folder Structure:
Implementation Guidelines:
CODE:ISSUERCore Assets (Initial):
API Endpoints:
/assets- List all supported assets/assets/pairs- List tradable pairs/assets/price/:pair- Current priceValidation: