Skip to main content
GET
/
market
/
{marketAddress}
/
tokensToUsd
Calculate tokens to USD conversion
curl --request GET \
  --url https://mainnet.base.org/market/{marketAddress}/tokensToUsd
{
  "tokensOut": 123,
  "usdOut": 123
}
This is a smart contract view 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

Query Parameters

tokensIn
integer
required

Tokens in (positive when selling Based, negative when selling Cringe)

Response

200 - application/json

Conversion calculated successfully

tokensOut
integer

Tokens out from AMM

usdOut
integer

USD received by user

I