Git Product home page Git Product logo

dmarket_bot's Introduction

Hi there, I'm Louis - aka Louis45 ๐Ÿ‘‹

I'm a young Developer!

  • ๐Ÿ”ญ I just made SkinbaronBot_v2 publicly available!
  • ๐ŸŒฑ Iโ€™m currently learning everything ๐Ÿคฃ
  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate with other developers
  • ๐Ÿฅ… 2024 Goals: Contribute more to Open Source projects

Connect with me:

linktree.louis45.de


Languages and Tools:

Python Visual Studio Code HTML CSS SQL MySQL Git GitHub GitHub Selenium JavaScript




โšก Recent GitHub Activity
  1. โ— Opened issue #1 in CoderxMax/Dll-Injector-EAC-BAC-VANGUARD
  2. ๐Ÿ”’ Closed issue #1 in Luois45/roblox-fishing-simulator-bot
  3. ๐ŸŽ‰ Merged PR #65 in Luois45/DiscordShopBot
  4. ๐ŸŽ‰ Merged PR #69 in Luois45/DiscordShopBot
  5. ๐Ÿ—ฃ Commented on #67 in Luois45/DiscordShopBot
  6. ๐Ÿ”’ Closed issue #67 in Luois45/DiscordShopBot
  7. ๐Ÿ—ฃ Commented on #1 in Luois45/roblox-starving-artists-bot
  8. ๐Ÿ—ฃ Commented on #1 in Luois45/VRC-OSCStuff
  9. ๐Ÿ—ฃ Commented on #4 in timagr615/dmarket_bot
  10. ๐ŸŽ‰ Merged PR #70 in Luois45/DiscordShopBot
โšก GitHub Stats Louis45's GitHub Stats
โšก Most Used Languages Louis45's Most Used Languages

dmarket_bot's People

Contributors

cfomodz avatar luois45 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dmarket_bot's Issues

Selling items doesn't work [Fixed]

image

