Core Docs
  • ๐Ÿ”ฎHome
  • nftperp
    • ๐Ÿ’จQuick Start
      • Prerequisities
      • First Trade
      • AMM Liquidity Provisioning
      • Order Types
    • ๐ŸŒŒWhat is nftperp?
      • Tokenomics
      • Mafia Nuts Collection
      • Contracts
    • ๐Ÿ’ฐProtocol Incentives
      • Maker Incentives
      • Referral Incentives
      • AMM Incentives
    • โ›“๏ธChain Incentives
      • ๐Ÿช™Blast Incentives
        • ๐Ÿฅ‡Blast Gold
        • ๐Ÿ’ฏBlast Points
    • ๐ŸงชProtocol Design
      • Matching Engine
      • Decentralized Limit Orderbook (DLOB)
      • AMM
        • Logic
        • Guide
      • Oracle
      • Insurance Fund
      • Funding Payments
      • Liquidations
      • Trigger Orders
      • Launchpad
      • Ordinals
      • Auto Deleveraging (ADL)
    • ๐Ÿ‘จโ€๐Ÿ’ปDevelopers
      • Getting Started
        • Liquidators
        • Trigger Keepers
        • Market Making
      • API
      • SDK
      • Data
    • ๐Ÿซ‚Community, Feedback & Support
      • FAQ
      • Feedback & Bug reports
      • Brand Assets
    • ๐Ÿ“œGlossary
    • ๐Ÿ”Audits
Powered by GitBook
On this page
  1. nftperp
  2. Developers
  3. Getting Started

Trigger Keepers

PreviousLiquidatorsNextMarket Making

Last updated 1 year ago

Our API endpoint returns the list of active trigger orders in an AMM. Trigger Orders are valid under the following conditions:

if (side == Side.LONG) {
   invalid = takeProfit ? markPrice < trigger : markPrice > trigger;
} else {
   invalid = takeProfit ? markPrice > trigger : markPrice < trigger;
}

For the convenience of keepers, we have an extrnal function in solidity to check if a trigger order is valid

isTriggerOrderValid(uint256 id)

Where id is the trigger order id as returned by our API.

Our visualizes these conditions better. Once a trigger order is found, you can call the following function to execute the trigger order:

closePositionKeeper(uint256 id)

Where id is the ID of the trigger order.

You don't need to be whitelisted to run this function, and you will earn a reward of 5 bps for executing a trigger order.

๐Ÿ‘จโ€๐Ÿ’ป
/trigger
example repo