Skip to main content
Glama

optimize_tp_sl

TP CONFIG: searches the best take-profit / stop-loss pair to copy a wallet (25 exits: 24 targets from +20% to +1000% and no TP, x 7 stops: none, -20, -30, -40, -50, -60, -70%), with the engine of the wallet page on quantbloc.com (TP CONFIG tab), same settings and same defaults. Original walk-forward (Pardo): the period is cut into 4 quarters; at each step the best setting is chosen on the quarters already passed and tested on the next one (walk_forward: the sum of the tests is the honest figure); the recommended setting is then chosen on ALL trades. Results computed before 16/10/2026 have no walk_forward: their setting was chosen on quarters 1 to 3 and judged on quarter 4. Returns the full grid of 175 settings, the recommended one, the best raw one, and the token-by-token detail of the recommended one. jamais = what to do when the target is never reached: vente = copy its sells (mode ventes), delai = sell delai_min minutes after the buy. Optional dev settings (dev_vendu_min_pct, dev_present, dev_vente_seuil_pct + dev_vente_vendre_pct): The dev = the wallet that SIGNS the token creation transaction and buys in it (if the creation has no buy, the registered creator; buys of OTHER transactions of the creation block are never attributed to the dev). Optional entry/exit settings: hausse_max_pct, age_min_s / age_max_s, heure_debut / heure_fin, premiere_vente_pct (see each parameter); refused buys do not depend on the TP/stop setting. ASYNCHRONOUS: the first call starts the computation and returns etat=en_cours with estimation_restante_s (estimated seconds left); call again with EXACTLY the same parameters to get etat=pret (ready). etat=file = yours is queued (raison_attente says why, attente_estimee_s when it should start), call again later. A result already computed (on the site or here) is returned without recomputing and does not count against the limit. There is NO limit on the number of backtests: the only limit is the account's token budget, shared with the website (etat=limite_jour says when it is reached). One computation runs at a time per key (backtest and TP/SL optimisation alike): while one is running, wait for it to finish (call it again with its parameters), then start the next one; this is not a quota. Amounts in dollars, net of all fees at the tout_compris level.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "adresse": "<adresse>"
    },
    "name": "optimize_tp_sl"
  }
}

Input Schema

