tothemoon

Inspiration

We were tired of boring boomer trading platforms. You know the ones - charts that look like hospital monitors, 50 different indicators nobody understands, and "risk management" lectures. Where's the FUN? Where's the DEGEN?

So we asked: what if we made trading feel like putting it all on black at the roulette table? No stop losses, no fundamentals, just pure adrenaline and conviction. We watched degens ape into meme coins on Discord and realized - the thrill isn't in the analysis, it's in the YOLO.

Enter tothemoon: a straight-to-the-point leveraged trading casino where you can 10000x your stack or get absolutely rekt in seconds. Real Pyth Network prices mean you're actually trading against the market - no fake simulators.

What it does

tothemoon is a high-octane degen trading arena where you put your stack on the line:

  • YOLO Mode: Stake your sats and pray. No paper hands allowed. 1500x to 10000x leverage - because 100x is for cowards
  • Live Market Data: Real Pyth Network feeds. The market doesn't sleep and neither do we. Prices update every 100-400ms so you can watch your liquidation happen in real-time
  • Degen Mechanics: LONG or SHORT, no in-between. 5-45 second positions for those with diamond hands and weak bladders
  • Liquidation Porn: Get absolutely nuked with extreme leverage. 2000x gives you a -0.05% buffer before you're toast. Margin of safety? Never heard of her
  • Visual Drama: Watch your position fly across the screen in a helicopter. Win = smooth landing. Liquidation = missile strike, explosion, flaming wreckage falling into the ocean

How we built it

Frontend (React + TypeScript + Vite)

  • TailwindCSS for that dark casino aesthetic - think Vegas meets BitMEX
  • Framer Motion for buttery animations that keep you glued to the screen
  • WebSocket connection to the backend for millisecond-price updates
  • Real-time P&L chart that looks like a heart monitor during a panic attack

Backend (Python + FastAPI)

  • Async position manager handling multiple YOLOs simultaneously
  • Pyth Network integration for real crypto perpetual futures prices
  • Position lifecycle: PENDING (3s to reconsider your life choices) → OPEN (time to sweat) → CLOSED_WIN/CLOSED_LOSS/LIQUIDATED (reality check)
  • Liquidation math that doesn't care about your feelings

The Stack

  • Frontend screams at the backend via WebSocket
  • Backend screams at Pyth Network for prices
  • Everyone screams when liquidation hits

Challenges we ran into

  1. Pyth Network Connection Dropping: WebSocket dies sometimes. We auto-reconnect because the market never stops and neither should your losses.

  2. Floating Point Liquidation Precision: When you're dealing with 10000x leverage, tiny math errors can mean the difference between winning and getting liquidated. We had to be surgically precise.

  3. Animation Choreography: Coordinating the helicopter flight, missile trajectory, explosion sequence, and falling wreckage required precise state management. One glitch and the immersion breaks.

  4. Connecting wallets and finding providers with enough leverage to make the risk soar is hard.

Accomplishments that we're proud of

  • Real DeFi Integration: Actual Pyth Network feeds, not fake random numbers. You're trading against real market volatility
  • Extreme Leverage: 10000x leverage implemented and working. Yes, you can lose your entire stack in literal milliseconds. This is financial violence.
  • Liquidation Theater: The missile strike animation hits different. There's something deeply satisfying about watching your position get absolutely obliterated in HD
  • Clean Architecture: Even though it's a degen casino, the code is actually well-structured. Separation of concerns between aping, liquidating, and tracking
  • Educational Carnage: Users learn about liquidation prices and leverage the hard way - by experiencing it. No risk, all the trauma

What we learned

  • WebSocket Patterns: How to stream real-time data without choking. Reconnection handling, state sync, the works
  • Async Position Management: Running hundreds of concurrent liquidation timers without race conditions. It's like juggling grenades
  • Pyth Network: Working with actual blockchain oracles. Real price data hits different than fake numbers
  • React Animation: Making things move smoothly even when the user is screaming at their screen
  • The Mathematics of Rekt: Extreme leverage math is unforgiving. At 10000x, a 0.01% move against you is game over

What's next for tothemoon

  • Real Wallet Integration: Connect your actual MetaMask. Move from paper trading to real aping (testnet first, we're not monsters)
  • More Assets: DOGE, ARB, AVAX - the more volatile the better. We want assets that swing 20% while you're blinking
  • Leaderboards of Shame: Public rankings for biggest liquidations. We all remember the guy who 10000x'd and got rekt in 3 seconds
  • Social Rekt Sharing: Tweet your liquidations. Brag about your wins. There's no such thing as losses, only "learning experiences"
  • Trading Tournaments: Weekly competitions. Biggest degen wins prizes. Biggest liquidation gets honorable mention
  • Mobile App: Aping on the go. Bathroom degen trading. Commuter liquidation. The possibilities are endless
  • On-Chain Settlement: Smart contracts that automatically liquidate you. Trustless rekt. Beautiful

Built With

Share this project:

Updates