Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize units in the Rust SDK #31

Closed
jalextowle opened this issue Apr 24, 2024 · 5 comments
Closed

Standardize units in the Rust SDK #31

jalextowle opened this issue Apr 24, 2024 · 5 comments

Comments

@jalextowle
Copy link
Contributor

There are some functions that could return base but don't. Investigate whether or not it makes sense to update these units.

@jalextowle
Copy link
Contributor Author

It would be good to have support for asBase = false as a standard.

@wakamex
Copy link
Contributor

wakamex commented Apr 25, 2024

my first thought with this is to port over the predict_trade functionality we merged in Python a few months ago:

every predict_trade call gives you the following output:

Entity Base Bonds Shares
user -100 104.95 -100
pool 99.9952 -104.955 99.9952
fee 0.0428367 0.0449786 0.0428367
governance 0.00475964 0.00499762 0.00475964

since you now know exactly what a hypothetical trade returns, this enables calling existing functions with a different unit as input. examples of this:

  1. open long with bonds as input predict_trade_test.py#L111
  2. open short with base as input predict_trade_test.py#L128

discussing with @dpaiton, we may want to think more deeply about how we want this functionality to look in the Rust SDK before porting that over. maybe a discussion for how we want the SDK APIs to work? @ryangoree

@ryangoree ryangoree transferred this issue from delvtech/hyperdrive May 1, 2024
@wakamex
Copy link
Contributor

wakamex commented May 2, 2024

check this out @jrhea

@wakamex
Copy link
Contributor

wakamex commented May 2, 2024

see the comment above for what I have in mind as a return object for each trade function (already coded in python!) @jalextowle @dpaiton

@wakamex
Copy link
Contributor

wakamex commented May 3, 2024

moving discussion to #63 (comment)

@wakamex wakamex closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants