Positions

View and sync user positions in prediction markets.

Get Position

Returns a user's position in a specific market by market contract address.

GET /api/v1/positions/{marketAddress}

Path Parameters

ParameterTypeDescription
marketAddressaddressMarket contract address

Query Parameters

ParameterTypeRequiredDescription
useraddressYesUser's wallet address

Response

{
  "yesShares": 50000000,
  "noShares": 0,
  "totalInvested": 25000000,
  "yesCost": 25000000,
  "noCost": 0
}
FieldTypeDescription
yesSharesint64YES token balance (6 decimals). 50000000 = 50 shares
noSharesint64NO token balance (6 decimals)
totalInvestedint64Total USDC invested (6 decimals). 25000000 = $25
yesCostint64Cost basis for YES position
noCostint64Cost basis for NO position
If no position exists, returns `{"yesShares": 0, "noShares": 0}`.

Example

curl "https://api.turbinefi.com/api/v1/positions/0xMarketContract?user=0xYourAddress"

Sync Position

Force-sync a user's position from on-chain CTF token balances. Useful when positions are out of sync with the blockchain.

POST /api/v1/positions/{marketId}/sync

Path Parameters

ParameterTypeDescription
marketIdbytes32Market identifier

Request Body

The userAddress can also be passed as a query parameter instead of in the body.

FieldTypeRequiredDescription
userAddressaddressYesUser address to sync

Response

Returns 503 Service Unavailable if blockchain sync is not available on the server.

Example

curl -X POST "https://api.turbinefi.com/api/v1/positions/0x1234...abcd/sync" \
  -H "Content-Type: application/json" \
  -d '{"userAddress": "0xYourAddress"}'

Get All User Positions

Returns all positions for a user across all markets on a specific chain.

GET /api/v1/users/{address}/positions

Path Parameters

ParameterTypeDescription
addressaddressUser's wallet address

Query Parameters

ParameterTypeRequiredDescription
chain_idintegerYesChain ID (e.g., 137)

Response

FieldTypeDescription
marketIdstringMarket identifier
marketQuestionstringMarket question
contractAddressstringMarket contract address
yesSharesint64YES token balance (6 decimals)
noSharesint64NO token balance (6 decimals)
totalInvestedint64Total USDC invested (6 decimals)
expirationint64Market expiration timestamp
resolvedboolWhether the market has been resolved

Example

curl "https://api.turbinefi.com/api/v1/users/0xYourAddress/positions?chain_id=137"