TACO routes trades through a single trusted router. You can act in two ways: a market order you send yourself right now, or a signed limit / conditional order that a keeper executes later when your conditions are met.

Market orders

Market actions execute immediately in one transaction through the router’s *WithPriceUpdate entry points — opening, closing, adding collateral, reducing leverage, and liquidating, for both ordinary positions and margin accounts. On Pyth-backed markets these calls refresh the oracle in the same transaction:
  • The router reads the Pyth update fee, requires you to send at least that much ETH, updates the feed, then runs your action.
  • Any leftover ETH is refunded to you in the same transaction.
  • On push-based feeds (such as Chainlink) no update is needed; sending ETH there is rejected.
closePositionAndClaimWithPriceUpdate is a convenience entry point that closes and then claims your settlement in one transaction.

Limit and conditional orders

A limit or conditional order is an EIP-712 message you sign off-chain. It is not held on-chain; a keeper submits it later, together with a fresh price update, and the router verifies your signature before acting. The position belongs to you (the order’s maker), not to the keeper who submits it. There are signed orders for each action — open, close, close-and-claim, add collateral, and reduce leverage — with parallel variants for margin accounts. Each order carries:
  • What to do — the pool, direction and size (collateral × leverage) for opens, or the position and close amount (in basis points) for closes/reduces.
  • A trigger — a triggerPrice plus a triggerAbove flag. The order can be executed only when the oracle price reaches the trigger: triggerAbove = true fires at or above the price, false fires at or below it. One signed order expresses a take-profit or a stop-loss depending on which side you choose.
  • Slippage bounds — optional minPrice / maxPrice (and minPayout on closes) checked against the execution-time oracle price, independent of the trigger. A bound of zero disables that side.
  • A keeper fee — a token and amount you agree to pay whoever executes the order.
  • A deadline and a nonce — for expiry and cancellation (below).
At execution the router checks the deadline and nonce, verifies your signature, refreshes the price, checks the trigger and the slippage bounds against that fresh price, then performs the action as you and pays the keeper.

Keepers and fees

Execution is permissionless — anyone can submit a valid signed order, and the executor is recorded on the resulting event. The keeper fee you specified is paid to whoever executes it:
  • For opens and collateral changes, the fee is pulled from the maker. When a fee is set it must be the market’s collateral token.
  • For closes, the fee is taken out of the proceeds: the router claims your settlement, pays the keeper, and forwards the remainder to you (or to the order’s receiver for a close-and-claim).

Cancelling an order

Because a signed order lives off-chain, you cancel it in one of two ways:
  • Let it expire — an order past its deadline can no longer be executed; no transaction is needed.
  • Burn its nonce — call cancelNonce (or cancelNonces) to invalidate that order’s nonce before a keeper can use it. Each nonce is single-use, and a successful execution also consumes the nonce, so an order can never be replayed.

Close and claim

A close-and-claim order closes the position and then sweeps your entire pending settlement for that pool — including any earlier unclaimed payouts — pays the keeper fee, and forwards the net amount to the order’s receiver. Use it when you want the proceeds to land in a wallet in the same transaction instead of leaving them in settlement escrow.