Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 206 forks source link

add Ratios as output format from PriceAuthority #2688

Open Chris-Hibbert opened 3 years ago

Chris-Hibbert commented 3 years ago

What is the Problem Being Solved?

The PriceAuthority's results are often (maybe always?) useful as a ratio.

Description of the Design

Let's add a Ratio to the return results, and if that's more useful, we can drop the separate amountIn and amountOut.

Security Considerations

Shouldn't be any. This is about clarity and usefulness of the return results.

Test Plan

New value in the result, no new computation. Add some tests in PriceAuthority, and make use of it.

Tartuffo commented 2 years ago

We could just add a helper for now.