Getting Started
Getting Started
We'll walk through how to start diving in.
2
min read
2
min read
Create a Market (Permissionless)
Any developer or user can create a market. Creation always spawns both a Probability Market and its paired Reality Market.
Requirements
To initialize a market, the following parameters are required:
Domain:
[L, U](Lower and Upper bounds)Precision: How many decimal points you require on the numerical range
Bernstein Degree: Complexity of the curve
Liquidity Seed: Minimal seed to ensure market viability
Developer Controls
Developers have flexibility to decide:
Whether users can create markets directly.
Whether to host the resolution mechanism.
Which markets to surface in the UI.
Fee structures (application or charges).
Interaction levels (full, partial, or read-only).
Accept Trades
Users express a belief curve through any UI. The system converts this input into a Bernstein coefficient vector p.
Implementation Example
import { FunctionSpaceSDK, DistributionType } from '@functionspace/sdk'; // 1. Initialize SDK (connects to the user's wallet) const fs = new FunctionSpaceSDK(window.wallet); // 2. Define the Trade Parameters using explicit Bernstein coefficients const tradeParams = { marketAddress: "0xMarketContractAddress...", collateralAmount: "1000.0", // 1000 USDC belief: { type: DistributionType.Bernstein, // Explicitly defining the vector // The vector 'p' representing the weights of the curve. // These are the control points that define the PDF shape. // The SDK will automatically normalize these to sum to 1. p: [ 0.05, // Weight at the lower bound 0.10, 0.40, // Peak of belief 0.40, // Plateau 0.05 // Weight at the upper bound ] } }; // 3. Execute the Trade // The SDK handles normalization, fixed-point conversion, and transaction signing. const txHash = await fs.trade.buy(tradeParams);
Engine Execution
Once the trade is submitted, the engine performs the following:
Updates the alpha vector (α).
Computes delta via the Dirichlet Potential.
Mints information claims as NFTs.
Updates the public consensus distribution.
Sell
Traders can exit positions early or claim payouts by:
Hand in NFT: User submits their position NFT.
Receive Valuation: The system calculates the current value based on the dynamic parimutuel state.
Action Position: User receives the payout.
Properties:
Slippage settings are available.
Off-chain calculations are available for pre-determining position value before execution.
Settlement
Settlement is triggered when the Reality Market publishes a single final valuex*.
The Probability Market settlement engine uses x* to:
Evaluate each belief curve’s density at
x*.Apply density thresholds.
Compute accuracy weights.
Combine with claim shares.
Redistribute the pool proportionally.
Note: Developers should periodically check for updates to consensus. Once a market has ended, distribution information will be published on-chain.
Create a Market (Permissionless)
Any developer or user can create a market. Creation always spawns both a Probability Market and its paired Reality Market.
Requirements
To initialize a market, the following parameters are required:
Domain:
[L, U](Lower and Upper bounds)Precision: How many decimal points you require on the numerical range
Bernstein Degree: Complexity of the curve
Liquidity Seed: Minimal seed to ensure market viability
Developer Controls
Developers have flexibility to decide:
Whether users can create markets directly.
Whether to host the resolution mechanism.
Which markets to surface in the UI.
Fee structures (application or charges).
Interaction levels (full, partial, or read-only).
Accept Trades
Users express a belief curve through any UI. The system converts this input into a Bernstein coefficient vector p.
Implementation Example
import { FunctionSpaceSDK, DistributionType } from '@functionspace/sdk'; // 1. Initialize SDK (connects to the user's wallet) const fs = new FunctionSpaceSDK(window.wallet); // 2. Define the Trade Parameters using explicit Bernstein coefficients const tradeParams = { marketAddress: "0xMarketContractAddress...", collateralAmount: "1000.0", // 1000 USDC belief: { type: DistributionType.Bernstein, // Explicitly defining the vector // The vector 'p' representing the weights of the curve. // These are the control points that define the PDF shape. // The SDK will automatically normalize these to sum to 1. p: [ 0.05, // Weight at the lower bound 0.10, 0.40, // Peak of belief 0.40, // Plateau 0.05 // Weight at the upper bound ] } }; // 3. Execute the Trade // The SDK handles normalization, fixed-point conversion, and transaction signing. const txHash = await fs.trade.buy(tradeParams);
Engine Execution
Once the trade is submitted, the engine performs the following:
Updates the alpha vector (α).
Computes delta via the Dirichlet Potential.
Mints information claims as NFTs.
Updates the public consensus distribution.
Sell
Traders can exit positions early or claim payouts by:
Hand in NFT: User submits their position NFT.
Receive Valuation: The system calculates the current value based on the dynamic parimutuel state.
Action Position: User receives the payout.
Properties:
Slippage settings are available.
Off-chain calculations are available for pre-determining position value before execution.
Settlement
Settlement is triggered when the Reality Market publishes a single final valuex*.
The Probability Market settlement engine uses x* to:
Evaluate each belief curve’s density at
x*.Apply density thresholds.
Compute accuracy weights.
Combine with claim shares.
Redistribute the pool proportionally.
Note: Developers should periodically check for updates to consensus. Once a market has ended, distribution information will be published on-chain.
functionSPACE
functionSPACE
Build
Overview
Tutorials
Documentation
Grants
Contribute
Community Hub
Events
Ambassador Program
Bug Bounty Program
Build
Overview
Tutorials
Documentation
Grants
Contribute
Community Hub
Events
Ambassador
Program
Bug Bounty
Program
functionSPACE
© 2025 All rights reserved
functionSPACE
© 2025 All rights reserved