t-mw / gw2-arbitrage

Finds items in Guild Wars 2 that can be sold on the trading post for a higher price than the cost of crafting the item.
28 stars 5 forks source link

Give minimum price to sell at #9

Closed Iiridayn closed 2 years ago

Iiridayn commented 3 years ago

Just found this tool, and quickly learned that sometimes other people use it or otherwise analyse the market as well. When I've accidentally overproduced, I want to know how low I can still sell for and break even on my costs. This adds that feature.

Iiridayn commented 3 years ago

This could be wrong... the calculated price is sometimes notably below the price of other available buy orders which the tool does not recommend. I'll need to run some simulations to verify what's going on.

t-mw commented 3 years ago

Thanks for the PR!

This could be wrong... the calculated price is sometimes notably below the price of other available buy orders which the tool does not recommend. I'll need to run some simulations to verify what's going on.

I'm not sure if this is what you're seeing, but I think the commission is being applied in the wrong direction. You want to increase the breakeven by 15% to cover fees, rather than reduce it by 15%.

Iiridayn commented 3 years ago

Yep, adding instead of subtracting seems to be exactly what I did wrong. The output is looking pretty accurate now :).

Iiridayn commented 3 years ago

Not perfect though; found a case where there were buy offers above my computed sale price, the market had plenty of volume to fill those orders at essentially the same price, but the tool said it wasn't profitable. I trust the tool more than my current output, so I'll need to dig into this further again.

t-mw commented 3 years ago

Could it be a rounding error? You could try keeping it as a Rational32 until you need to print it.

Iiridayn commented 3 years ago

Okay, this one should work now. I was not computing it right (x .85 1.15 != x). When fixed, the price was still lower than the stopping criteria as the initial crafting was more profitable than the latter. What I really wanted anyway was to know the last price to sell at. Since I had debug statements in the loop and know where it is now, I just used that instead.

Iiridayn commented 3 years ago

Once more w/o the rune of air commit.

Iiridayn commented 2 years ago

I'll put some more time into this later - I'm realizing there are several other prices I'd like to see: min list price, min recommended sell price, and max recommended buy price for the various resources.

Iiridayn commented 2 years ago

I'll put resource prices on another PR if I get to them, looks non-trivial.

t-mw commented 2 years ago

@Iiridayn do you have the option to merge now that I've approved the PR?

t-mw commented 2 years ago

Also, feel free to request reviews on the other PRs if they're ready.

Iiridayn commented 2 years ago

This branch has no conflicts with the base branch Only those with write access to this repository can merge pull requests.