Skip to content

Add python wrappers for get_max_long, get_max_short#555

Merged
sentilesdal merged 4 commits intomainfrom
matt-max-long-wrapper
Aug 15, 2023
Merged

Add python wrappers for get_max_long, get_max_short#555
sentilesdal merged 4 commits intomainfrom
matt-max-long-wrapper

Conversation

@sentilesdal
Copy link
Copy Markdown
Contributor

Adds some wrappers for the get_max_long and get_max_short rust functions. Basic tests were added just to double check the error handling of the wrappers.

  • add wrappers for get_max_long/short
  • add some basic checks

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 14, 2023

Hyperdrive Gas Benchmark

Benchmark suite Current: 1a1294d Previous: 91163bc Deviation Status
addLiquidity: min 807 gas 807 gas 0% 🟰
addLiquidity: avg 43622 gas 44021 gas -0.9064%
addLiquidity: max 80591 gas 80591 gas 0% 🟰
checkpoint: min 514 gas 514 gas 0% 🟰
checkpoint: avg 23181 gas 23181 gas 0% 🟰
checkpoint: max 34040 gas 34040 gas 0% 🟰
closeLong: min 852 gas 852 gas 0% 🟰
closeLong: avg 45854 gas 45871 gas -0.0371%
closeLong: max 77759 gas 85951 gas -9.5310%
closeShort: min 809 gas 809 gas 0% 🟰
closeShort: avg 42139 gas 42251 gas -0.2651%
closeShort: max 87386 gas 87386 gas 0% 🟰
initialize: min 714 gas 714 gas 0% 🟰
initialize: avg 159447 gas 159447 gas 0% 🟰
initialize: max 233486 gas 233486 gas 0% 🟰
openLong: min 740 gas 740 gas 0% 🟰
openLong: avg 113176 gas 113783 gas -0.5335%
openLong: max 179317 gas 179317 gas 0% 🟰
openShort: min 804 gas 804 gas 0% 🟰
openShort: avg 151280 gas 150351 gas 0.6179% 🚨
openShort: max 219084 gas 219084 gas 0% 🟰
removeLiquidity: min 784 gas 784 gas 0% 🟰
removeLiquidity: avg 57394 gas 57394 gas 0% 🟰
removeLiquidity: max 119628 gas 119628 gas 0% 🟰

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown
Contributor

@dpaiton dpaiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; almost there!

Copy link
Copy Markdown
Contributor

@dpaiton dpaiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add these funcs to the stubs now that we have those?

@sentilesdal sentilesdal force-pushed the matt-max-long-wrapper branch from 11e6e29 to 44c0160 Compare August 15, 2023 17:03
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Aug 15, 2023

Coverage Status

coverage: 98.524%. remained the same when pulling 1a1294d on matt-max-long-wrapper into fe876b7 on main.

@sentilesdal sentilesdal enabled auto-merge (squash) August 15, 2023 17:42
Copy link
Copy Markdown
Contributor

@dpaiton dpaiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of docstring fix requests, otherwise good!

Comment thread crates/hyperdrive-math-py/python/hyperdrive_math_py/hyperdrive_math_py.pyi Outdated
Comment thread crates/hyperdrive-math-py/python/hyperdrive_math_py/hyperdrive_math_py.pyi Outdated
@sentilesdal sentilesdal merged commit 709cd0d into main Aug 15, 2023
@sentilesdal sentilesdal deleted the matt-max-long-wrapper branch August 15, 2023 19:10
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

Successfully merging this pull request may close these issues.

3 participants