2024-01-12 17:20:05.438 | INFO     | __main__:main:113 - The bot is launching
2024-01-12 17:20:05.438 | INFO     | __main__:main:113 - The bot is launching
2024-01-12 17:20:05.439 | DEBUG    | api.dmarketapi:get_money_loop:131 - get money_loop
2024-01-12 17:20:05.439 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/account/v1/balance
2024-01-12 17:20:05.480 | DEBUG    | __main__:history_loop:53 - History loop
2024-01-12 17:20:05.481 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/marketplace-api/v1/user-targets/closed?Limit=100&OrderDir=desc
2024-01-12 17:20:05.481 | DEBUG    | api.dmarketapi:closed_targets:238 - https://api.dmarket.com/marketplace-api/v1/user-targets/closed
2024-01-12 17:20:05.481 | DEBUG    | api.dmarketapi:closed_targets:239 - {'Limit': '100', 'OrderDir': 'desc'}
2024-01-12 17:20:05.483 | DEBUG    | __main__:add_to_sell_loop:66 - Add to sell loop
2024-01-12 17:20:05.483 | DEBUG    | modules.offers:add_to_sell:66 - Add to sell
select_not_sell
select_not_sell length: 100
2024-01-12 17:20:05.490 | ERROR    | __main__:add_to_sell_loop:71 -  Failed to list skin/item for sale: 5 validation errors for SellOffer
title
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.5/v/string_type
game
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.5/v/string_type
OfferID
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.5/v/string_type
sellTime
  Input should be a valid datetime [type=datetime_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.5/v/datetime_type
sellPrice
  Input should be a valid number [type=float_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.5/v/float_type. Sleep for 30 seconds.

Steps to recreate: Run main.py with config set as instructed in readme

The issue is caused by the change to the API endpoint /marketplace-api/v1/user-offers/closed (either input or response, I am unsure but will comment when able to debug

Two questions

Can you make the tutorial easier to follow? What is
PUBLIC_KEY = "your public api key"
SECRET_KEY = "your secret api key"
And where do I get that?
Question 2
I'm not sure if I want to use it the way it is normally used, with buying and selling items and all that, I just want it to buy keys as soon as they are maybe $1.56 or cheaper, can I limit the bot to do that?

create_pre_base gets the items but doesn't save/store them (Bug)

image

2024-01-19 12:12:20.538 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Zucchini+Furnace
2024-01-19 12:12:20.700 | DEBUG    | modules.skinbase:filter_skins:61 - History: 20
2024-01-19 12:12:20.700 | DEBUG    | modules.skinbase:filter_skins:58 - Game: Games.RUST. Get history for uMod Fundraiser Garage Door
2024-01-19 12:12:20.701 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=uMod+Fundraiser+Garage+Door
2024-01-19 12:12:20.864 | DEBUG    | modules.skinbase:filter_skins:61 - History: 20
2024-01-19 12:12:20.864 | DEBUG    | modules.skinbase:filter_skins:58 - Game: Games.RUST. Get history for ะกะœะญะ ะขะฌ
2024-01-19 12:12:20.864 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=%D0%A1%D0%9C%D0%AD%D0%A0%D0%A2%D0%AC
2024-01-19 12:12:21.044 | DEBUG    | modules.skinbase:filter_skins:61 - History: 20
2024-01-19 12:12:21.045 | INFO     | modules.skinbase:update_base:91 - Total skins analyzed: 0
2024-01-19 12:12:21.045 | INFO     | modules.skinbase:update_base:91 - Total skins analyzed: 0
2024-01-19 12:12:21.063 | INFO     | modules.skinbase:update:99 - No skins to update are available.
2024-01-19 12:12:21.063 | INFO     | modules.skinbase:update:99 - No skins to update are available.
2024-01-19 12:12:21.064 | INFO     | modules.skinbase:update:102 - The skin/item database was updated 8.35 minutes.
2024-01-19 12:12:21.064 | INFO     | modules.skinbase:update:102 - The skin/item database was updated 8.35 minutes.
2024-01-19 12:12:21.064 | DEBUG    | __main__:create_pre_base:23 - Skin database sleep
2024-01-19 12:12:23.537 | DEBUG    | __main__:orders_loop:33 - orders loop
2024-01-19 12:12:23.537 | DEBUG    | __main__:orders_loop:35 - Balance: 734
2024-01-19 12:12:23.537 | DEBUG    | __main__:orders_loop:37 - Balance is enough to place orders, calling update_orders()
2024-01-19 12:12:23.538 | DEBUG    | modules.orders:update_orders:256 - Update orders
2024-01-19 12:12:23.538 | DEBUG    | modules.orders:skins_to_buy:178 - ALL SKINS 0
2024-01-19 12:12:23.538 | INFO     | modules.orders:skins_to_buy:181 - SKINS 0
2024-01-19 12:12:23.538 | INFO     | modules.orders:skins_to_buy:181 - SKINS 0
2024-01-19 12:12:23.539 | DEBUG    | modules.orders:skins_to_buy:199 - Database of orders was updated 0.0 sec.
2024-01-19 12:12:23.539 | DEBUG    | modules.orders:update_orders:258 - Skins to buy: 0
2024-01-19 12:12:23.540 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/marketplace-api/v1/user-targets?BasicFilters.Status=TargetStatusActive&GameId=rust&BasicFilters.Currency=USD&Limit=1000&SortType=UserTargetsSortTypeDefault
2024-01-19 12:12:23.712 | DEBUG    | api.dmarketapi:user_targets:230 - user_targets() count: 0
2024-01-19 12:12:23.712 | ERROR    | __main__:orders_loop:48 -  Failed to update database of orders: list index out of range. Sleep for 5 seconds.

Bot doesn't sell items depo'ed from steam

The sell loop doesn't sell items not purchased on dmarket, as the idea is that it takes the purchase price, adds some amount of profit, and lists it for that amount.

Since items from steam don't have a 'purchase price' associated with that Asset_Id, it basically just skips it. This maybe isn't a huge thing for big item traders - that is traders who deal in big items - since they can just manually sell any of those then use the bal to buy sell buy sell buy sell (via the bot since it's all on dmarket(at least once the currently open bugs are fixed)), but this is a pretty big problem for quantity over quality traders like me, trying to make $.08 on 100 items instead of $8 on 1 item.. which wouldn't be worth it without a bot, but.. that's why we're here is to do stuff that wouldn't be worth it without a bot, right lol?

I would assume this would be a config option if you wanted to "blind" sell such items, and simply just sell it at like the 17th/20th cheapest price of the current offers or something (or have it be a config option what position out of 20 you want to match, with #1 matching the lowest price and #0 would beat it by a cent or something to that effect).

get user active/inactive targets doesn't work (in orders_loop) causing buying to not work

Reproduce: vanilla main deployment

Root of issue: I'm assuming it has to be in the models, because I have used my naked API testing script where I manually specify the same URL it is outputting in debug as being the URL that is being signed, and I get a response [with results according to the posted spec], then I try it in the bot and it dies (without an error or exception I might add).

Steps tried: 1. Lots of debug statements added to base code.
2. Well I guess see above.

If someone wants to fix this:
I have not fully stepped through the function in debug mode but I assume doing so and following the values of these would lead to at least knowing the exact spot where the breakdown is occurring and then hopefully from there we can compare our known good to find the diff.

authorization error

Can anyone help? I launched the bot, but it shows an authorization error.
image

History cannot get LastSales for items with apostrophes

image

2024-01-22 20:51:50.377 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Black Beenie Hat
2024-01-22 20:51:50.377 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Black+Beenie+Hat
2024-01-22 20:51:50.515 | DEBUG    | modules.skinbase:filter_skins:72 - Avg price: 0.07
2024-01-22 20:51:50.515 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Black Hoodie
2024-01-22 20:51:50.516 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Black+Hoodie
2024-01-22 20:51:50.653 | DEBUG    | modules.skinbase:filter_skins:72 - Avg price: 0.25
2024-01-22 20:51:50.654 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Black Mamba
2024-01-22 20:51:50.654 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Black+Mamba
2024-01-22 20:51:50.815 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Blacksmith's Door
2024-01-22 20:51:50.816 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Blacksmith%27s+Door
2024-01-22 20:51:50.986 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str
2024-01-22 20:51:50.986 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str
2024-01-22 20:51:50.987 | DEBUG    | modules.skinbase:filter_skins:63 - Game: Games.RUST. Get history for Blacksmith's Hatchet
2024-01-22 20:51:50.988 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Blacksmith%27s+Hatchet
2024-01-22 20:51:51.156 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str
2024-01-22 20:51:51.156 | ERROR    | modules.skinbase:filter_skins:89 - Exception in skinbasecan only concatenate str (not "type") to str

Testing tens of thousands of items and this is the only error among them (as far as history is concerned)

PS The skin DB takes around 1 min per 1k offers you pull from Dmarket, so don't be surprised when the DB takes an hour to create the base the first time if you don't minimize the config params to optimize for testing (a span of a few cents usually does fine).

Getting sales history of items (forming base DB) doesn't work

image

2024-01-12 17:20:07.435 | DEBUG    | modules.skinbase:filter_skins:58 - Game: Games.RUST. Get history for Adobe Door
2024-01-12 17:20:07.436 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Adobe+Door
2024-01-12 17:20:07.581 | ERROR    | modules.skinbase:filter_skins:76 - Exception in skinbase1 validation error for LastSales
LastSales
  Field required [type=missing, input_value={'sales': [{'price': '0.3...'orderAttributes': {}}]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing
2024-01-12 17:20:07.581 | ERROR    | modules.skinbase:filter_skins:76 - Exception in skinbase1 validation error for LastSales
LastSales
  Field required [type=missing, input_value={'sales': [{'price': '0.3...'orderAttributes': {}}]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing
2024-01-12 17:20:07.582 | DEBUG    | modules.skinbase:filter_skins:78 - Game: Games.RUST. Parsed 0 skins/items.
2024-01-12 17:20:07.582 | DEBUG    | modules.skinbase:filter_skins:58 - Game: Games.RUST. Get history for Adobe Garage Door
2024-01-12 17:20:07.583 | DEBUG    | api.dmarketapi:generate_headers:32 - string_to_sign: GET/trade-aggregator/v1/last-sales?gameId=rust&title=Adobe+Garage+Door
2024-01-12 17:20:07.714 | ERROR    | modules.skinbase:filter_skins:76 - Exception in skinbase1 validation error for LastSales
LastSales
  Field required [type=missing, input_value={'sales': [{'price': '0.4...'orderAttributes': {}}]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing
2024-01-12 17:20:07.714 | ERROR    | modules.skinbase:filter_skins:76 - Exception in skinbase1 validation error for LastSales
LastSales
  Field required [type=missing, input_value={'sales': [{'price': '0.4...'orderAttributes': {}}]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing

Recreate: run main.py

The issue is caused by the change in the response to the /trade-aggregator/v1/last-sales endpoint both in input expected and in expected response data.

This should be both straightforward and easy to debug and update to the current spec

Buying items doesn't work (orders_list is empty)

Recreate: vanilla setup on main

Root of issue: I actually don't understand why the orders loop is broken, and it doesn't give any errors. More specifically, the orders.orders_list or whatever it's named is empty, even before being compared to the balance, which doesn't make sense, but that's likely going to be our first sub-issue in getting buying to work.

Steps tried:
Add debug output to every function called by orders loop, recursively, to see where things break down - they don't, everything appears fine, not exceptions anyway.

Checked for modifications to the endpoint from what it used to be 3y ago- it is exactly the same as far as I can tell.

DB error occurs when fetching history

A database error occurs when fetching the history.
These are the logs:

2022-02-11 14:33:32.967 | INFO     | __main__:main:104 - The bot is launching
2022-02-11 14:33:32.988 | INFO     | __main__:create_pre_base:20 - Skin database processing
2022-02-11 14:33:35.416 | ERROR    | __main__:history_loop:56 -  Failed to fetch history: near "END": syntax error. Sleep for 30 seconds.
2022-02-11 14:34:07.081 | ERROR    | __main__:history_loop:56 -  Failed to fetch history: near "END": syntax error. Sleep for 30 seconds.
2022-02-11 14:34:37.245 | ERROR    | __main__:history_loop:56 -  Failed to fetch history: near "END": syntax error. Sleep for 30 seconds.

Steps to replicate:

  1. Set it up like described in the README
  2. Run main.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.