penumbra-zone / penumbra

Penumbra is a fully private proof-of-stake network and decentralized exchange for the Cosmos ecosystem.
https://penumbra.zone
Apache License 2.0
364 stars 288 forks source link

dex_utils: make the RMM solver wasm friendly #2823

Closed erwanor closed 5 months ago

erwanor commented 1 year ago

To compute the individual liquidity positions that correspond to a desired payoff, we embed a solver into the dex_utils crate. Even though the crate imports ndarray, the solver itself is self-contained and does not depend on a specific BLAS/LAPACK backend. It uses data structures and helper methods provided by ndarray so that the high-level code is easier to read. However, this is rather inconvenient since that means we cannot use the crate in a wasm context.

Instead of using ndarray data structures, the crate should drop use of ndarray and either use const generics or Vec<T>s.

hdevalence commented 5 months ago

It's unclear we should do this at all. We are currently not prioritizing liquidity provisioning from the web UI.