How to use our api

Endpoint for Manual Trading

Method: POST URL: https://api-prod.wl.bot/api/portfolio/handle/execute

This endpoint allows you to manually buy or sell tokens in the system.


πŸ“€ Request Body Parameters

Parameter
Type
Required
Description

token_address

string

βœ… Yes

The address of the token you want to operate with.

token_pool

string

❌ No

The liquidity pool address. If omitted, the system will select the most liquid one automatically.

amount

float/int

βœ… Yes

For BUY: the amount in SOL. For SELL: percentage from 1 to 100.

type

string

βœ… Yes

The operation type. Use BUY for purchases or SELL_PERCENTAGE for selling a percentage of your holdings.


πŸ›’ Example: Buy Token

Request:

POST https://api-prod.wl.bot/api/portfolio/handle/execute

Headers:

Authorization: Bearer jwttoken.example...
Content-Type: application/json

Body:

{
  "token_address": "J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr",
  "amount": 0.00001,
  "type": "BUY"
}

Description: This request buys the token J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr for 0.00001 SOL.


πŸ’Έ Example: Sell Token

Request:

POST https://api-prod.wl.bot/api/portfolio/handle/execute

Headers:

Authorization: Bearer jwttoken.example...
Content-Type: application/json

Body:

{
  "token_address": "J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr",
  "amount": 50,
  "type": "SELL_PERCENTAGE"
}

Description: This request sells 50% of the held amount of the token J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr.


⚠️ Important Notes

  • When buying, the amount must be in SOL.

  • When selling, the amount must be a percentage between 1 and 100.


πŸ” JWT Token Refresh

When your current JWT token expires, you must obtain a new one using the token refresh endpoint.


πŸ”„ Token Refresh Endpoint

Method: GET URL: https://api-prod.wl.bot/api/auth/token/refresh

Headers:

Authorization: Bearer your_current_jwt_token

βœ… Example Request

GET https://api-prod.wl.bot/api/auth/token/refresh
Authorization: Bearer jwttoken.example...

🟒 Example Response

{
  "token": "new_valid.jwt.token"
}

⚠️ Warning

If you do not refresh your token in time, you will receive a 401 Unauthorized error when making requests.

Last updated

Was this helpful?