-
Notifications
You must be signed in to change notification settings - Fork 1
Pool DTOs #107
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
base: main
Are you sure you want to change the base?
Pool DTOs #107
Conversation
credmark/cmf/types/pool.py
Outdated
| """ | ||
|
|
||
| tokens: Tokens = DTOField(description="The tokens that are stored in the pool.") | ||
| balances: List[float] = DTOField(description="The balances that are stored in the pool.") |
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.
An open question is do we want a Pool object to have a list of positions that get more attributes as they get more specific?
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.
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.
@newtectonics I would think so. Shouldn't it just be a list of Positions instead of separate lists of tokens and balances?
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.
I would prefer this flat structure of lists of value, instead of embedding object. This would make it easier to be converted to a pandas' data frame.
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.
The problem is keeping the lists in sync (matching indices) and adding more attributes as @newtectonics mentioned. Also, even looping through them you need to do a zip or more complicated loop handling.
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.
@newtectonics This seems to be a Contract containing a Portfolio which is a list of Positions (amount (float) and asset (Token)). Should we not reuse those DTOs here?
No description provided.