TradeSta Docs
Tradesta is a leverage trading platform that allows you to trade price movements of Crypto Assets, Real World Assets, and Foreign Exchange. This document provides users with more information on how to use the platform effectively.
The platform allows you to perform the following actions:
-
Create a leverage position from 5x and up to 100x.
-
Update an existing position.
-
Manage an existing position.
-
Create and manage limit orders.
-
Liquidate a position in default
Creating and Maintaining a Market Position
Tradesta enables users to open market positions using USDC. Traders can choose to go long or short on any supported market. When a position is created, the user’s USDC is transferred to Tradesta, where it is held as collateral until the position is either modified, closed, or liquidated.
​
Example:
​
Alice decides to open a long position with $100 USDC on the BTC/USD market using 20x leverage. This gives her a total position size of $2,000 ($100 × 20). If Bitcoin's price increases by 10%, the value of her position rises to $2,200, giving her an unrealized profit of $200, excluding her initial collateral.
Each position created is assigned a liquidation price, which is stored within the position object.
Additionally, upon opening a position, a user may either pay or receive a funding rate, depending on the market’s open interest:
-
If the market has more long positions than shorts, short traders earn the funding fee from long traders.
-
Conversely, if there are more shorts than longs, long traders earn the funding fee from short traders.
The funding rate is updated hourly and is applied continuously while the position remains open.
A position stays open as long as the following conditions are met:
-
For short positions: the current market price is below the liquidation price.
-
For long positions: the current market price is above the liquidation price.
-
The cumulative funding fees do not exceed the remaining collateral.
-
The unrealized PnL (profit and loss) does not reduce the collateral to zero.
Updating an existing Market Position
Tradesta allows users to update existing positions by either adding or removing collateral.
​
When a user adds collateral, the position size remains the same, but the total collateral increases. This results in a lower effective leverage, reducing the risk of liquidation.
​
Conversely, when a user removes collateral, the position size still remains the same, but the collateral decreases. This leads to a higher effective leverage, increasing the risk of liquidation.
​
Example:
-
Alice opens a long position with $100 USDC on the BTC/USD market at 20x leverage, giving her a position size of $2,000. Later, she adds an additional $100 USDC in collateral. Her position size stays at $2,000, but her effective leverage drops to 10x, significantly lowering her liquidation risk.
-
Bob also opens a long position with $100 USDC at 20x leverage, for a total size of $2,000. He then removes $50 USDC from his collateral. His position size remains $2,000, but his effective leverage rises to 40x, increasing the risk of liquidation.
Important Note:
If a position has accrued a negative funding rate that exceeds the current collateral, any interaction with the position—such as adding or removing collateral—will result in instant liquidation. This mechanism is designed to prevent the protocol from accumulating bad debt.
Closing an Existing Position
Once a position is opened, it can later be closed by the user. Upon closing, the platform calculates the profit or loss (PnL) of the position, including any accrued funding rates:
​
-
If the position results in a profit, the profit is added to the user's collateral.
-
If the position incurs a loss, the loss is deducted from the collateral.
Funding fees—whether positive or negative—are also applied at the time of closing, further adjusting the final PnL outcome.
​
Positions opened on commodities, currencies and stocks opened during market hours cannot be unless during market hours. Trying to close these positions outside of market hours will result in a failed transaction.
​
If a position has already entered debt, often due to accrued negative funding rates, any attempt to close it will result in an immediate liquidation. This safeguard prevents the protocol from accumulating bad debt.
​
Only active (open) positions can be closed. Closed or liquidated positions cannot be interacted with in this way.
Liquidate a Position
Tradesta operates an automated liquidator bot that continuously monitors all markets and liquidates any positions that fall into default. A liquidation is triggered if any of the following conditions are met:
​
-
For short positions: the current market price rises above the liquidation price.
-
For long positions: the current market price falls below the liquidation price.
-
The cumulative funding fees exceed the remaining collateral.
-
The unrealized PnL (loss) is equal to or greater than the deposited collateral.
To foster community involvement, Tradesta plans to open source the liquidator bot. This will allow users to run their own liquidation bots and earn a 5% reward of the value of any position they successfully liquidate.
Creating a Limit Order
Tradesta allows users to place limit orders, which are executed when the market price comes within ±0.2% (i.e., ±2/1000) of the specified execution price.
​
When a limit order is created, the associated funds are immediately transferred from the user’s wallet to the Order Manager contract, where they are held securely until the order is either executed or cancelled.
​
If a user cancels the limit order before execution, the deposited funds are returned in full.
​
When the limit order is successfully executed, the Order Manager contract automatically creates a corresponding market position at the target price. The order then moves to the user’s order history, and the new position will appear among their active positions.​
​
Risk Management Constraint:
In situations where the market is heavily imbalanced—e.g., there is a significant skew in open interest toward one direction—limit orders placed in that same direction may fail to execute, even if the target price is reached. This is a deliberate part of Tradesta’s risk management system, designed to maintain platform liquidity and ensure fair execution opportunities across all market participants.
Glossary
Position Manager
​
The Position Manager contract is responsible for managing all user positions within a specific market. It serves as the central record for:
​
-
Open and closed positions
-
Collateral deposits
-
Position-related data such as leverage, liquidation price, and PnL
Each market has its own dedicated Position Manager to ensure isolated and efficient management of user activity per trading pair.
Order Manager
​
The Order Manager contract handles all limit orders for a given market. When a user creates a limit order:
​
-
The order is stored in the Order Manager
-
The associated funds are held in the contract
Upon execution, the Order Manager:
​
-
Archives the order
-
Creates a corresponding market position via the Position Manager
Like the Position Manager, each market has its own Order Manager, maintaining clean separation between different trading pairs.
​
All addresses are on the Avalanche C-Chain