Skip to main content

Introduction to OctoPos

What is OctoPos?

OctoPos (OctoVault Position Tracker) is a modular, real-time DeFi position tracking engine for the Stellar blockchain. It aggregates user positions across multiple Stellar DeFi protocols, prices them via a unified 5-feed priority chain, resolves contract addresses to known types, persists historical data in MongoDB, and exposes a REST API with authentication and rate limiting.

OctoPos is part of the Untangled Finance ecosystem — the data backbone that powers OctoVault's real-time NAV calculations and portfolio analytics.

Core Capabilities

  • Multi-protocol aggregation — Tracks positions across Blend, Aquarius, SoroSwap, Phoenix, FxDAO, and native Stellar wallets in a single query
  • 5-feed price priority chain — Aquarius AMM → Wrapped Assets → Blend Oracle → StellarExpert → DeFiLlama, with automatic fallback and cross-validation
  • Real-time tracking — 60-second position collection loop with raw snapshots, hourly OHLC, and daily OHLC rollups
  • YAML-driven configuration — Token addresses, pool configs, and thresholds managed externally, not in code
  • Plugin extensibility — New protocols added via drop-in TypeScript plugins; no core changes required
  • REST API — Authenticated endpoints for positions, history, yield, risk, and protocol stats

Architecture Layers

LayerNameResponsibility
1ConnectorsRaw SDK wrappers for external services (Soroban RPC, Horizon, DeFiLlama, etc.)
2AdaptersProtocol-specific position extraction (Blend, Aquarius, SoroSwap, Phoenix, FxDAO, StellarWallet)
3FeedsPrice data from multiple sources (5-feed priority chain)
4DataMongoDB models, aggregation, health monitoring
5ServicesOrchestration, pricing, monitoring
6APIREST endpoints, auth, rate limiting

REST API

OctoPos exposes a REST API with API key authentication and tiered rate limiting:

EndpointMethodDescription
/positions/:addrGETAll positions for a Stellar address
/summaryGETPortfolio summary with total value
/historyGETHistorical portfolio snapshots
/yieldGETYield metrics per protocol
/riskGETRisk metrics (health factor, exposure)
/eventsGETPosition lifecycle events
/protocolsGETList supported protocols
/protocols/:id/statsGETProtocol-level statistics
/healthGETSystem health + data freshness

API key tiers: Free (rate-limited) · Standard · Partner (custom limits).

See Architecture for full design principles.

Supported Protocols

ProtocolTypeOctoPos Adapter
Blend CapitalLendingblend — supply (bTokens), borrow (dTokens)
Aquarius AMMLiquidity Poolaquarius — LP shares + claimable AQUA rewards
SoroSwapLiquidity Poolsoroswap — LP token valuation
Phoenix DeFi HubStaking + LPphoenix — LP + staking positions + pending rewards
FxDAOCDPfxdao — collateral deposited + debt minted
Native StellarWalletstellar-wallet — XLM balance + all trustlines
Untangled VaultsERC-4626 Vaultuntangled-vault — vault share balances, NAV pricing

Supported Price Feeds

PriorityFeedSourceBest For
0Aquarius AMMAquarius AMM swap quotesStellar-native tokens with liquid pools
1Wrapped AssetUnderlying price × rateWrapped/yield-bearing tokens (e.g., yXLM)
2Blend OracleBlend on-chain oracleAssets in Blend pools
3StellarExpertStellarExpert APIStellar Classic assets, known Soroban tokens
4DeFiLlamaDeFiLlama aggregatorBroad coverage, last resort

See Architecture and Adapters & Price Feeds for deeper documentation.