Inspiration

When you buy a token, you're funding a project but you don't own anything. There's no equity, no claim, no legal standing. You take all the risk and get none of the upside that an actual investor would get. Meanwhile, if you're a founder trying to raise a pre-seed or seed, your only real option is pitching VCs and hoping someone in the room likes you enough to write a check. We wanted to build a way for founders to raise directly from token holders where those holders actually get real equity with clear rules and legal claims, all enforced on-chain.

What It Does

Lapis is a transparent fundraising platform on XRPL that gives token holders real equity. Three steps:

1. AI Due Diligence. Paste a GitHub URL. The agent scrapes commits, contributors, languages, and CI config via Octokit, pulls social signals, and fetches market sentiment from Polymarket. Then it runs two Claude analysis passes: a scorer that evaluates code quality, team strength, traction, and social presence on a 0-100 scale, and an adversarial auditor that red-teams the first pass and flags fake traction or inflated numbers. The analysis runs asynchronously in the background (fire-and-forget), so the API responds immediately and you poll for status. The final report card is paywalled at 0.05 XRP via a native XRPL micropayment, verified through the X-Payment-TxHash header.

2. Prediction Market. A valuation market opens, seeded by the agent's own estimate. The agent maps the overall score to a valuation using an exponential curve ($0.5M × 1.05^score, so a score of 50 is roughly $5.7M). Participants bet using real data from the report card, and the market converges on a volume-weighted consensus valuation. The crowd decides what the startup is worth, not a VC partner in a pitch meeting.

3. Cross-Chain Settlement. One click settles across two chains. A legally binding SAFE deploys on Base Sepolia via MetaLex. Then MPT equity tokens issue on XRPL with the SAFE contract address and document hash embedded in metadata. The Base contract stores the XRPL issuance ID back via linkXRPL(), creating a bidirectional cryptographic link. The /safe/:marketId endpoint verifies both sides match. Token holders receive MPTs that represent actual equity, backed by a real legal agreement, not just a receipt. Shares are locked in vesting escrows with two release mechanisms: time-based cliffs where anyone can call EscrowFinish after the cliff date, and condition-based triggers using PREIMAGE-SHA-256 crypto-conditions where the agent holds the fulfillment preimage and submits it automatically. The agent is a trustless trustee. Platform fees are paid in RLUSD.

The MPT is configured at issuance with flags that are irreversible after the first holder opts in: tfMPTRequireAuth for compliance gating, tfMPTCanEscrow for vesting, tfMPTCanTransfer and tfMPTCanTrade for secondary market control, tfMPTCanLock for founder freeze capability, and a TransferFee royalty on every secondary transfer. Founders set the terms. Holders get real ownership.

After settlement, the agent keeps going. It monitors the repo on a configurable interval, re-analyzes on new commits, auto-adjusts market positions when scores shift, and triggers XRPL hooks if the score drops more than 15 points.

How We Built It

TypeScript monorepo (ESM-only, all imports use .js extensions) with four packages:

  • @lapis/shared — Shared types for ReportCard, scores, and market data. Builds first since every other package depends on it.
  • @lapis/ai-agent — Express 4 API server with typed response wrappers. Handles analysis, markets, XRPL settlement, and monitoring. 16+ endpoints across analysis, prediction markets, settlement, and monitoring. Uses a settlement mutex to handle sequential XRPL sequence numbers, so concurrent settlements queue instead of failing.
  • @lapis/xrpl-contracts — XRPL primitives via xrpl.js v4. MPT token issuance, vesting escrows, RLUSD payments, wallet management. All transactions use submitAndWait() with delivered_amount verification to prevent partial payment attacks.
  • @lapis/metalex — MetaLex SAFE contract deployment on Base Sepolia for legal anchoring.

The frontend is a Next.js app at lapis.bet. Storage defaults to in-memory JavaScript Maps, with optional Redis persistence via REDIS_URL. AI scoring uses Claude (configurable model, defaults to Claude Sonnet). XRPL wallets are generated from the testnet faucet with npm run setup. Docs are on Mintlify.

This was the first time most of our team had built anything in crypto. A lot of the build was learning XRPL's transaction model from scratch and figuring out how MPTs, escrows, and cross-chain state management actually work in practice.

Challenges We Ran Into

The big one: XRPL has a strict ordering requirement for MPT holder onboarding. The holder must opt in via MPTokenAuthorize before the founder authorizes them. Reverse the order and you get tecOBJECT_NOT_FOUND with no helpful context. That cost us more time than we'd like to admit.

Cross-chain linking was the other hard problem. We needed the SAFE contract address from Base before we could embed it in the MPT metadata on XRPL, then needed the XRPL issuance ID back on Base to complete the bidirectional link. Sequencing that correctly across two chains with different finality times, for a team that had never touched either chain before this weekend, was not trivial.

RLUSD payments fail on testnet with tecPATH_DRY because wallets don't have RLUSD balance. We made RLUSD non-critical so settlement still completes, but it took us a bit to realize that was expected testnet behavior and not a bug in our code.

Settlement is also slow, around 30 seconds, because each participant requires multiple sequential XRPL transactions at 3-5 seconds each. We capped the demo at 5 participants to keep it reasonable.

Accomplishments That We're Proud Of

The whole pipeline works end to end. You paste a URL, the agent scores it, a prediction market opens with the agent's own seed position, the crowd bets, and it settles into real on-chain equity with vesting escrows and a legal anchor linked across two chains. Token holders walk away with actual equity, not a speculative token with no claim to anything. That full loop running live is the thing we're most proud of.

The prediction market seeded by the agent is the other one. The agent doesn't just inform the market, it participates in it. It forms a valuation belief from its own analysis and puts its position down as initial liquidity. That felt like a genuinely agentic behavior, not a wrapper around an API call.

What We Learned

XRPL's native transaction types are more powerful than we expected. MPTs, escrows, conditional payments, micropayments, and RLUSD all work without a smart contract language, with no gas fees and 3-5 second finality. You can model real equity instruments natively.

Prediction markets are only useful when participants have real information. The AI agent is what makes the crowd pricing meaningful. Without it, the market is just noise.

Cross-chain state management is hard. Linking assets across XRPL and Base Sepolia required careful thought about ordering, finality, and what happens when one chain confirms but the other hasn't yet.

What's Next

Secondary trading of SAFE MPTs on XRPL DEX, real revenue ingestion via Stripe Connect, mainnet deployment with live RLUSD flows, expanded social scoring beyond GitHub, and multi-round support with dilution modeling on-chain.

Built With

TypeScript, Next.js, Express, Claude API, xrpl.js, XRPL MPT, XRPL Escrows, RLUSD, MetaLex, Base Sepolia, Octokit, Polymarket, Redis, Mintlify

Links

Built With

Share this project:

Updates