CarmineOptions / derisk-research

MIT License
6 stars 26 forks source link

Integrate Ekubo #66

Closed lukaspetrasek closed 4 months ago

lukaspetrasek commented 5 months ago

Compute available liquidity at Ekubo for any given token at any given price level.

Let's choose, for example, the STRK-USDC pair and assume the current price is 2 USDC per 1 STRK. We're interested in the amounts of USDC that we'll be able to swap for STRK at Ekubo while not pushing the price by more than 5% in a scenario where the STRK price falls to, e.g., 1.9 USDC, 1.8 USDC, ... 1 USDC, etc.

MarekHauzr commented 5 months ago

Essentially we are asking for an "ordebook projection" of the CL AMM (Ekubo).

Part of that is that on some specified price levels we want to know how much liquidity is between this price level and 5% below (or above).

djeck1432 commented 5 months ago
  1. @lukaspetrasek could you please write formula for computation for the total price.
  2. Get token prices and Get pool liquidity [https://docs.ekubo.org/integration-guides/reference/ekubo-api/api-endpoints]
  3. First task -> create class to connect to Ekubo (research which data provides by Ekubo)
  4. Transform data from Ekubo.
lukaspetrasek commented 5 months ago

@djeck1432