# HyperMiles
Source: https://docs.hyperodd.com/hypermiles
Points & referral rewards system for HyperOdd traders
Hypermiles is a global unified points, referral and rewards system designed for traders on HyperOdd, a decentralized perpetuals exchange. It incentivizes trading activity by awarding points based on trade volume, with support for promotional campaigns and a referral program.
## How It Works
**Points**: Every trade on Hyperliquid earns points based on position size in USD. The formula is:
```
points = position_usd × BASE_POINTS_RATE × campaign_multiplier
```
With a default rate of **2 points per 1 USDH of maker volume** and **1 point per 1 USDH of taker volume**.
A 10,000 USDH maker volume earns 20,000 points and a 10,000 USDH taker volume earns 10,000 points (before any campaign multiplier).
**Campaigns**: Promotional campaigns can temporarily boost earnings with higher multipliers (e.g. 3x or 5x) and can be scoped to specific assets. A “base” campaign (1x multiplier, all assets) is always active as the default.
**Referrals**: Each user gets a unique referral code. When a referred user trades, the referrer earns a 10% bonus on the points their referee earns — creating a passive reward for growing the community.
**Leaderboard**: Users are ranked by total points, with the top 50 tracked on a leaderboard viewable by all-time or current-week periods.
## Future Rewards
Points earned through trading, campaigns, and referrals will be redeemable for rewards in the future. Details on the rewards program are coming soon — keep trading to accumulate points early.
# Introduction
Source: https://docs.hyperodd.com/index
HyperOdd operates as two interconnected layers: a leveraged structured products layer that engineers custom payoff instruments, and HOV, the autonomous liquidity infrastructure underneath it.
# HyperOdd Agentic Vault (HOV)
HOV is a network of autonomous agents operating across venue CLOBs like Hyperliquid, Polymarket and more The agent stack is tiered: base layer agents run continuous spread capture and cross-venue arbitrage systematically quoting both sides of thin markets and closing price dislocations between venues. Upper-layer agents handle directional and structured positioning dynamically sizing exposure based on probability shifts, order flow signals, and cross-asset correlations.
Agents monitor live order books, recalibrate quotes on every new tick, and execute atomically when thresholds are met. No human is in the loop for routine execution.
#### Vault Mechanics
Users deposit into protocol vaults. Vault capital is deployed by HOV agents across active strategies. Returns flow from spread income, arb capture, market making, delta-neutral, gamma-neutral strategies, structured product fees, trend following and automated smart directional trading strategies. Smart contract infrastructure ensures decentralized governance of capital allocation, withdrawal windows, and fee distribution.
#### Why does it matter?
Prediction markets don't sleep. Events resolve on weekends, overnight, during geopolitical shocks -- at exactly the moments when human market makers step away. HOV agents operate at all times, recalibrating positions as new information arrives and capturing spread that would otherwise go unmade. The result is tighter markets, better fills, and liquidity that doesn't evaporate under pressure.
## Roadmap
Structured Products & Exotic Derivatives (Coming Soon)
# VOLX
Source: https://docs.hyperodd.com/markets/volx
Trade US S&P 500 volatility index (VOLX) futures at 50x
HyperOdd’s flagship market is **hov:VOLX**, a HIP-3 builder perpetual based on the VXX (Volatility Index Short Term Futures ETN).
**VOLX** brings crypto-native exposure to traditional volatility trading, allowing users to go long or short on market volatility directly on Hyperliquid **24x7** at **50x leverage**.
Read more: [https://x.com/HyperOddX/status/2036880148122001598](https://x.com/HyperOddX/status/2036880148122001598)
Testnet (Live): [https://app.hyperliquid-testnet.xyz/trade/hov:VOLX](https://app.hyperliquid-testnet.xyz/trade/hov:VOLX)
# Auto-deleveraging (ADL)
Source: https://docs.hyperodd.com/trading/adl
Auto-deleveraging strictly ensures that the platform stays solvent. If a user's account value or isolated position value becomes negative, the users on the opposite side of the position are ranked by unrealized pnl and leverage used. Backstop liquidated positions have no special treatment in the ADL queue logic. The specific sorting index to determine the affected users in profit is `(mark_price / entry_price) * (notional_position / account_value)`. Those traders' positions are closed at the previous mark price against the now underwater user, ensuring that the platform has no bad debt.
Auto-deleveraging is an important final safeguard on the solvency of the platform. There is a strict invariant that under all operations, a user who has no open positions will not socialize any losses of the platform.
Learn more at [https://hyperliquid.gitbook.io/hyperliquid-docs/trading/auto-deleveraging](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/auto-deleveraging)
# Fees
Source: https://docs.hyperodd.com/trading/fees
**Standard Fees**: Standard fees for all HIP-3 assets are currently [2x the usual fees on validator-operated perp markets](https://hyperliquid.gitbook.io/hyperliquid-docs/hyperliquid-improvement-proposals-hips/hip-3-builder-deployed-perpetuals), with 50% of those fees going to Hyperliquid and 50% to trade\[XYZ].
**Growth Mode**: Growth mode may be enabled on certain assets. With growth mode, all-in fees are reduced by ≥90% from the standard fee rate, and both rebates and volume-contribution credits are also reduced by ≥90%.
The following are not eligible for growth mode:
* Crypto perps against any collateral
* Perps on crypto indexes, ETFs, or other baskets of crypto assets
* Perps on mathematical combinations including crypto assets (e.g., BTC + X)
* Perps on vehicles or wrappers that hold primarily crypto assets (e.g. MSTR)
* Perps tracking gold, because PAXG-USDC already tracks gold price (e.g. Gold)
**Fee Tiers**: Fee tiers are based on rolling 14-day volume, assessed daily (UTC). One tier applies across all perps, HIP-3 perps, and spot. Maker rebates are paid continuously per trade.
Hyperliquid staking discounts apply. You can read more about fees in [Hyperliquid's documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees).
### HIP-3 Fee Tiers — Growth Mode
| | | Base Rate | | Diamond | | Platinum | | Gold | | Silver | | Bronze | | Wood | |
| ---- | ------------------------ | --------- | ------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
| Tier | 14d weighted volume (\$) | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker |
| 0 | — | 0.0090% | 0.0030% | 0.00540% | 0.00180% | 0.00630% | 0.00210% | 0.00720% | 0.00240% | 0.00766% | 0.00256% | 0.00810% | 0.00270% | 0.00856% | 0.00286% |
| 1 | >\$5M | 0.0080% | 0.0024% | 0.00480% | 0.00144% | 0.00560% | 0.00168% | 0.00640% | 0.00192% | 0.00680% | 0.00204% | 0.00720% | 0.00216% | 0.00760% | 0.00228% |
| 2 | >\$25M | 0.0070% | 0.0016% | 0.00420% | 0.00096% | 0.00490% | 0.00112% | 0.00560% | 0.00128% | 0.00596% | 0.00136% | 0.00630% | 0.00144% | 0.00666% | 0.00152% |
| 3 | >\$100M | 0.0060% | 0.0008% | 0.00360% | 0.00048% | 0.00420% | 0.00056% | 0.00480% | 0.00064% | 0.00510% | 0.00068% | 0.00540% | 0.00072% | 0.00570% | 0.00076% |
| 4 | >\$500M | 0.0056% | 0.0000% | 0.00336% | 0.00000% | 0.00392% | 0.00000% | 0.00448% | 0.00000% | 0.00476% | 0.00000% | 0.00504% | 0.00000% | 0.00532% | 0.00000% |
| 5 | >\$2B | 0.0052% | 0.0000% | 0.00312% | 0.00000% | 0.00364% | 0.00000% | 0.00416% | 0.00000% | 0.00442% | 0.00000% | 0.00000% | 0.00000% | 0.00494% | 0.00000% |
| 6 | >\$7B | 0.0048% | 0.0000% | 0.00288% | 0.00000% | 0.00336% | 0.00000% | 0.00384% | 0.00000% | 0.00408% | 0.00000% | 0.00000% | 0.00000% | 0.00456% | 0.00000% |
### HIP-3 Fee Tiers — Standard
| | | Base Rate | | Diamond | | Platinum | | Gold | | Silver | | Bronze | | Wood | |
| ---- | ------------------------ | --------- | ------ | ------- | ------- | -------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |
| Tier | 14d weighted volume (\$) | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker | Taker | Maker |
| 0 | — | 0.090% | 0.030% | 0.0540% | 0.0180% | 0.0630% | 0.0210% | 0.0720% | 0.0240% | 0.0766% | 0.0256% | 0.0810% | 0.0270% | 0.0856% | 0.0286% |
| 1 | >\$5M | 0.080% | 0.024% | 0.0480% | 0.0144% | 0.0560% | 0.0168% | 0.0640% | 0.0192% | 0.0680% | 0.0204% | 0.0720% | 0.0216% | 0.0760% | 0.0228% |
| 2 | >\$25M | 0.070% | 0.016% | 0.0420% | 0.0096% | 0.0490% | 0.0112% | 0.0560% | 0.0128% | 0.0596% | 0.0136% | 0.0630% | 0.0144% | 0.0666% | 0.0152% |
| 3 | >\$100M | 0.060% | 0.008% | 0.0360% | 0.0048% | 0.0420% | 0.0056% | 0.0480% | 0.0064% | 0.0510% | 0.0068% | 0.0054% | 0.0072% | 0.0570% | 0.0076% |
| 4 | >\$500M | 0.056% | 0.000% | 0.0336% | 0.0000% | 0.0392% | 0.0000% | 0.0448% | 0.0000% | 0.0476% | 0.0000% | 0.0504% | 0.0000% | 0.0532% | 0.0000% |
| 5 | >\$2B | 0.052% | 0.000% | 0.0312% | 0.0000% | 0.0364% | 0.0000% | 0.0416% | 0.0000% | 0.0442% | 0.0000% | 0.0468% | 0.0000% | 0.0494% | 0.0000% |
| 6 | >\$7B | 0.048% | 0.000% | 0.0288% | 0.0000% | 0.0336% | 0.0000% | 0.0384% | 0.0000% | 0.0408% | 0.0000% | 0.0432% | 0.0000% | 0.0456% | 0.0000% |
# Funding
Source: https://docs.hyperodd.com/trading/funding
### Overview
Funding rates for crypto perpetual contracts are a mechanism that is used to ensure the price of the contract stays close to the underlying asset's price.
The funding rate is a periodic fee that is paid by one side of the contract (either long or short) to the other side. Funding is purely peer-to-peer and no fees are collected on the payments.
The rate is calculated based on the difference between the contract's price and the spot price of the underlying asset. For consistency with CEXs, interest rate component is predetermined at 0.01% every 8 hours, which is 0.00125% every hour, or 11.6% APR paid to short. This represents the difference in cost to borrow USD versus spot crypto.
The premium component fluctuates based on the difference between the perpetual contract's price and the underlying spot oracle price. If the contract's price is higher than the oracle price, the premium and hence the funding rate will be positive, and the long position will pay the short position. Conversely, if the contract's price is lower than the spot price, the funding rate will be negative, and the short position will pay the long position.
The funding rate on Hyperliquid is paid every hour. The funding rate is added or subtracted from the balance of contract holders at the funding interval.
Funding rates are designed to prevent large price disparities between the perpetual contract and the underlying asset. When the funding rate is high, it can incentivize traders to take the opposite position and help to bring the contract's price closer to the spot price of the underlying asset.
### Technical details
Funding on Hyperliquid is designed to closely match the process used by centralized perpetual exchanges.
The funding rate formula applies to 8 hour funding rate. However, funding is paid every hour at one eighth of the computed rate for each hour.
The specific formula is `Funding Rate (F) = Average Premium Index (P) + clamp (interest rate - Premium Index (P), -0.0005, 0.0005)`. The premium is sampled every 5 seconds and averaged over the hour.
As described in the [clearinghouse](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/clearinghouse) section, the oracle prices are computed by each validator as the weighted median of CEX spot prices for each asset, with weights depending on the liquidity of the CEX.
`premium = impact_price_difference / oracle_price`
where
`impact_price_difference = max(impact_bid_px - oracle_px, 0) - max(oracle_px - impact_ask_px, 0)`
and `impact_bid_px` and `impact_ask_px` are the average execution prices to trade`impact_notional_usd` on the bid and ask sides, respectively. See the contract specifications for the impact notional used, as well as other contract specific parameters.
Funding on Hyperliquid is capped at 4%/hour. Note that this is much less aggressive capping than CEX counterparts. The funding cap and funding interval do not depend on the asset.
Note that the funding payment at the end of the interval is `position_size * oracle_price * funding_rate`. In particular, the spot oracle price is used to convert the position size to notional value, *not the mark price.*
### Numerical Example
Here is an explicit example computation:
1. The interest rate is 0.01% (fixed).
2. The perpetual contract is trading at a premium, with the impact bid price being $10,100, and the spot price at $10,000.
3. The premium index is calculated as the difference between the two prices, which is \$100 in this case.
4. The funding interval is 1 hour.
5. You hold a long position of 10 contracts, each representing 1 BTC.
First, calculate the premium:
Premium = (Impact bid price - Spot Price) / Spot Price = ($10,100 - $10,000) / \$10,000 Premium = 0.01 (or 1%)
Next, clamp the interest rate minus the premium rate at 0.05%:
Clamped Difference = min(max(Interest Rate - Premium Rate, -0.05%), 0.05%)
Clamped Difference = min(max(0.01% - 1%, -0.05%), 0.05%)
Clamped Difference = min(max(-0.99%, -0.05%), 0.05%) Clamped Difference = -0.05%
Now, calculate the funding rate:
Funding Rate = Premium Rate + Clamped Difference Funding Rate = 1% + (-0.05%)
Funding Rate = 0.95%
# Liquidation
Source: https://docs.hyperodd.com/trading/liquidation
### Overview
A liquidation event occurs when a trader's positions move against them to the point where the account equity falls below the maintenance margin. The maintenance margin is half of the initial margin at max leverage, which varies from 3-40x. In other words, the maintenance margin is between 1.25% (for 40x max leverage assets) and 16.7% (for 3x max leverage assets) depending on the asset.
When the account equity drops below maintenance margin, the positions are first attempted to be entirely closed by sending market orders to the book. The orders are for the full size of the position, and may be fully or partially closed. If the positions are entirely or partially closed such that the maintenance margin requirements are met, any remaining collateral remains with the trader.
If the account equity drops below 2/3 of the maintenance margin without successful liquidation through the book, a backstop liquidation happens through the liquidator vault. See Liquidator Vault explanation below for more details.
When a cross position is backstop liquidated, the trader's cross positions and cross margin are all transferred to the liquidator. In particular, if the trader has no isolated positions, the trader ends up with zero account equity.
When an isolated position is backstop liquidated, that isolated position and isolated margin are transferred to the liquidator. The user's cross margin and positions are untouched.
During backstop liquidation, the maintenance margin is not returned to the user. This is because the liquidator vault requires a buffer to make sure backstop liquidations are profitable on average. In order to avoid losing the maintenance margin, traders can place stop loss orders or exit the positions before the mark price reaches the liquidation price.
Liquidations use the mark price, which combines external CEX prices with Hyperliquid's book state. This makes liquidations more robust than using a single instantaneous book price. During times of high volatility or on highly leveraged positions, mark price may be significantly different from book price. It is recommended to use the exact formula for precise monitoring of liquidations.
### Motivation
As described above, the majority of liquidations on Hyperliquid are sent directly to the order book. This allows all users to compete for the liquidation flow, and allows the liquidated user to keep any remaining margin. Unlike CEXs there is no clearance fee on liquidations.
The resulting system is transparent and prioritizes retaining as much capital as possible for the liquidated user.
### Partial Liquidations
For liquidatable positions larger than 100k USDC (10k USDC on testnet for easier testing), only 20% of the position will be sent as a market liquidation order to the book. After a block where any position of a user is partially liquidated, there is a cooldown period of 30 seconds. During this cooldown period, all market liquidation orders for that user will be for the entire position.
### Liquidator Vault
Backstop liquidations on Hyperliquid are democratized through the liquidator vault, which is a component strategy of HLP. Positions that are below 2/3 of the maintenance margin can be taken over by the liquidator vault.
On average, backstop liquidations are profitable for the liquidator. On most venues, this profit goes to the exchange operator or privileged market makers who internalize the flow. On Hyperliquid, the pnl stream from liquidations go entirely to the community through HLP.
### Computing Liquidation Price
When entering a trade, an estimated liquidation price is shown. This estimation may be inaccurate compared to the position's estimated liquidation price due to changing liquidity on the book.
Once a position is opened, a liquidation price is shown. This price has the certainty of the entry price, but still may not be the actual liquidation price due to funding payments or changes in unrealized pnl in other positions (for cross margin positions).
The actual liquidation price is independent on the leverage set for cross margin positions. A cross margin position at lower leverage simply uses more collateral.
The liquidation price does depend on leverage set for isolated margin positions, because the amount of isolated margin allocated depends on the initial margin set.
When there is insufficient margin to make the trade, the liquidation price estimate assumes that the account is topped up to the initial margin requirement.
The precise formula for the liquidation price of a position is
`liq_price = price - side * margin_available / position_size / (1 - l * side)`
where
`l = 1 / MAINTENANCE_LEVERAGE` . For assets with margin tiers, maintenance leverage depends on the unique margin tier corresponding to the position value at the liquidation price.
`side = 1 for long and -1 for short`
`margin_available (cross) = account_value - maintenance_margin_required`
`margin_available (isolated) = isolated_margin - maintenance_margin_required`
Learn more at [https://hyperliquid.gitbook.io/hyperliquid-docs/trading/liquidations](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/liquidations)
# Margining
Source: https://docs.hyperodd.com/trading/margin
Margin computations follow similar formulas to major centralized derivatives exchanges.
### Margin Mode
When opening a position, a margin mode is selected. *Cross margin* is the default, which allows for maximal capital efficiency by sharing collateral between all other cross margin positions. *Isolated margin* is also supported, which allows an asset's collateral to be constrained to that asset. Liquidations in that asset do not affect other isolated positions or cross positions. Similarly, cross liquidations or other isolated liquidations do not affect the original isolated position.
Some assets are *strict isolated*, which functions the same as isolated margin with the additional constraint that margin cannot be removed. Margin is proportionally removed as the position is closed.
### HIP-3 Margin Modes
When users have perp positions across multiple DEXs, cross margin behaves different depending on the user's account abstraction. For unified account and portfolio margin, the user's cross margin positions in DEXs with the same collateral all share margin. For standard abstraction, cross margin only applies to the assets within the same DEX. See [here](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/account-abstraction-modes) for more details.
HIP-3 DEXs also support "no cross" margin mode, which allows isolated margin with margin removal enabled, but does not allow cross margin.
### Initial Margin and Leverage
Leverage can be set by a user to any integer between 1 and the max leverage. Max leverage depends on the asset.
The margin required to open a position is `position_size * mark_price / leverage`. The initial margin is used by the position and cannot be withdrawn for cross margin positions. Isolated positions support adding and removing margin after opening the position. Unrealized pnl for cross margin positions will automatically be available as initial margin for new positions, while isolated positions will apply unrealized pnl as additional margin for the open position.\
\
The leverage of an existing position can be increased without closing the position. Leverage is only checked upon opening a position. Afterwards, the user is responsible for monitoring the leverage usage to avoid liquidation. Possible actions to take on positions with negative unrealized pnl include partially or fully closing the position, adding margin (if isolated), and depositing USDC (if cross).
### Unrealized PNL and transfer margin requirements
Unrealized pnl can be withdrawn from isolated positions or cross account, but only if the remaining margin is at least 10% of the total notional position value of all open positions. The margin remaining must also meet the initial margin requirement, i.e. `transfer_margin_required = max(initial_margin_required, 0.1 * total_position_value)`
Here, "transferring" includes any action that removes margin from a position, other than trading. Examples include withdrawals, transfer to spot wallet, and isolated margin transfers.
### Maintenance Margin and Liquidations
Cross positions are liquidated when the account value (including unrealized pnl) is less than the *maintenance margin* times the total open notional position. The maintenance margin is currently set to half of the initial margin at max leverage.
Isolated positions are liquidated by the same maintenance margin logic, but the only inputs to the computation are the isolated margin and the notional value of the isolated position.
Learn more at [https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margining](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margining)
# Order types
Source: https://docs.hyperodd.com/trading/orders
### Order types:
* Market: An order that executes immediately at the current market price
* Limit: An order that executes at the selected limit price or better
* Stop Market: A market order that is activated when the price reaches the selected trigger price. For long orders, the trigger price needs to be higher than the mid price. For short orders, the trigger price needs to be lower than the mid price
* Stop Limit: A limit order that is activated when the price reaches the selected trigger price
* Take Market: A market order that is activated when the price reaches the selected trigger price. For long orders, the trigger price needs to be lower than the mid price. For short orders, the trigger price needs to be higher than the mid price
* Take Limit: A limit order that is activated when the price reaches the selected trigger price
* Scale: Multiple limit orders in a set price range
* TWAP: A large order divided into smaller suborders and executed in 30 second intervals. TWAP suborders have a maximum slippage of 3%
### TWAP details:
During execution, a TWAP order attempts to meet an execution target which is defined as the elapsed time divided by the total time times the total size. A suborder is sent every 30 seconds during the course of the TWAP.
A suborder is constrained to have a max slippage of 3%. When suborders do not fully fill because of market conditions (e.g., wide spread, low liquidity, etc.), the TWAP may fall behind its execution target. In this case, the TWAP will try to catch up to this execution target during later suborders. These later suborders will be larger but subject to the constraint of 3 times the normal suborder size (defined as total TWAP size divided by number of suborders). It is possible that if too many suborders did not fill then the TWAP order may not fully catch up to the total size by the end. Like normal market orders, TWAP suborders do not fill during the post-only period of a network upgrade.
### Order options:
* Reduce Only: An order that reduces a current position as opposed to opening a new position in the opposite direction
* Good Til Cancel (GTC): An order that rests on the order book until it is filled or canceled
* Post Only (ALO): An order that is added to the order book but doesn’t execute immediately. It is only executed as a resting order
* Immediate or Cancel (IOC): An order that will be canceled if it is not immediately filled
* Take Profit: An order that triggers when the Take Profit (TP) price is reached.
* Stop Loss: An order that triggers when the Stop Loss (SL) price is reached
* TP and SL orders are often used by traders to set targets and protect profits or minimize losses on positions. TP and SL are automatically market orders. You can set a limit price and configure the amount of the position to have a TP or SL
Learn more at [https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types)
# Mark and oracle price
Source: https://docs.hyperodd.com/trading/price
Hyperliquid makes use of several robust prices based on order book and external data to minimize risk of market manipulation.
*Oracle price* is used to compute funding rates. This weighted median of CEX prices is robust because it does not depend on hyperliquid's market data at all. Oracle prices are updated by the validators approximately once every three seconds.
*Mark price* is the median of the following prices:
1. Oracle price plus a 150 second exponential moving average (EMA) of the difference between Hyperliquid's mid price and the oracle price
2. The median of best bid, best ask, last trade on Hyperliquid
3. Median of Binance, OKX, Bybit, Gate IO, MEXC perp mid prices with weights 3, 2, 2, 1, 1, respectively
If exactly two out of the three inputs above exist, the 30 second EMA of the median of best bid, best ask, and last trade on Hyperliquid is also added to the median inputs.
Mark price is an unbiased and robust estimate of the fair perp price, and is used for margining, liquidations, triggering TP/SL, and computing unrealized pnl. Mark price is updated whenever validators publish new oracle prices. Therefore, mark and oracle price are updated approximately once every 3 seconds.
The EMA update formula is defined as follows for an update value of `sample` at duration `t` since the last update
`ema = numerator / denominator`
`numerator -> numerator * exp(-t / 2.5 minutes) + sample * t`
`denominator -> denominator * exp(-t / 2.5 minutes) + t`
Learn more at [https://hyperliquid.gitbook.io/hyperliquid-docs/trading/robust-price-indices](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/robust-price-indices)
# Self-Trade Prevention
Source: https://docs.hyperodd.com/trading/self
Trades between the same address cancel the resting order instead of causing a fill. No fees are deducted, nor does the the cancel show up in the trade feed.
On CEXs this behavior is often labeled as "expire maker." This is a commonly preferred behavior for market making algorithms, where the aggressing order would like to continue getting fills against liquidity behind the maker order up until the limit price.
Learn more at [https://hyperliquid.gitbook.io/hyperliquid-docs/trading/self-trade-prevention](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/self-trade-prevention)
# Take profit and stop loss orders (TP/SL)
Source: https://docs.hyperodd.com/trading/tpsl
TP/SL orders close your position when a certain profit (resp. loss) has realized on your position.
The [mark price](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/robust-price-indices) is used to trigger TP/SL orders.
TP/SL orders can be dragged on the TradingView chart. Note that dragging in a way that causes the order to immediately execute will lead to an error. Usually this prevents user mistakes, but if this is your desired behavior you can manually close the order from the position table or order form.
### Limit vs Market TP/SL orders
Users can choose between TP/SL market and limit orders. TP/SL market orders have a slippage tolerance of 10%.
By setting the limit price on TP/SL orders, users can control the slippage tolerance of a triggered order. The more aggressive the limit price, the more likely the TP/SL order will be filled upon triggering, but the higher the potential slippage upon filling.
As a concrete example, a SL order to close a long with trigger price $10 and limit price $10 will hit the book when the mark price drops below $10. If the price drops from $11 to $9 instantly it is quite likely this SL order would rest at $10 instead of filling. However, if the limit price were $8 instead of $10, it's likely to fill at some price between $9 and $8.
### TP/SL associated with a position
TP/SL opened from the position form will have a size equal to the entire position by default. These orders will attempt to close the entire position at the time of trigger. If a specific size is configured on these TP/SL orders, they will be fixed-sized (i.e. they will not resize with the position after being placed).
Position TP/SL orders are the most beginner-friendly because they have simple placement and cancelation criteria.
### TP/SL associated with a parent order (a.k.a one-cancels-other, OCO)
This style of TP/SL is more complicated. Read the below carefully to avoid unexpected outcomes.
TP/SL opened from the order form have a fixed size equal to the order they are tied to.
If the parent order is fully filled at placement, the children TP and/or SL orders are immediately placed. This behavior is similar to the TP/SL assocated with a position.
When the parent order is not fully filled, the children orders enter an untriggered state. The TP/SL orders have not been placed, and upon cancelation of an unfilled parent order, the child TP/SL orders will be canceled.
If the trader cancels a partially filled parent order, ***the child TP/SL orders are fully canceled as well***. If the trader desires a TP/SL for the partially filled size, they must do so manually, e.g. by placing a separate TP/SL orders associated with the new position.
However, if the parent order is partially filled and then canceled due to insufficient margin, the TP/SL orders will be placed as if the order were fully filled.
In conclusion, ***children TP/SL orders associated with a parent order will be placed if and only if the parent order fully fills or is partially filled followed by a cancelation for insufficient margin***.