Skip to Content

Advanced Order types

Velocity supports several advanced order types:

Trigger Market

A market order that activates when the trigger price condition is met. Used for Stop Loss (Stop Market) and Take Profit orders.

  • Triggers on the configured reference price (see trigger mechanics below).
  • Once triggered, it behaves like a market order.

Trigger Limit

A limit order that activates when the trigger price condition is met. Used for Stop Limit and Take Profit Limit orders.

  • Lets you specify trigger price and limit price separately.
  • Fill is not guaranteed if the market trades through and never touches the limit.

Trigger Order mechanics

Trigger orders (Stop Market / Stop Limit / Take Profit Market / Take Profit Limit) activate when a trigger reference price crosses the trigger price you set.

By default, the trigger reference price is the market’s oracle price. This is the behaviour currently live on Velocity mainnet.

Velocity also has a governance-gated median trigger price mode that is currently disabled (the MedianTriggerPrice feature flag is off by default, and is not set on mainnet). When enabled, the trigger reference price is instead the median of three values:

  • Oracle Price AdjustmentOracle Price + (Mark Price 5min TWAP − Oracle Price 5min TWAP)
  • Last Trade Price
  • Oracle Price with Funding AdjustmentOracle Price × (1 + Last Funding Rate × (Time Until Next Funding / Funding Period))

For example, if the three values are 100.2, 100.5, and 100.1, the median 100.2 is used. This mode reduces sensitivity to any single price source, at the cost of extra computation.

Oracle Limit

An Oracle Limit Order allows you to specify an offset rather than limit price to execute your order. The offset represents the price above/below the current Oracle Price you want to be filled at. It’s important to note that these orders can fill at any time the offset is met, so long as the account collateral is sufficient.

Scale

Submit multiple limit orders across a user‑defined price range to build or unwind a position gradually.

  • You define range, number of orders, and size distribution.

Order flags

These flags can be combined with the order types above.

FlagDescription
Reduce‑OnlyEnforces that the order will never increase or reverse the current position (go from long to short, or short to long).
Post‑OnlyEnforces that the order is a maker order that can provide liquidity to the pool and earns a maker rebate (currently 0.25 bps) instead of paying a taker fee.
Immediate‑or‑Cancel (IOC)An order that is placed and potentially partially filled. The remainder that is not filled immediately is then cancelled.
Has BuilderSet when the order carries a builder code (builderIdx / builderFeeTenthBps) — see Trading Fees.
Last updated on