Skip to main content

Link Quote

Welcome to the Link Quote API Reference. This service provides real-time digital asset pricing and rate aggregation from multiple market data providers.

Base URL: https://api.ledgerlink.ai/v1

Overview

Link Quote is a microservice designed to aggregate and provide real-time pricing data for digital assets from multiple market data providers. It serves as a centralized quote service for the LedgerLink platform, delivering accurate and reliable market rates for cryptocurrencies and other digital assets.

Technology Stack:

  • NestJS backend framework with TypeScript
  • PostgreSQL database with TypeORM
  • CoinMarketCap API integration
  • Pyth Network (Hermes) integration
  • ActiveMQ for event publishing
  • RESTful API with Swagger/OpenAPI documentation

Core Capabilities

  • Multi-Provider Aggregation: Fetches rates from CoinMarketCap and Pyth Network simultaneously
  • Smart Provider Selection: Asset-specific or category-based provider routing
  • Real-time Pricing: Current market rates with sub-second latency
  • Historical Data: Store and query historical rate data
  • Event Publishing: Publishes valuation events to ActiveMQ for downstream services
  • Asset Management: Full CRUD operations for digital assets
  • Category Management: Organize assets into configurable categories
  • Provider Configuration: Flexible provider-to-asset and provider-to-category mappings

Architecture

Data Flow

  1. Rate Request → Client requests rate for specific asset code
  2. Asset Resolution → System looks up asset in database
  3. Provider Selection → Determines which providers to query (asset-specific or category-based)
  4. Price Aggregation → Fetches rates from multiple providers in parallel
  5. Average Calculation → Computes weighted average from valid responses
  6. Data Persistence → Stores rate in PostgreSQL with timestamp
  7. Event Publishing → Publishes valuation event to ActiveMQ
  8. Response → Returns aggregated rate to client

External Integrations

  • CoinMarketCap: Professional cryptocurrency market data
  • Pyth Network: Real-time price feeds via Hermes client
  • ActiveMQ: Message queue for publishing valuation events

API Endpoints

Rate Management

  • POST /rates - Create/fetch a new rate for an asset
  • GET /rates - List historical rates with filtering and pagination

Asset Management

Category Management

Provider Management

Provider Mappings

Note: There are currently no GET endpoints to list existing mappings. Mappings can be queried through the asset/category GET endpoints which include their associated providers.

Authentication

Link Quote is accessed through the Link Dashboard, which handles all authentication via the Auth Server (BFF - Backend for Frontend).

Architecture:

User → Link Dashboard → Auth Server/BFF (Authentication) → Link Quote Service

How It Works:

  • Users authenticate with the Link Dashboard (username/password)
  • The Auth Server validates JWT tokens and session cookies
  • Authenticated requests are proxied to Link Quote at /api/link-quote/v1/*
  • No role-based access control (RBAC) - all authenticated users have full access
  • Link Quote service itself does not implement authentication middleware
  • Direct service-to-service calls within the secure network are unauthenticated

For Direct Service Access (Development/Testing):

  • Local Link Quote instances run without authentication
  • Ensure proper network isolation
  • Access Swagger docs at http://localhost:3000/api

See the Getting Started Guide for integration details.

Supported Digital Assets

Link Quote supports a wide range of digital assets including:

  • Major Cryptocurrencies: Bitcoin (BTC), Ethereum (ETH), USDC, USDT, SOL, etc.
  • Stablecoins: USDC, USDT, DAI, PYUSD
  • ERC-20 Tokens: Various Ethereum-based tokens
  • Custom Assets: Add any digital asset via the Asset Management API

Assets are organized into categories for efficient provider selection and rate retrieval.

Rate Providers

CoinMarketCap

  • Professional cryptocurrency market data
  • Real-time and historical pricing
  • Requires API key

Pyth Network (Hermes)

  • Decentralized oracle network
  • Sub-second price updates
  • On-chain price feeds

Provider selection is configurable per asset or category, with automatic failover if providers are unavailable.

Event Publishing

Link Quote publishes valuation events to ActiveMQ for real-time monitoring:

Event Types:

  • VALUATION_REQUESTED - When a rate request is received
  • VALUATION_PROCESSED - When rate is successfully calculated
  • ERROR - When valuation fails

Events include metadata such as asset ID, value, currency, and processing details.

Next Steps


Need Help? Contact helpdesk@ledgerlink.ai for assistance with your Link Quote integration.