-
Notifications
You must be signed in to change notification settings - Fork 33
Feat/refactor markets and tokens #205
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
Conversation
aarmoa
commented
May 25, 2023
- Modeled the Markets (SpotMarket, DerivativeMarket and BinaryOptionMarket) and Token.
- AsynClient initializes list of all markets and tokens, and uses them to create Composer instances.
- Composer uses the markets and/or tokens instances to translate human-readable values into chain accepted format.
- Composer is still able to use the information from the configuration files with Denom instances if they are created without passing the list of markets and tokens. That will still be the default behavior for any current SDK user until they migrate their code to start getting the Composer instances from the AsyncClient.
- All example files have been updated to reflect the new way of creating Composer instances
…e human-readable values into chain format
…eing used for Binary Options
|
|
||
| def Trades(self, request, context): | ||
| """Trades gets the trades of a Derivative Market. | ||
| """Trades gets the trades of a Derivative SpotMarket. |
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.
Derivative SpotMarket doesnt make sense @aarmoa
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.
Fixed
| ) | ||
| self.Market = channel.unary_unary( | ||
| '/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/Market', | ||
| '/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/SpotMarket', |
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.
Did you manually edit these files? These should be auto-generated afaik @aarmoa
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.
Fixed
…h for spot and derivative markets
…e human-readable values into chain format
|
I have analyzed the differences between the current production code (using the Denoms loaded from the .ini files) and the logic using the new Markets and Tokens in this branch in The differences founds are the following:
After this validation, I think that it is safe to merge this branch into the |
…info in the `utils` module
@aarmoa please run the examples to make sure there's backwards compatibility. We used this script: https://github.com/InjectiveLabs/sdk-python/blob/master/run-examples.sh a while back to run all examples - we can modify and use it moving forward. |
…e markets in the chain
… execution off all examples with the new code base
Thank you @achilleas-kal for spotting this. I was able to reproduce the issue and fix the problem, and added a unit tests for the scenario to avoid the same error happening again in the future. |
…uired and is causing problems during `pipenv install`
…e human-readable values into chain format
…eing used for Binary Options
…e human-readable values into chain format
…info in the `utils` module
…e markets in the chain
… execution off all examples with the new code base
…/InjectiveLabs/sdk-python into feat/refactor_markets_and_tokens
…tokens with repeated symbol but different denom as different tokens
…o feat/refactor_markets_and_tokens