question

mathieu legras raisepartner avatar image
mathieu legras raisepartner asked ·

The B2E Analytics API requires too many http calls

Hello,

Is it planned to make the `Analytics` API accept POST requests, where the instrument ids could be passed in the request body instead of in the query parameters? The current amount of requests needed doesn't feel right.

Bellow is an explication of why I believe this is needed.


We need to use `Analytics` API to retrieve various computed analytics. A typical use case would be, for a given fund, to:

1. Retrieve the latest analytics for the fund instruments. Instrument ids are to be passed as query parameters. This is 1 call.

2. For each stress-test scenario we want to consider, get its values for the fund instruments. This is nb_stress_test calls.

3. For each stress-test scenario we want to consider, get the fx rates. This is also nb_stress_test calls.

Which makes it at least 1 + 2 * nb_stress_test calls. At least because in practice it should be much more. The reason is that while the HTTP specification states there is no limit to the length of a query string (or an URI for that matters), this is usually not the case in practice and each server / browser has its own limitations on the URL length.

For example sending 300 instrument ids in the query parameters will fail the request. A reasonnable amount I've found is 70 instruments (mostly because it keeps the url length under 2048 characters). That means that we are up to 1 + 2 * nb_stress_test * ceil(nb_instruments / 70) calls.

For a portfolio of 300 instruments and 6 scenarios this is already 65 calls needed to retrieve the needed data. In some use cases it might be hundreds of calls. Having a POST endpoint would reduce the number of calls to a reasonnable amount.

API - Treasury and Capital MarketsDevelopment
10 |600 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

FrancoisHEREIL avatar image
FrancoisHEREIL answered ·

Hi Mathieu,

I have forwarded your request to Product Management team.

Kind regards,

François HEREIL

Fusion Invest DEV

10 |600 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

alexis.beuve avatar image
alexis.beuve answered ·

Thank you for your question, it's clear.

Our Product Owner is back on Mon 27th Apr and will handle it.

10 |600 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.