> For the complete documentation index, see [llms.txt](https://mimic-api.gitbook.io/mimic-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mimic-api.gitbook.io/mimic-api-docs/swap/stop-loss/stop-loss-id-execute.md).

# /stop-loss/{id}/execute

Submit the signature of the data obtained from `POST /stop-loss/prepare` to create the stop-loss strategy that monitors a token's exchange rate and swaps it once it falls to or below a threshold. Call this before the `signBefore` deadline returned by `POST /stop-loss/prepare`. Past it the payload is no longer accepted. Track the execution via `GET /stop-loss/{id}`.

```json
{"openapi":"3.1.0","info":{"title":"Mimic API","version":"0.0.1-rc"},"tags":[{"name":"Stop loss","description":"Monitor a token's exchange rate and swap it once it falls to or below a threshold. Compute EIP-712 data to sign via `POST /stop-loss/prepare`, then submit the signature via `POST /stop-loss/{id}/execute`."}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for your Mimic account. Required for every operation except the public reference-data endpoints."}},"parameters":{"ActionId":{"name":"id","in":"path","required":true,"description":"ID returned by `POST /{action}/prepare`.","schema":{"$ref":"#/components/schemas/UUID"}}},"schemas":{"UUID":{"type":"string","format":"uuid","description":"Identifier for an action request, returned by `POST /{action}/prepare` and used to submit its signature and track its status."},"TriggerSignature":{"type":"object","description":"An EIP-712 signature over a TriggerSignaturePayload, submitted to authorize execution.","required":["typedData","sig","signer"],"properties":{"typedData":{"type":"object","required":["types","values"],"properties":{"types":{"$ref":"#/components/schemas/TriggerTypes"},"values":{"$ref":"#/components/schemas/TriggerTypedDataValues"}}},"sig":{"allOf":[{"$ref":"#/components/schemas/Signature"}],"description":"EIP-712 signature over `typedData` by `signer`."},"signer":{"$ref":"#/components/schemas/Address"}}},"TriggerTypes":{"type":"object","required":["Input","Config","Trigger"],"description":"EIP-712 type definitions for the trigger's typed data.","properties":{"Input":{"type":"array","items":{"$ref":"#/components/schemas/TypedDataField"}},"Config":{"type":"array","items":{"$ref":"#/components/schemas/TypedDataField"}},"Trigger":{"type":"array","items":{"$ref":"#/components/schemas/TypedDataField"}}}},"TypedDataField":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string"},"type":{"type":"string","description":"Solidity type or a custom type (`Token`, `TokenAmount`)."}}},"TriggerTypedDataValues":{"type":"object","required":["functionCid","version","input","config","executionFeeLimit","minValidations"],"properties":{"functionCid":{"$ref":"#/components/schemas/CID"},"version":{"$ref":"#/components/schemas/SemVer"},"input":{"type":"object","description":"Key-value map matching the function's manifest input schema."},"config":{"$ref":"#/components/schemas/TriggerConfig"},"executionFeeLimit":{"allOf":[{"$ref":"#/components/schemas/BigInteger"}],"description":"Maximum fee (in protocol units) the signer accepts per execution."},"minValidations":{"type":"integer","description":"Minimum number of validator confirmations required."}}},"CID":{"type":"string","description":"An IPFS content identifier (CIDv0 or CIDv1 base32)."},"SemVer":{"type":"string","description":"A semantic version string."},"TriggerConfig":{"description":"Trigger schedule configuration. Discriminated by the integer `type` field: `0` → CronTriggerConfig, `1` → EventTriggerConfig, `2` → OnceTriggerConfig.\n","oneOf":[{"$ref":"#/components/schemas/CronTriggerConfig"},{"$ref":"#/components/schemas/EventTriggerConfig"},{"$ref":"#/components/schemas/OnceTriggerConfig"}]},"CronTriggerConfig":{"type":"object","required":["type","schedule","delta","endDate"],"properties":{"type":{"type":"integer","enum":[0]},"schedule":{"$ref":"#/components/schemas/CronExpression"},"delta":{"type":"string","description":"A time delta string."},"endDate":{"$ref":"#/components/schemas/Timestamp"}}},"CronExpression":{"type":"string","title":"Cron expression (UTC)","description":"A standard 5-field cron expression, in order: minute, hour, day of month, month, day of week. Evaluated in UTC."},"Timestamp":{"type":"integer","title":"Unix timestamp (ms)","description":"Unix timestamp in milliseconds."},"EventTriggerConfig":{"type":"object","required":["type","chain","contract","topics","delta","endDate"],"properties":{"type":{"type":"integer","enum":[1]},"chainId":{"$ref":"#/components/schemas/ChainId"},"contract":{"description":"Contract address to filter events from, or `\"any\"` for any contract.","oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"string","enum":["any"]}]},"topics":{"type":"array","description":"Array of 1–4 topic groups. Each group is an OR filter; groups are AND-combined.\n","minItems":1,"maxItems":4,"items":{"type":"array","items":{"$ref":"#/components/schemas/HexString"}}},"delta":{"type":"string","description":"Time delta after the event before execution fires."},"endDate":{"$ref":"#/components/schemas/Timestamp"}}},"ChainId":{"type":"integer","description":"Numeric EVM chain ID. Used only inside raw transactions and on-chain trigger payloads that must be signed with it; elsewhere the API identifies chains by `Chain`."},"Address":{"type":"string","description":"A valid address on the relevant chain. Format depends on the chain: 0x-prefixed 20-byte hex for EVM chains, base58 for other chains (e.g. Solana, Tron)."},"HexString":{"type":"string","description":"An arbitrary 0x-prefixed hex string."},"OnceTriggerConfig":{"type":"object","required":["type","startDate","delta","endDate"],"properties":{"type":{"type":"integer","enum":[2]},"startDate":{"$ref":"#/components/schemas/Timestamp"},"delta":{"type":"string","description":"Duration window; `endDate` must equal `startDate + delta`."},"endDate":{"$ref":"#/components/schemas/Timestamp"}}},"BigInteger":{"type":"string","description":"A non-negative integer represented as a string."},"Signature":{"type":"string","description":"A 65-byte hex-encoded ECDSA signature (130 hex chars + 0x prefix)."},"Error":{"type":"object","properties":{"message":{"type":"string"}}}},"requestBodies":{"SignatureSubmission":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signature"],"properties":{"signature":{"$ref":"#/components/schemas/TriggerSignature"},"signedApprovals":{"type":"array","description":"Signed and RLP-encoded `approve()` transactions authorizing the token spend needed for this action, matching `requiredApprovals` entry in `/prepare` response. Omit or leave empty when `requiredApprovals` was empty.","items":{"$ref":"#/components/schemas/HexString"}},"signedPolicies":{"type":"array","description":"EIP-712 signatures over the `policies` entries returned by `/prepare`, in the same order. Required whenever `policies` was not empty: without them the safeguards are never set and the request is rejected.","items":{"$ref":"#/components/schemas/Signature"}}}}}}}},"responses":{"SignatureSubmitted":{"description":"Signature submitted. Returned again when the same signature is resubmitted for this `id`, so a retry is always safe."},"BadRequest":{"description":"Bad request — invalid parameters or body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Unauthorized — missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"SignatureConflict":{"description":"Conflict — a different signature was already submitted for this `id`, or the signing window closed before this one arrived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/stop-loss/{id}/execute":{"post":{"tags":["Stop loss"],"description":"Submit the signature of the data obtained from `POST /stop-loss/prepare` to create the stop-loss strategy that monitors a token's exchange rate and swaps it once it falls to or below a threshold. Call this before the `signBefore` deadline returned by `POST /stop-loss/prepare`. Past it the payload is no longer accepted. Track the execution via `GET /stop-loss/{id}`.","parameters":[{"$ref":"#/components/parameters/ActionId","description":"ID returned by `POST /stop-loss/prepare`."}],"requestBody":{"$ref":"#/components/requestBodies/SignatureSubmission"},"responses":{"204":{"$ref":"#/components/responses/SignatureSubmitted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/SignatureConflict"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://mimic-api.gitbook.io/mimic-api-docs/swap/stop-loss/stop-loss-id-execute.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
