-
Notifications
You must be signed in to change notification settings - Fork 3
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
Extract reused functions into utility packages #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few minor suggestions in the PR but looks great overall 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple suggestions for test cases
96445b3
to
ba496b6
Compare
ba496b6
to
51c35b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
What?
This PR extracts various duplicated utility functions from our various projects and assembles them into utility packages.
Deribit utilities (
@atomicfinance/deribit
):composeInstrumentName
instrumentName
parameterparseInstrumentName
instrumentName
into expiry, option type, and strike price.Contract utilities (
@atomicfinance/contract
):calculatePreFeePremium
calculatePostFeePremium
Formatting utilities (
@atomicfinance/format
):toBTC
toSats
roundBTC
round
Why?
To follow the principles of DRY, and reduce duplicated logic and refactoring costs.
This allows our various projects to use the same logic, and avoid bugs encountered by divergent implementation.