com um clique
limit-order
Place a limit order that polls quotes and executes at a target price
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Place a limit order that polls quotes and executes at a target price
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
| name | limit-order |
| description | Place a limit order that polls quotes and executes at a target price |
| allowed-tools | ["Bash(tm *)"] |
| license | MIT |
Place a limit order by polling quotes in a loop and executing when the price reaches a target threshold.
go install github.com/true-markets/cli/cmd/tm@latesttm signup user@email.com (creates account, wallet, and API key in one step)Ask the user (or extract from their message) for:
buy or sellIf any required parameter is missing, ask with AskUserQuestion.
Instead of polling with dry-run quotes, you can monitor the price via the streaming WebSocket feed:
tm price <token> --stream -o json
This outputs newline-delimited JSON with live price updates. Parse each line and compare against the target price. When the target is reached, stop the stream and run a --dry-run quote to confirm the current execution price before trading. Do not execute a trade based solely on the stream price — always verify with a fresh dry-run quote first.
Run a dry-run to show the current market price:
tm <side> <token> <amount> -o json --dry-run
Parse the JSON output. Compute the current effective price:
price = qty / qty_out (USDC per token)price = qty_out / qty (USDC per token)Display to the user:
Ask the user to confirm before starting the loop. If they decline, stop.
Run the following bash loop. Use a timeout of 600000 (10 minutes max).
The loop logic (as a bash script):
SIDE="<side>"
TOKEN="<token>"
AMOUNT="<amount>"
TARGET="<target_price>"
INTERVAL=<poll_interval>
echo "Limit order active: $SIDE $AMOUNT of $TOKEN at target price \$$TARGET per token"
echo "Polling every ${INTERVAL}s. Press Ctrl+C to cancel."
echo ""
while true; do
QUOTE=$(tm $SIDE $TOKEN $AMOUNT -o json --dry-run 2>/dev/null)
if [ $? -ne 0 ]; then
echo "[$(date '+%H:%M:%S')] Quote failed, retrying..."
sleep $INTERVAL
continue
fi
QTY=$(jq -r '.qty' <<< "$QUOTE")
QTY_OUT=$(jq -r '.qty_out' <<< "$QUOTE")
ISSUES=$(jq '.issues | length' <<< "$QUOTE")
if [ "$SIDE" = "buy" ]; then
PRICE=$(echo "$QTY $QTY_OUT" | awk '{printf "%.6f", $1 / $2}')
HIT=$(echo "$PRICE $TARGET" | awk '{print ($1 <= $2) ? "yes" : "no"}')
else
PRICE=$(echo "$QTY_OUT $QTY" | awk '{printf "%.6f", $1 / $2}')
HIT=$(echo "$PRICE $TARGET" | awk '{print ($1 >= $2) ? "yes" : "no"}')
fi
echo "[$(date '+%H:%M:%S')] Price: \$$PRICE | Target: \$$TARGET | Hit: $HIT"
if [ "$HIT" = "yes" ]; then
if [ "$ISSUES" != "0" ]; then
echo "Price target reached but quote has issues. Retrying..."
sleep $INTERVAL
continue
fi
echo ""
echo "Target price reached! Executing trade..."
RESULT=$(tm $SIDE $TOKEN $AMOUNT -o json --force 2>&1)
echo "$RESULT"
echo ""
echo "Limit order complete."
break
fi
sleep $INTERVAL
done
Important rules:
<side>, <token>, <amount>, <target_price>, <poll_interval>.; or use a heredoc).Parse the trade result JSON and report: