Last night I discovered that my Polymarket automated trading program secretly placed 37 orders, costing $110.


The program logs show "Position: 0". But when I opened Polymarket, all six weather markets were my positions.
What's going on?
After placing orders, the API told the program "not purchased," so the program didn't record it. But in reality, the money had already been spent.
Then the program crashed due to another bug, and the process manager automatically restarted it. After the restart, the program saw—"Huh, no positions, buy again."
Crash → Restart → Buy again → Crash again. Repeated 34 times.
The most ironic part is, I already had the correct trade confirmation logic in another strategy. When I wrote it, I didn't review my own code.
Three lessons:
• Don't trust any API's instant response as the final result; always double-check
• The auto-restart mechanism has no de-duplication protection = turns a small bug into a chain reaction of explosions
• The correct solutions already in my codebase are much cheaper than re-learning the hard way
Fortunately, I checked the weather forecast, and most of the positions should be recoverable. But that's luck, not skill.
View Original
post-image
post-image
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
0/400
No comments
  • Pin

Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate App
Community
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)