POST
/
updateTradingSettings
/
{chain}
Update User Trading Settings
curl --request POST \
  --url http://localhost:2400/updateTradingSettings/{chain} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "slippage": 2,
  "gasPreset": "fast",
  "mevProtection": false
}'
{
  "userID": "user-123",
  "slippage": 2,
  "gasPreset": "fast",
  "maxGasPrice": 100,
  "mevProtection": false,
  "autoBuy": false,
  "autoSell": false,
  "_id": "settingsId...",
  "createdAt": "2023-03-15T10:00:00.000Z",
  "updatedAt": "2023-03-19T14:00:00.000Z"
}

Notes

  • This endpoint is handled by the User server (Port 5000).
  • Updates data in the appropriate settings collection (EthereumTradingSettings, BaseTradingSettings, or SolanaTradingSettings).
  • Uses findOneAndUpdate with { new: true, upsert: true } to update existing settings or create them if they don’t exist for the user.
  • Emits a TradingSettingsUpdated event via Socket.IO to notify connected clients of the change.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

chain
enum<string>
required

The blockchain network ('eth', 'base', 'sol').

Available options:
eth,
base,
sol

Body

application/json

Payload to update trading settings. Include only the fields to be changed.

Response

200
application/json

Successful update of trading settings.

The response is of type object.