ArdanaLabs / audit

0 stars 0 forks source link

["research"] Do the polynomial-looking forms of the invariant equation have cheaper-to-execute trees? #23

Open quinn-dougherty opened 2 years ago

quinn-dougherty commented 2 years ago

Description

In src/considerations/rootfinding.md at this time, I make a conjecture (emph added):

  1. Shrink the arithmetic tree size. Leaving $\chi$ in a blackbox has the advantage of the codebase being able to plug in different leverage coefficients in the future just by supplying the leverage coefficient and its derivative. However, this puts more on the stack than is necessary. I haven't done any formal benchmarking of this, but I currently believe the invariant polynomials in these forms are simpler trees and should therefore result in lower fees.

Deliverable

Some benchmarking of the codebase given two different ways of presenting the invariant arithmetic tree. Then update the audit language as appropriate or change the recommendation.

quinn-dougherty commented 2 years ago

Will possibly do benchmarking in a few weeks when we know for sure:

  1. in which package will invariant equation be solved, DanaSwapStats or DanaSwap?
  2. how important are time and space constraints? (dependent on 1)
  3. how much of a pain to add dependencies? (dependent on 1)
  4. what types will be used? (also sort of dependent on 1)

In the meantime, I will include dimensionless analysis (multiplying I_{D|x_k} by 1 / mean for some mean) in the documents.

If we're doing this of the form "DanaSwapStats solves invariant equation and submits solution to DanaSwap, which produces it's own epsilon-proof", then we have more options, and benchmarking will be more timely.