# MarketLp

query MarketLp($marketId: ID!) {
  market(id: $marketId) {
    id
    decimalPlaces
    positionDecimalPlaces
    tradableInstrument {
      instrument {
        code
        name
        product {
          ... on Future {
            settlementAsset {
              id
              symbol
              decimals
            }
          }
        }
      }
    }
    data {
      market {
        id
      }
      marketTradingMode
      suppliedStake
      openInterest
      targetStake
      trigger
      marketValueProxy
    }
  }
}

# Liquidity Provisions

fragment LiquidityProvisionFields on LiquidityProvision {
  party {
    id
    accountsConnection(marketId: $marketId, type: ACCOUNT_TYPE_BOND) {
      edges {
        node {
          type
          balance
        }
      }
    }
  }
  createdAt
  updatedAt
  commitmentAmount
  fee
  status
}

query LiquidityProvisions($marketId: ID!) {
  market(id: $marketId) {
    liquidityProvisionsConnection {
      edges {
        node {
          ...LiquidityProvisionFields
        }
      }
    }
  }
}

subscription LiquidityProvisionsUpdate($partyId: ID, $marketId: ID) {
  liquidityProvisions(partyId: $partyId, marketId: $marketId) {
    id
    partyID
    createdAt
    updatedAt
    marketID
    commitmentAmount
    fee
    status
  }
}

# Liquidity Provider Share Fee

fragment LiquidityProviderFeeShareFields on LiquidityProviderFeeShare {
  party {
    id
  }
  equityLikeShare
  averageEntryValuation
}

query LiquidityProviderFeeShare($marketId: ID!) {
  market(id: $marketId) {
    id
    data {
      market {
        id
      }
      liquidityProviderFeeShare {
        ...LiquidityProviderFeeShareFields
      }
    }
  }
}

subscription LiquidityProviderFeeShareUpdate($marketId: ID!) {
  marketsData(marketIds: [$marketId]) {
    liquidityProviderFeeShare {
      partyId
      equityLikeShare
      averageEntryValuation
    }
  }
}
