Track Position (TP/SL) logo

Built-in action Built In

After a swap, create a position group with a filled buy order and optional take-profit / stop-loss sell orders. Entry cost is auto-converted to USD (USDC). The platform monitors and auto-sells when thresholds are hit.

At a Glance

FieldValue
Action IDtrack-position
CategoryBuilt In
ConnectorNot required
Requires gasNo
Funds movementNone declared
Tagstrading, order, take-profit, stop-loss, tp-sl, defi, swap, polymarket, perp, hyperliquid, position

Payload Schema

FieldTypeRequiredDescription
walletIdstringYesWallet ID that holds the position tokens.
chainIdnumberYesChain ID where the token was bought.
assetAddressstringYesContract address of the asset you bought (token, conditional token, etc.).
entryCoststringYesBigInt: amount of quote token spent (from swap/bet result).
entryAmountstringYesBigInt: amount of asset received (from swap/bet result).
entryTxHashstringYesTransaction hash of the buy/entry.
tpMultipliernumberNoTake-profit multiplier (e.g., 2.0 = sell when worth 2x entry cost).
slMultipliernumberNoStop-loss multiplier (e.g., 0.5 = sell when worth 50% of entry cost).
labelstringNoDisplay name for the position (e.g., 'DEGEN', 'Trump YES').
quoteTokenstringNoContract address of what you paid with. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
assetDecimalsnumberNoToken decimals (default: 18).
metadataobjectNoProtocol-specific data (e.g., Polymarket marketId, conditionId, outcome).
sellToTokenstringNoContract address of the token to receive on sell. Defaults to USDC.
positionTypestringNoPosition type. Defaults to 'dex'.

Result Schema

FieldTypeRequiredDescription
groupIdstringYesUnique ID of the order group. Use to query order status via API.
ordersarrayYesList of created orders (filled buy + optional TP/SL sell orders).

Examples

json
{ "type": "track-position", "payload": { "walletId": "0x0000000000000000000000000000000000000000", "chainId": 8453, "assetAddress": "0x0000000000000000000000000000000000000000", "entryCost": "example-entryCost", "entryAmount": "1000000", "entryTxHash": "example-entryTxHash" }, "children": []}

Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.

Ask a question... ⌘I