Intro
"League Profit" is the profit calculated specifically for the "League Season". It is not the same as overall account profit. At the time of writing, league profit considers:
the current value (at any given moment)
of all bets (a 'bet' is roughly equivalent to a single time clicking the 'Buy' button, this also includes 'sells' and 'limit orders')
placed after the start of the current season (and before the end of it)
except NOT counting bets made within the first hour of a market created by the bettor
Improvement
I argue that the league profit should also carefully examine "fills", which are a mechanism that tracks what counterparties your "bet" was made against. In many cases, the bet is filled directly against the AMM. In markets where limit orders are present, the bet may fill against those limit orders in addition to the AMM.
If your bet "fills" against your own limit order, that portion of the bet should not count for league purposes.
Any time you trade into your own limit order, it is essentially a "nothing". Your Yes limit order for 50 shares is matched by your No order for 50 shares and you gain/lose no mana. But for the purposes of league scoring, trading into your own limit order can create fake league profit -- here's how:
Base case: If both the limit order and the filling bet were made in the same season in someone else's market, then it counts nothing toward your league profit.
If your limit order was made on your own market within the first hour of its creation, and then you fill it after 1 hour, only the fill counts toward your league profit. So you could easily (intentionally or accidentally) end up with a weird situation where you had a no-overall-profit trade that causes a large up/down swing in your league profit.
If your limit order was made in a past season on any market, the same thing applies. When you (accidentally or intentionally) trade into it, you have a no-op overall but it counts the 2nd leg for league purposes.
In the two cases where you filled your own limit order where only one side counted, using it in any way for league purposes kinda sucks:
If you were buying into it accidentally, for example when news broke on a market, you're rewarding yourself with excess league profit by trading against yourself. It could even be a large amount depending on the size of your limit order. You can also accidentally end up with huge losses, which also sucks.
If someone was doing this intentionally (they can very easiliy make it look accidental), then they could be picking up small amounts of one-sided 'league profit' all over the place. There's no reason to make it so easy to do this. Yes, doing it intentionally would already be against the rules, but "at least shut the door" is a good principle.
So I changed the leagues code to factor out self-fills on orders placed in the same league season. It'd be more annoying to filter them out from any season but it could be done