Pusulam Admin·

How Pusulam Works: Technical Architecture

#technical#architecture#cpmm#open-source#transparency#engineering

Why We Share Technical Details

To trust a prediction platform, you need to know how it works. How are odds calculated? How are markets resolved? Where does our data come from? In this post, we explain Pusulam's technical architecture in a transparent way.

Tech Stack

Pusulam is built on modern web technologies:

  • Next.js 16 and React 19, full stack TypeScript application
  • PostgreSQL database (Neon cloud service, US East)
  • Vercel hosting with global CDN
  • Prisma ORM for type-safe database access
  • Stripe for payment infrastructure
  • Resend for email notifications
  • Anthropic Claude for AI features

CPMM: How Prices Are Formed

Every market has two pools: the Yes Pool and the No Pool. They start out equal (100/100). When someone votes Yes, they receive shares from the Yes Pool and the No Pool grows. This drives up the price (probability) of Yes.

The formula is straightforward: Yes Probability = No Pool / (Yes Pool + No Pool)

This is the CPMM (Constant Product Market Maker) mechanism, also used by Manifold Markets. It works through a "complete set" method: when you vote, both Yes and No tokens are created, and the side you don't want is sold back into the pool.

The benefit: it's resistant to manipulation and there's always liquidity. Nobody can "drain" the market dry.

Odds Synchronization

Pusulam doesn't operate in isolation. Every minute, we pull odds updates from Polymarket and Manifold Markets. Billions of dollars in real money trade on these two sources. By using their odds as a reference, we keep prices on our platform aligned with the real world.

Synchronization works in two layers:

The first layer runs every minute. It matches markets by title and updates prices for the same topic. No AI involved, zero cost.

The second layer runs every hour. It uses AI (Claude Haiku) for smarter matching. It can even catch markets covering the same topic but written in different languages.

Market Resolution

When a market expires, automatic resolution kicks in. There are two methods:

The first is API-based resolution for numerical markets. We pull data directly from APIs like CoinGecko and Frankfurter for things like Bitcoin prices, exchange rates, and stock indices, then compare. No AI needed. The error rate with this method is close to zero.

The second is AI-based resolution for event markets. The Claude Sonnet model searches the web to verify whether an event occurred. When it's not sure, it returns "SKIP" and the market stays open.

Security

We take platform security seriously:

  • Passwords are hashed with bcrypt using 12 rounds
  • All connections are encrypted with HTTPS/TLS
  • Rate limiting is active on every endpoint
  • Accounts are locked for 15 minutes after 10 failed login attempts
  • Content Security Policy (CSP) headers are active
  • HSTS set to 2 years, on the preload list
  • Input sanitization against SQL injection and XSS
  • Timing-safe token comparison

Language Support

We support 10 languages: Turkish, English, German, Spanish, French, Arabic, Portuguese, Kinyarwanda, Swahili, and Amharic.

UI translations are managed with the next-intl library. Market content is automatically translated using AI. When a new market is added, it's translated into 7 languages within minutes.

Data Flow

What happens every minute:

  1. Price updates from Polymarket and Manifold
  2. Detection of expired markets

What happens every hour:

  1. AI-powered new market matching
  2. Automatic import and translation of new markets
  3. Resolution of expired markets

What happens every 6 hours:

  1. Live data updates (Bitcoin price, exchange rates)
  2. Market news (AI web search)
  3. Detection of markets that have already resolved but are still open

Open Source and Transparency

We don't hide Pusulam's code. Our goal is to build trust. Knowing how we work is the first step toward trusting us.

If you have questions, you can reach us at info@pusulam.ai.

Try Pusulam

Did you like this post?

Comments (0)

Please log in to comment.

No comments yet. Be the first to comment!