Skip to main content
POST /api/v1/market/add-liquidity
Auth required: Yes Adds base token liquidity to a prediction market’s Automated Prediction Market Maker (APMM) pool. Liquidity providers earn a share of trading fees proportional to their pool share.

Request Body

marketAddress
string
required
Prediction market contract address.
amount
string
required
Amount of base tokens to deposit (e.g., "50000000" = 50 USDC).
minLpAmount
string
required
Minimum LP tokens to receive. Reverts if actual LP tokens minted are below this. Protects against unfavorable pool ratios.
deadline
string
required
Unix timestamp. Transaction reverts if not executed before this time.
userOperation
object
required
Signed ERC-4337 UserOperation. See Buy Tokens for full UserOperation field documentation.

Example

curl -X POST "https://api-staging.promethex.market/api/v1/market/add-liquidity" \
  -H "Authorization: Bearer $PRIVY_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "marketAddress": "0x1234...abcd",
    "amount": "50000000",
    "minLpAmount": "49000000",
    "deadline": "1740000000",
    "userOperation": {
      "sender": "0x...",
      "nonce": "0x...",
      "initCode": "0x",
      "callData": "0x...",
      "callGasLimit": "0x...",
      "verificationGasLimit": "0x...",
      "preVerificationGas": "0x...",
      "maxFeePerGas": "0x...",
      "maxPriorityFeePerGas": "0x...",
      "paymasterAndData": "0x...",
      "signature": "0x..."
    }
  }'

Response

{
  "code": 0,
  "data": {
    "opHash": "0xAddLiqOpHash..."
  }
}
opHash
string
UserOperation hash for the liquidity deposit transaction.

How Liquidity Works

The APMM pool uses deposited liquidity to facilitate trades. When users buy or sell outcome tokens, the pool adjusts prices algorithmically.
AspectDetail
Fee shareLP providers earn a pro-rata share of trading fees
Impermanent lossPossible if market prices move significantly
WithdrawalLP tokens can be redeemed via Remove Liquidity
SettlementAfter market settles, remaining liquidity is returned to LPs
Liquidity can only be added to markets in running status. Adding liquidity to settled markets is not supported.