dydxprotocol/dydx-python

Make getter methods

BrendanChou opened this issue · 3 comments

Make getter methods

My original comment:
One thing ive been thinking about is it would be nice if I could read either the oracle prices that Solo is looking at or some other way of reading my accounts collateralization.

My understanding is that this is already possible at a lower level but I dont see a way to do it in the python api.

also to piggyback on this issue, it would be great if the collateralization threshold is in https://github.com/dydxprotocol/dydx-python/blob/master/dydx/constants.py#L21 for future-proofing

This isn't blocking me (im using coinbase prices instead which I think is close enough), so this is really just for later clarity:

Getter methods that I would like:

get_oracle_price(currency):
"""
Returns the current oracle price for the currency is question that Solo is using to determine accounts collateralization.
"""

get_my_collateralization()
"""
returns your account's collateralization
"""

get_collateralization(address)
"""
returns some other account's collateralization
"""

And then just the collateralization threshold in constants.py