NameRequiredDescriptionDefault
blocNoCopier entry: end of block 0, +1 or +2 after the wallet's buy (default 0, like the wallet page)
jitoNoJito tip in $ per transaction (default 0.03; 0 to 10)
miseNoFixed stake in $ per copied buy (default 30, max 10,000)
pageNoPage of the token-by-token detail
prioNoPriority fee in $ per transaction (default 0.11; 0 to 10)
achatNoachete = copy its buys (default); cree = buy the tokens it creates
depuisNoStart of the window, YYYY-MM-DD, UTC, included (default: 30 days ago)
jamaisNoIf the target is never reached: vente (default, copy its sells) or delai (sell delai_min minutes after the buy, default 30)
jusquaNoEnd of the window, YYYY-MM-DD, UTC, EXCLUDED (default: tomorrow; "from the 22nd to the 25th" = depuis 22, jusqua 26). Capped at tomorrow.
lancerNofalse = only return what is already computed, never start a computation (default true)
ventesNoHow its sells are copied: pct_sa_position (default) = sell the same % of my position as it sells of its own; pct_ma_position = sell my whole position at its first sell; pct_sa_vente = sell the same $ amount as it does; fixe = a fixed $ amount per sell (see vente_usd); none = never copy its sells
adresseYesFull wallet address (base58)
mc_max_kNoMaximum market cap at our entry, in thousands of $ (empty = none)
mc_min_kNoMinimum market cap at our entry, in thousands of $ (empty = none)
mise_pctNoStake as a % of ITS stake (replaces mise; 0 < x <= 1000)
par_pageNoRows of the token-by-token detail (default 100, max 200)
age_max_sNoBuy only if the token is at most X seconds old at HIS buy (same age as age_min_s; age_min_s <= age_max_s).
age_min_sNoBuy only if the token is at least X seconds old at HIS buy (block time of his buy minus block time of the creation block, bounds included; 0 to 31622400; empty = no filter). Token created before our block archive (10/09/2026): its age is at least the time since the archive start; the buy passes age_min_s when that lower bound already reaches it (counted as age_borne_basse), is refused by age_max_s when the bound exceeds it, otherwise it is refused as unknown. Unknown age = buy refused (counted).
delai_minNoSell X minutes after the copied buy (default 0 = never; max 10,080). TP CONFIG: used only with jamais=delai, default 30
heure_finNoBuy only if HIS buy is before this time of day, HH:MM, Paris time (empty = until 24:00)
perte_maxNoOptional maximum loss accepted, in $ (0 < x <= 10,000,000): the answer adds `limite`, the best setting whose biggest drop (trade by trade) stays within it, checked on the value curve over time; aucun=true if no setting does. Empty = no limit (the recommended setting does not change). Not together with pertes_affilee_max.
vente_usdNoAmount sold in $ per sell when ventes=fixe (default 30)
max_achatsNoCopied buys of the wallet PER TOKEN (default 1 = only its first buy on each token; 0 = all, max 1000). Not a limit on the number of backtests
dev_presentNotrue = buy only if the dev still holds the token before our entry block; false = only if he holds nothing (empty = no filter). Token transfers count here (tokens that left his wallet). The dev = the wallet that SIGNS the token creation transaction and buys in it (if the creation has no buy, the registered creator; buys of OTHER transactions of the creation block are never attributed to the dev).
heure_debutNoBuy only if HIS buy is at or after this time of day, HH:MM, Paris time, block time (empty = from 00:00). With heure_fin: window [heure_debut, heure_fin[, across midnight if heure_debut > heure_fin; both equal is refused.
delai_achat_sNoWait X seconds before buying (default 0; max 3600)
commission_pctNoCopy bot commission in % (default 0.5; 0 to 50)
hausse_max_pctNoDo not buy if OUR entry price is more than X% above HIS price right after his own buy (0 to 10000; empty = no filter). His price after = the chain reserves after his transaction, else the bonding-curve formula on his trade; when it is unknown the buy is refused (counted as refuses_hausse_inconnue).
dev_vendu_min_pctNoBuy only if the dev has ALREADY taken out at least X% of his position before our entry block (0 to 100; empty = no filter). A dev who never held the token does not pass, even at 0. The dev = the wallet that SIGNS the token creation transaction and buys in it (if the creation has no buy, the registered creator; buys of OTHER transactions of the creation block are never attributed to the dev).
pertes_affilee_maxNoOptional, instead of perte_max: maximum number of losing trades in a row accepted (integer 1 to 1000). The answer adds `limite`, the best setting whose longest losing streak (trades in their real order; a trade at 0.00 $ neither counts nor breaks the streak) stays within it; aucun=true if no setting does. Giving both perte_max and pertes_affilee_max is refused.
premiere_vente_pctNoAt HIS first sell after our first copied buy, sell X% of OUR position (0 < x <= 100) instead of the `ventes` rule; later sells follow `ventes` (none = no other sell is followed). A sell triggered by the dev is never his first sell.
dev_vente_seuil_pctNoExit: when the dev SELLS at least X% of his position in one transaction (0 = his smallest sell; 0 to 100), sell dev_vente_vendre_pct% of ours, at the price rule of copied sells. A token transfer is NOT a sell and never triggers it. Goes with dev_vente_vendre_pct. The dev = the wallet that SIGNS the token creation transaction and buys in it (if the creation has no buy, the registered creator; buys of OTHER transactions of the creation block are never attributed to the dev).
dev_vente_vendre_pctNoShare of OUR position sold when dev_vente_seuil_pct triggers (0 < x <= 100)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so thoroughly: it discloses the asynchronous state machine, the queue (raison_attente, attente_estimee_s), that cached results are returned without recomputation and don't count against limits, that there is no backtest quota but a shared account token budget (etat=limite_jour), and that only one computation runs per key at a time. It also flags a data caveat: results computed before 16/10/2026 lack walk_forward because their setting was picked on quarters 1-3 and judged on quarter 4.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the walk-forward and async explanations earn their place, but the paragraph is an unusually dense run-on mixing English and French tokens, and it duplicates schema content, e.g. re-defining jamais and re-listing optional entry/exit parameters with 'see each parameter'. The 'dev = the wallet that SIGNS...' definition is repeated verbatim across the definition. It is informative but not efficiently packaged.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, 33-parameter optimization tool with no output schema, the description covers the essentials: what is returned (the full 175-setting grid, the recommended setting, the best raw setting, and the token-by-token detail of the recommended one), how the async flow works, and what the limits are. Small gaps remain, such as error-state behavior and the date-formatted caveat being easy to misread.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and 33 parameters are individually documented in the schema, so the baseline is 3. The description adds methodology and output context (walk-forward quarters, the 175-setting grid, the recommended vs best-raw distinction) and one genuine semantic note, that refused buys do not depend on the TP/stop setting, but it largely restates schema-covered definitions such as jamais and the dev rule.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: it searches the best take-profit / stop-loss pair for copying a wallet, and it quantifies the search space (25 exits x 7 stops = 175 settings) and the walk-forward methodology. That is far clearer than a generic 'optimize' label. It stops short of naming the sibling backtest_wallet as an alternative, only alluding to it via 'backtest and TP/SL optimisation alike', so sibling differentiation is implied rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The context for using it is implied: you use it when you want the best TP/SL pair for a wallet rather than a single fixed configuration. The description gives a strong, explicit invocation protocol for the async job ('call again with EXACTLY the same parameters', etat=file/pret/en_cours/limite_jour handling, lancer=false for cache-only reads). What it never states is when to prefer this over backtest_wallet, or any exclusion case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources