How to trade/change this code for futures?

Hey

I have done my code for spot market.
Now I wanted to change it for futures trading, but I am unsure what to change.

def get_price():

#Return the current price for all coins on binance
initial_price = {}
prices = binance_client.get_all_tickers()
for coin in prices:

if PAIR_WITH in coin["symbol"] and all(item not in coin["symbol"] for item in FIATS):
  initial_price[coin["symbol"]] = { "price": coin["price"], "time": datetime.now()}

return initial_price

def get_price24hrs():
lowest_price = {}
prices1 = binance_client.get_ticker()
for coin in prices1:

if PAIR_WITH in coin["symbol"] and all(item not in coin["symbol"] for item in FIATS):

  lowest_price[coin["symbol"]] = {"lowPrice": coin["lowPrice"], "time": datetime.now() - timedelta(minutes=1)}

return lowest_price

Could you help me please?

Which library are you using? you need to make sure if the binance_client for spot or futures?

Hi Dino,

Thanks for your answer.
Basically what i was looking for was to replace the expressions for:

prices = client.get_all_tickers() vs client.futures_mark_price()
prices1 = client.get_ticker() vs client.futures_ticker()

Somehow i find the solution for this by luck. I dont think there’s anywhere where it’s explicit how to make this.

Thanks