Skip to main content
POST
/
router
/
sell
Sell position through router
curl --request POST \
  --url https://mainnet.base.org/router/sell \
  --header 'Content-Type: application/json' \
  --data '{
  "marketAddress": "<string>",
  "amount": 2,
  "isBased": true,
  "minAmountReceived": 1,
  "deadline": 123
}'
{
  "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.

Body

application/json
marketAddress
string
required

Address of the market

amount
integer
required

Size of position to sell

Required range: x >= 1
isBased
boolean
required

Whether selling Based (true) or Cringe (false) position

minAmountReceived
integer
required

Minimum amount of USD to receive

Required range: x >= 0
deadline
integer
required

Unix timestamp after which transaction will revert

Response

Position sold successfully through router

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