POST
/
api
/
trades
curl --request POST \
  --url https://hyperrich.fun/api/trades \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "<string>",
  "tokenId": "<string>",
  "type": "buy",
  "tokenAmount": 123,
  "usdcAmount": 123,
  "feeTxHash": "<string>",
  "transferTxHash": "<string>",
  "isCustodial": true
}'
{
  "success": true,
  "tradeId": "123e4567-e89b-12d3-a456-426614174000"
}

Body

application/json
userId
string
required

The ID of the user creating the trade

tokenId
string
required

The ID of the token being traded

type
enum<string>
required

The type of trade

Available options:
buy,
sell
isCustodial
boolean
required

Whether this is a custodial wallet trade

tokenAmount
number

The amount of tokens to trade (required for sell orders)

usdcAmount
number

The amount of USDC to trade (required for buy orders)

feeTxHash
string

Transaction hash for the fee payment

transferTxHash
string

Transaction hash for the transfer

Response

200
application/json
Trade successfully created
success
boolean
Example:

true

tradeId
string

Unique identifier for the created trade

Example:

"123e4567-e89b-12d3-a456-426614174000"