commit
b00313ecbd
|
@ -19,7 +19,7 @@ if __name__ == "__main__":
|
|||
)
|
||||
)
|
||||
|
||||
for order in mango_service_v3_client.get_orderboook("BTC-PERP"):
|
||||
for order in mango_service_v3_client.get_orderbook("BTC-PERP"):
|
||||
print(order.json(indent=4, sort_keys=True))
|
||||
|
||||
for trade in mango_service_v3_client.get_trades("BTC-PERP"):
|
||||
|
|
|
@ -58,7 +58,7 @@ class MangoServiceV3Client:
|
|||
)
|
||||
return parse_obj_as(List[Market], json.loads(response.text)["result"])
|
||||
|
||||
def get_orderboook(self, market_name: str, depth: int = 30) -> Orderbook:
|
||||
def get_orderbook(self, market_name: str, depth: int = 30) -> Orderbook:
|
||||
response = httpx.get(
|
||||
f"{self.BASE_URL}/markets/{market_name}/orderbook?depth={depth}"
|
||||
)
|
||||
|
|
|
@ -58,7 +58,7 @@ def test_get_candles(mango_service_v3_client, market):
|
|||
|
||||
@pytest.mark.parametrize("market", SPOT_AND_PERP_MARKETS)
|
||||
def test_get_orderbook(mango_service_v3_client, market):
|
||||
ob = mango_service_v3_client.get_orderboook(market)
|
||||
ob = mango_service_v3_client.get_orderbook(market)
|
||||
assert len(ob.asks) > 0
|
||||
assert len(ob.bids) > 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue