API
Hydro
Queries

Hydro Queries

Get a Plan

With this query you can get a specific plan's information.

Authenticated Endpoint: requires an API key

See it in the Apollo Explorer here (opens in a new tab).

Query

query GetLiquidityPlan($planId: String!) {
  getLiquidityPlan(plan_id: $planId) {
    id
    is_deleted
    is_enabled
    metric
    one_time_plan {
      date
      demand
    }
    pubkey
    recurring_plan {
      demand
      frequency_minutes
    }
    value_check_plan {
      frequency_minutes
      operator
      trigger_value
    }
  }
}

Variables

{
  "planId": null
}

Get All Plans and Demands

With this query you can get all the plans and the liquidity demands assigned to your account.

Authenticated Endpoint: requires an API key

See it in the Apollo Explorer here (opens in a new tab).

Query

query GetUserLiquidityInfo {
  getUser {
    liquidity_automation {
      demand {
        balance
        history {
          amount
          created_at
          payload {
            id
            reason
            type
          }
          tx_type
        }
        pending_balance
        pubkey
        trigger_monitor_values {
          capacity
          inbound_liquidity
        }
      }
      liquidity_plans {
        id
        is_deleted
        is_enabled
        metric
        one_time_plan {
          date
          demand
        }
        pubkey
        recurring_plan {
          demand
          frequency_minutes
        }
        value_check_plan {
          frequency_minutes
          operator
          trigger_value
        }
      }
    }
  }
}