Skip to main content
POST
/
market
/
{marketAddress}
/
buy
Buy position in market
curl --request POST \
  --url https://mainnet.base.org/market/{marketAddress}/buy \
  --header 'Content-Type: application/json' \
  --data '{
  "beneficiary": "<string>",
  "amount": 2,
  "isBased": true,
  "minAmountReceived": 1
}'
{
  "transactionHash": "<string>",
  "blockNumber": 123,
  "gasUsed": 123,
  "success": true
}
This is a smart contract write function. The curl example shown is for illustration. To call this function, use web3 libraries (ethers.js, viem, web3.py) or JSON-RPC directly.

Path Parameters

marketAddress
string
required

Address of the market contract

Body

application/json
beneficiary
string
required

Address that will receive the position

amount
integer
required

USD amount to buy (settlement token units)

Required range: x >= 1
isBased
boolean
required

Whether to buy Based (true) or Cringe (false)

minAmountReceived
integer
required

Minimum position size to receive (slippage protection)

Required range: x >= 0

Response

Position bought successfully

transactionHash
string

Transaction hash

blockNumber
integer

Block number where transaction was mined

gasUsed
integer

Amount of gas used

success
boolean

Whether transaction was successful

I