Skip to content

Application brakes on feed withount prices #10

@wondermach

Description

@wondermach

Hi,

the application does not handle this error: if you request a feed for a pair that does not have prices yet, the application brakes.

_[Nest] 1 - 12/05/2025, 12:17:18 PM WARN [CcxtFeed] No prices found for {"category":1,"name":"xxx/USD"}
[Nest] 1 - 12/05/2025, 12:17:18 PM LOG [ExampleProviderController] Current feed values: [{"feed":{"category":1,"name":"xxx/USD"}}]
/app/dist/data-feeds/ccxt-provider-service.js:290
const market = exchange.markets[source.symbol];
^

TypeError: Cannot read properties of undefined (reading 'xxx/USDT')
at CcxtFeed.fetchLastPrices (/app/dist/data-feeds/ccxt-provider-service.js:290:44)
at CcxtFeed.getFeedPrice (/app/dist/data-feeds/ccxt-provider-service.js:272:23)
at CcxtFeed.getValue (/app/dist/data-feeds/ccxt-provider-service.js:82:34)
at /app/dist/data-feeds/ccxt-provider-service.js:78:49
at Array.map ()
at CcxtFeed.getValues (/app/dist/data-feeds/ccxt-provider-service.js:78:32)
at ExampleProviderService.getValues (/app/dist/app.service.js:24:30)
at ExampleProviderController.getCurrentFeedValues (/app/dist/app.controller.js:36:51)
at /app/node_modules/@nestjs/core/router/router-execution-context.js:38:29
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)_

Example configuration:

{
"feed": {
"category": 1,
"name": "xxx/USD"
},
"sources": [
{
"exchange": "gate",
"symbol": "xxx/USDT"
},
{
"exchange": "coinbase",
"symbol": "xxx/USD"
}
]
}

Example request:

curl -X 'POST'
'http://localhost:3101/feed-values/'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"feeds": [
{"category":1,"name":"xxx/USD"}

]
}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions