OpenPondOpenPond
TradeAgentsPortfolioPointsPredictAnalytics
Create AgentLogin
O

openpondai/agents/pair-trade

OpenTool app

Copy strategy · 14 timesStar· 0Watch· 0
OverviewFiles
1Branch0Tags
GL
glucryptoFix Paragon perp market resolution
251fe3214 days ago5Commits
pair-trade/src/config
defaults.tsInitial commit—
normalize.tsInitial commit—
schema.tsInitial commit—
types.tsInitial commit—
About
pair-trade

OpenTool app

Tool
pair-trade
Method
POST
Profile
{
  "assets": [
    {
      "chain": "hyperliquid",
      "venue": "hyperliquid",
      "assetSymbols": [
        "BTC/USDC",
        "ETH"
      ]
    }
  ],
  "backtest": {
    "mode": "decisions"
  },
  "category": "strategy",
  "description": "Pair-trade strategy (long + short legs) on Hyperliquid.",
  "templateConfig": {
    "envVar": "OPENTOOL_PUBLIC_HL_PAIR_TRADE_CONFIG",
    "schema": {
      "type": "object",
      "required": [
        "platform",
        "allocationMode",
        "legAAsset",
        "legBAsset",
        "legAMarketType",
        "legBMarketType",
        "legASide",
        "targetNotionalUsd",
        "hedgeRatio",
        "legALeverage",
        "legBLeverage",
        "legALeverageMode",
        "legBLeverageMode",
        "slippageBps",
        "rebalanceDriftPct",
        "environment"
      ],
      "x-budget": {
        "modes": {
          "target_notional": {
            "fields": [
              "targetNotionalUsd",
              "hedgeRatio"
            ]
          }
        },
        "title": "Budget & allocation",
        "modeField": "allocationMode",
        "defaultMode": "target_notional",
        "description": "Core exposure settings are shown first."
      },
      "properties": {
        "legASide": {
          "enum": [
            "long",
            "short"
          ],
          "type": "string",
          "title": "Leg A side",
          "x-order": 5,
          "x-section": "Strategy",
          "description": "Whether Leg A is the long or short side. Leg B uses the opposite side.",
          "x-enumLabels": [
            "Long",
            "Short"
          ]
        },
        "platform": {
          "enum": [
            "hyperliquid"
          ],
          "type": "string",
          "title": "Platform",
          "x-order": 1,
          "readOnly": true,
          "x-section": "Execution",
          "description": "Execution venue for long + short legs."
        },
        "schedule": {
          "type": [
            "object",
            "null"
          ],
          "title": "Schedule",
          "x-section": "Schedule",
          "properties": {
            "cron": {
              "type": "string",
              "title": "Cron expression",
              "x-order": 1,
              "description": "Standard cron expression for the run schedule."
            },
            "enabled": {
              "type": "boolean",
              "title": "Enabled",
              "x-order": 2,
              "description": "Enable the scheduled rebalance."
            },
            "notifyEmail": {
              "type": "boolean",
              "title": "Notify email",
              "x-order": 3,
              "description": "Send an email after each scheduled run."
            }
          },
          "description": "Optional cron schedule for advanced recurring maintenance."
        },
        "legAAsset": {
          "type": "string",
          "title": "Leg A asset",
          "x-order": 1,
          "x-format": "asset",
          "x-section": "Strategy",
          "description": "Primary pair leg asset (example: SOL)."
        },
        "legBAsset": {
          "type": "string",
          "title": "Leg B asset",
          "x-order": 2,
          "x-format": "asset",
          "x-section": "Strategy",
          "description": "Opposite pair leg asset (example: ETH)."
        },
        "hedgeRatio": {
          "type": "number",
          "title": "Leg B notional size",
          "x-step": 0.01,
          "x-unit": "x",
          "minimum": 0.01,
          "x-order": 7,
          "x-section": "Strategy",
          "description": "Leg B notional exposure as a multiplier of Leg A notional. This is not leverage."
        },
        "environment": {
          "enum": [
            "mainnet",
            "testnet"
          ],
          "type": "string",
          "title": "Environment",
          "x-order": 2,
          "x-section": "Execution",
          "description": "Hyperliquid environment for execution.",
          "x-enumLabels": [
            "Mainnet",
            "Testnet"
          ]
        },
        "slippageBps": {
          "type": "number",
          "title": "Slippage",
          "x-step": 1,
          "x-unit": "bps",
          "maximum": 5000,
          "minimum": 0,
          "x-order": 1,
          "x-format": "bps",
          "x-section": "Risk limits",
          "description": "Maximum slippage for marketable orders."
        },
        "legALeverage": {
          "type": "number",
          "title": "Leg A leverage",
          "x-step": 1,
          "x-unit": "x",
          "maximum": 40,
          "minimum": 1,
          "x-order": 3,
          "x-section": "Execution",
          "description": "Margin leverage for Leg A when Leg A is a perp market. This changes margin and liquidation buffer, not notional size."
        },
        "legBLeverage": {
          "type": "number",
          "title": "Leg B leverage",
          "x-step": 1,
          "x-unit": "x",
          "maximum": 40,
          "minimum": 1,
          "x-order": 4,
          "x-section": "Execution",
          "description": "Margin leverage for Leg B when Leg B is a perp market. This changes margin and liquidation buffer, not notional size."
        },
        "configVersion": {
          "type": "number",
          "title": "Config version",
          "x-order": 1000,
          "readOnly": true,
          "x-hidden": true,
          "x-section": "Meta",
          "description": "Internal version for pair-trade config defaults."
        },
        "allocationMode": {
          "enum": [
            "target_notional"
          ],
          "type": "string",
          "title": "Allocation mode",
          "x-order": 1001,
          "readOnly": true,
          "x-hidden": true,
          "x-section": "Meta",
          "description": "Canonical sizing mode for pair-trade templates."
        },
        "legAMarketType": {
          "enum": [
            "spot",
            "perp"
          ],
          "type": "string",
          "title": "Leg A market",
          "x-order": 3,
          "x-section": "Strategy",
          "description": "Market type for Leg A.",
          "x-enumLabels": [
            "Spot",
            "Perp"
          ]
        },
        "legBMarketType": {
          "enum": [
            "spot",
            "perp"
          ],
          "type": "string",
          "title": "Leg B market",
          "x-order": 4,
          "x-section": "Strategy",
          "description": "Market type for Leg B.",
          "x-enumLabels": [
            "Spot",
            "Perp"
          ]
        },
        "legALeverageMode": {
          "enum": [
            "cross",
            "isolated"
          ],
          "type": "string",
          "title": "Leg A margin mode",
          "x-order": 5,
          "x-section": "Execution",
          "description": "Margin mode for Leg A when Leg A is a perp market.",
          "x-enumLabels": [
            "Cross",
            "Isolated"
          ]
        },
        "legBLeverageMode": {
          "enum": [
            "cross",
            "isolated"
          ],
          "type": "string",
          "title": "Leg B margin mode",
          "x-order": 6,
          "x-section": "Execution",
          "description": "Margin mode for Leg B when Leg B is a perp market.",
          "x-enumLabels": [
            "Cross",
            "Isolated"
          ]
        },
        "rebalanceDriftPct": {
          "type": "number",
          "title": "Rebalance drift",
          "x-step": 0.1,
          "x-unit": "%",
          "maximum": 50,
          "minimum": 0.1,
          "x-order": 2,
          "x-format": "percent",
          "x-section": "Risk limits",
          "description": "Percent of target notional before rebalancing either leg."
        },
        "targetNotionalUsd": {
          "type": "number",
          "title": "Leg A notional",
          "x-step": 1,
          "x-unit": "USD",
          "minimum": 1,
          "x-order": 6,
          "x-format": "currency",
          "x-section": "Strategy",
          "description": "USD notional for Leg A before applying the Leg B size ratio."
        }
      }
    },
    "version": 14,
    "defaults": {
      "legASide": "long",
      "platform": "hyperliquid",
      "legAAsset": "BTC",
      "legBAsset": "ETH",
      "longAsset": "BTC",
      "hedgeRatio": 1,
      "shortAsset": "ETH",
      "environment": "mainnet",
      "slippageBps": 20,
      "legALeverage": 1,
      "legBLeverage": 1,
      "maxPerRunUsd": 1000,
      "configVersion": 14,
      "allocationMode": "target_notional",
      "legAMarketType": "spot",
      "legBMarketType": "perp",
      "longMarketType": "spot",
      "shortMarketType": "perp",
      "legALeverageMode": "cross",
      "legBLeverageMode": "cross",
      "rebalanceDriftPct": 2,
      "targetNotionalUsd": 1000,
      "longTargetNotionalUsd": 1000,
      "shortTargetNotionalUsd": 1000
    }
  },
  "templatePreview": {
    "title": "pair-trade",
    "subtitle": "Long and short balancing with a configurable hedge ratio.",
    "description": "Monitors configured markets and computes hedge requirements each cycle.\nBuilds coordinated long and short orders to express relative exposure.\nUses standardized Hyperliquid execution and normalization helpers in OpenTool.\nIncludes risk-aware sizing controls for budget, leverage, and allocation limits.\nOptimized for repeated autonomous operation with transparent execution logs."
  }
}
Tool Path
tools/pair-trade.js
Input Schema
{
  "type": "object",
  "properties": {
    "to": {
      "type": "integer",
      "minimum": 0
    },
    "from": {
      "type": "integer",
      "minimum": 0
    },
    "mode": {
      "type": "string",
      "const": "backtest_decisions"
    },
    "source": {
      "type": "string",
      "minLength": 1
    },
    "symbol": {
      "type": "string",
      "minLength": 1
    },
    "fundingRates": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "time",
          "rateBps"
        ],
        "properties": {
          "time": {
            "type": "string",
            "minLength": 1
          },
          "rateBps": {
            "type": "number"
          }
        },
        "additionalProperties": false
      }
    },
    "lookbackDays": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "timeframeEnd": {
      "type": "string"
    },
    "timeframeStart": {
      "type": "string"
    },
    "initialEquityUsd": {
      "type": "number",
      "exclusiveMinimum": 0
    }
  },
  "additionalProperties": false
}