deepbook-margin-tpsl

Installation
SKILL.md

DeepBook Margin: Take Profit & Stop Loss (TPSL)

The Take Profit Stop Loss (TPSL) module enables conditional orders that automatically execute when specific price conditions are met. This allows traders to protect positions against losses (stop loss) or capture profits (take profit) without continuous manual monitoring.


1. How TPSL Works

Conditional orders are registered with the MarginManager and are split into two vectors:

graph TD
    MM[MarginManager] -->|Stores| VBelow[trigger_below vector]
    MM -->|Stores| VAbove[trigger_above vector]
    VBelow -->|Sorted| H2L[High-to-Low Trigger Prices]
    VAbove -->|Sorted| L2H[Low-to-High Trigger Prices]
    Keeper([Keepers/Bots]) -->|Call permissionless| Exec[execute_conditional_orders]
    Exec -->|Triggers| Placement[Place Order on DeepBook V3 Pool]
Installs
1
First Seen
Sep 4, 2026
deepbook-margin-tpsl — nickthelegend/sui-deepbook-skills