A market manipulating bot for old school runescape, utilizing their public market API
Tools:
OSRS Flipper consists of Dreambot client(s) and a python server, which uses the past price trends and common data about items to know when it's good time to buy. It factors in elements like the volume of the item, the past price points, and volatility when finding good "flips" (items to be bought/sold for a profit).
for item in items:
id = str(item["id"])
if id in hourly and "limit" in item:
h = hourly[id]
l = latest[id]
limit = item["limit"]
if (total_volume := h["highPriceVolume"] + h["lowPriceVolume"]) > 25000 and (avgHigh := h["avgHighPrice"]):
buy_price = l["low"] + 1
sell_price = l["high"] - 1
profit = (sell_price - buy_price - math.floor(sell_price * tax)) * limit
# Make sure we will be able to sell it in the future by checking against the average sell price an hour back
valid_sellability = avgHigh > sell_price
if profit > 0 and valid_sellability:
flips.append({
"id" : id,
"name" : item["name"],
"profit" : profit,
"limit" : limit,
"members" : item["members"],
"value" : profit / (buy_price * limit),
"buy" : buy_price,
"sell" : sell_price
})