Back to Sui

Orders

docs/content/standards/deepbook-margin/contract-information/orders.mdx

latest2.9 KB
Original Source

The pool_proxy module provides wrapper functions for trading with margin managers. These functions enable placing orders, modifying and canceling them, and managing staking and governance participation through a margin manager. All trading operations require the margin manager to be associated with the correct DeepBook pool.

API

Following are the different public functions for managing orders with margin managers.

<details> <summary>Place orders</summary>

Place limit and market orders through a margin manager. Orders can only be placed if margin trading is enabled for the pool.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="place_limit_order,place_market_order" />

</details> <details> <summary>Place reduce-only orders</summary>

Place reduce-only orders that can only decrease your debt position. These orders are useful when margin trading is disabled and you need to close existing positions.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="place_reduce_only_limit_order,place_reduce_only_market_order" />

</details> <details> <summary>Modify order</summary>

Modify an existing order by changing its quantity.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="modify_order" />

</details> <details> <summary>Cancel orders</summary>

Cancel one, multiple, or all orders for the margin manager.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="cancel_order,cancel_orders,cancel_all_orders" />

</details> <details> <summary>Withdraw settled amounts</summary>

Withdraw settled amounts from completed trades back to the margin manager's balance manager.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="withdraw_settled_amounts" />

</details> <details> <summary>Staking</summary>

Stake and unstake DEEP tokens through the margin manager. Note that margin managers for pools with DEEP as base or quote asset cannot stake.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="stake,unstake" />

</details> <details> <summary>Governance</summary>

Submit proposals and vote on governance decisions through the margin manager.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="submit_proposal,vote" />

</details> <details> <summary>Claim rebates</summary>

Claim trading rebates earned through the margin manager.

<ImportContent source="packages/deepbook_margin/sources/pool_proxy.move" mode="code" org="MystenLabs" repo="deepbookv3" fun="claim_rebates" />

</details>