Adaptic-ai / adaptic-backend

0 stars 0 forks source link

asset.get failing #4

Open hooshd opened 1 week ago

hooshd commented 1 week ago

Sometimes the data isn't there (e.g. at present for AMZN), and sometimes it's blank, e.g.

{
  __typename: 'Asset',
  id: '03698b24-397c-4c4b-bb4b-3c7f08b03e54',
  symbol: 'SPY',
  name: 'SPY',
  type: 'OTHER',
  logoUrl: null,
  description: null,
  cik: null,
  exchange: null,
  currency: null,
  country: null,
  sector: null,
  industry: null,
  address: null,
  officialSite: null,
  fiscalYearEnd: null,
  latestQuarter: null,
  marketCapitalization: null,
  ebitda: null,
  peRatio: null,
  pegRatio: null,
  bookValue: null,
  dividendPerShare: null,
  dividendYield: null,
  eps: null,
  revenuePerShareTTM: null,
  profitMargin: null,
  operatingMarginTTM: null,
  returnOnAssetsTTM: null,
  returnOnEquityTTM: null,
  revenueTTM: null,
  grossProfitTTM: null,
  dilutedEPSTTM: null,
  quarterlyEarningsGrowthYOY: null,
  quarterlyRevenueGrowthYOY: null,
  analystTargetPrice: null,
  analystRatingStrongBuy: null,
  analystRatingBuy: null,
  analystRatingHold: null,
  analystRatingSell: null,
  analystRatingStrongSell: null,
  trailingPE: null,
  forwardPE: null,
  priceToSalesRatioTTM: null,
  priceToBookRatio: null,
  evToRevenue: null,
  evToEbitda: null,
  beta: null,
  week52High: null,
  week52Low: null,
  day50MovingAverage: null,
  day200MovingAverage: null,
  sharesOutstanding: null,
  dividendDate: null,
  exDividendDate: null,
  askPrice: 584.4,
  bidPrice: 584.39,
  createdAt: '2024-11-19T12:01:42.186Z',
  updatedAt: '2024-11-19T12:01:42.186Z'
}
mehran9 commented 1 week ago

@hooshd

This particular issue isn't so much a bug, but rather a limitation. We currently only retrieve fundamental information for assets that are shares from AlphaVantage, and don't cover things like indexes (SPY), ETFs (actually not sure if these are covered or not), currencies, cryptos etc.... we will need to augment the api/asset/overview/route.ts in adaptic-app.... i'll add an issue there as an enhancement for us to keep tracking this one. In the meantime, any functions using this should probably handle this empty response for assets issue.

mehran9 commented 1 week ago

why this no close.