Calculators
Gain-to-target / target price API
Percent move to a target: gainPct = (target/entry − 1)·100, or the price for a desired gain: target = entry·(1+gainPct). Deterministic percentage math. Answers 'what gain to reach 150','target price for a 25% move','percent move from entry to target'.
Price$0.01per request
MethodPOST
Route/v1/calc/trade-gain-to-target
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calctradingtargetgainpercentprice-targetreturnlevels
API URL
Integration docshttps://x402.hexl.dev/v1/calc/trade-gain-to-targetExample request
{
"entry": 100,
"target": 150
}Example response
{
"entry": 100,
"target": 150,
"gainPct": 50,
"direction": "up",
"formula": "gainPct = (target/entry − 1)·100"
}Input schema
{
"type": "object",
"required": [
"entry"
],
"properties": {
"entry": {
"type": "number",
"examples": [
100
]
},
"target": {
"type": "number",
"description": "Target price — returns the gain%.",
"examples": [
150
]
},
"desiredGainPct": {
"type": "number",
"description": "Desired gain% — returns the target price.",
"examples": [
25
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}