Quickstart

The six-step integration path. Authenticate, list markets, quote, open, monitor, close.

Start in sandbox. Same API, same contract, fake USDC. Swap api.dimes.fi for api-sandbox.dimes.fi and use a dm_sbx_skey_... key — every example below works as-is. Working reference: dimes-demo-uiarrow-up-right.

Using the SDK? Install it first: npm install @dimes-dot-fi/sdk. See SDK Installation for setup details and peer dependencies.


1. Authenticate

curl -X POST https://api.dimes.fi/v1/prediction-markets/tokens \
  -H "Authorization: Api-Key dm_live_skey_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "wallet_address": "0x1234...abcd" }'
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expires_at": "2026-04-16T11:00:00.000Z"
}

JWTs expire in 1 hour. Full details: Authentication.


2. List markets

curl https://api.dimes.fi/v1/prediction-markets/markets

Response includes leverage.min_bps, max_bps, and step_bps per market — clamp your input to those. Full shape: API Reference — Markets.


3. Request a quote

The response carries pricing, fees, liquidation parameters, and a contract_signature for the on-chain call. Full shape and signature verification: API Reference — Quotes.

Better UX with draft + promote: Quotes expire in 15 seconds. For a smoother flow, call /draft-quotes first (no expiry), let the user review, then /promoted-quotes/{draft_quote_id} when they're ready. See API Reference — Promote draft quote.


4. Open the position

Two on-chain calls: USDC.approve(vault, total_user_amount) then vault.createPosition(...) with the quote parameters. After the tx confirms, Multiply acquires tokens, finalizes on-chain, and emits position.opened.

Code examples for Polymarket Safe, Proxy, and Deposit Wallet patterns: On-Chain Integration.


5. Monitor positions

Each position carries current P&L, mark price, margin health, liquidation price, and accrued fees. Display rules: UI Guidelines.


6. Close

The owner calls vault.requestClose(position_key). Multiply sells tokens, distributes proceeds, emits position.closed. If the market resolves first, settlement is automatic.


What's next

Need help? Telegram link at dimes.fiarrow-up-right.

Last updated