update logs in python code
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
2947100f4d
commit
1019ba000e
|
@ -10,7 +10,7 @@ All environment variables are optional.
|
|||
|
||||
# How to run while developing
|
||||
* `yarn install`
|
||||
* `yarn nodemon ./src/server.ts`
|
||||
* `yarn ts-node ./src/server.ts` or if you have `nodemon` installed then, `nodemon ./src/server.ts`
|
||||
|
||||
# How to run using docker
|
||||
* `docker pull microwavedcola/mango-service-v3`
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
from mango_service_v3_py.api import MangoServiceV3Client
|
||||
from mango_service_v3_py.dtos import PlaceOrder
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
mango_service_v3_client = MangoServiceV3Client()
|
||||
|
||||
print("orders before cancelling")
|
||||
for order in mango_service_v3_client.get_orders():
|
||||
print(order.json(indent=4, sort_keys=True))
|
||||
print("")
|
||||
|
||||
mango_service_v3_client.cancel_all_orders()
|
||||
print("orders after cancelling")
|
||||
for order in mango_service_v3_client.get_orders():
|
||||
print(order.json(indent=4, sort_keys=True))
|
|
@ -17,6 +17,7 @@ if __name__ == "__main__":
|
|||
mango_service_v3_client = MangoServiceV3Client()
|
||||
|
||||
market = mango_service_v3_client.get_market_by_market_name("BTC-PERP")[0]
|
||||
print(f"latest btc-perp price is {market.last}")
|
||||
|
||||
mango_service_v3_client.cancel_all_orders()
|
||||
|
||||
|
@ -30,7 +31,7 @@ if __name__ == "__main__":
|
|||
fibs_sum = sum(fibs)
|
||||
|
||||
for i, fib in enumerate(fibs):
|
||||
price = market.last * (100 - fibs[-1] + fib) / 100
|
||||
price = market.last * ((100 - fibs[-1] + fib) / 100)
|
||||
price = mango_service_v3_client.to_nearest(price, market.price_increment)
|
||||
|
||||
size = (total_usd_balance / market.price) * (fibs[len(fibs) - 1 - i] / fibs_sum)
|
||||
|
|
Loading…
Reference in New Issue