🎉 Welcome to PartyFinance documentation!
Subgraph

Subgraph

Built With

TheGraph Subgraph Studio:

Polygon (ChainID: 137)

https://thegraph.com/studio/subgraph/partyfinance-polygon/

Mainnet (ChainID: 1)

https://thegraph.com/studio/subgraph/partyfinance-mainnet/

TheGraph Hosted Service:

Polygon (ChainID: 137)

https://thegraph.com/hosted-service/subgraph/party-finance/partyfinance-polygon

Görli (ChainID: 5)

https://thegraph.com/hosted-service/subgraph/party-finance/partyfinance-goerli

Optimism (ChainID: 10)

https://thegraph.com/hosted-service/subgraph/party-finance/partyfinance-optimism

Mainnet (ChainID: 1)

https://thegraph.com/hosted-service/subgraph/party-finance/partyfinance-mainnet

Queries

Query a party deposits

Get a party deposits.

{
  party(id: "0x4d7aa10ffea6a07baad0dd05b68f160c9579d08d") {
    denominationAsset {
      id
      name
      symbol
      decimals
    }
  }
  sharesBoughtEvents(where: {party: "0x4d7aa10ffea6a07baad0dd05b68f160c9579d08d"}, orderBy: timestamp) {
    investor {
      id
    }
    timestamp
    asset {
      id
    }
    investmentAmount
  }
}

Query a party portfolio history

Get a party portfolio history.

{
  party(id: "0x4d7aa10ffea6a07baad0dd05b68f160c9579d08d") {
    name
    portfolioHistory {
      timestamp
      holdings {
        asset {
          name
          symbol
        }
        amount
      }
    }
  }
}

Query a party shares history

Get a party portfolio history.

{
  party(id: "0x4d7aa10ffea6a07baad0dd05b68f160c9579d08d") {
    name
    sharesHistory {
      timestamp
      totalSupply
    }
  }
}

Query if a party ID is a valid party

Get party if it exists.

{
  party(id: "0x4d7aa10ffea6a07baad0dd05b68f160c9579d08d") {
    id
    name
    bio
    img
    model
    purpose
    isPublic
    isClosed
    minDeposit
    maxDeposit
    membersCount
    denominationAsset {
      id
      symbol
      decimals
    }
    portfolio {
      holdings {
        asset {
          id
          name
          symbol
        }
        amount
      }
    }
  }
}

Query a party by name

  parties(where: {name: "LOL"}) {
    id
    creator
    manager
    name
    bio
    img
    model
    purpose
    isPublic
    minDeposit
    maxDeposit
    inception
    isClosed
  }

Query to fetch available parties

Get party if it is public and not closed.

{
  parties(where: {isPublic: true, isClosed: false}, orderBy: inception) {
    id
    name
    bio
    img
    model
    purpose
    isPublic
    minDeposit
    maxDeposit
    denominationAsset {
      id
      decimals
    }
    manager {
      id
    }
    isClosed
  }
}

Query a user

Get the user entity.

  user(id: "0x94b99167d1ffc064901d8a3a9bfd8c2b0f39103b") {
    id
    firstSeen
    manager
    managerSince
    investor
    investorSince
  }

Query party members

Get party members

{
  user(id: "0x7fd0c5bde1e12629cd16f3f57793add7b62ffdc0") {
    parties(first: 1000) {
      party {
        id
        name
      }
      joinedSince
      leftAt
      status
    }
  }
}

Query to fetch a specific party information

Fetch a specific party information.

{
  party(id: "0x4d7aa10ffea6a07baad0dd05b68f160c9579d08d") {
    id
    name
    bio
    img
    model
    purpose
    isPublic
    isClosed
    minDeposit
    maxDeposit
    membersCount
    denominationAsset {
      id
      symbol
      decimals
    }
    portfolio {
      holdings {
        asset {
          id
          name
          symbol
        }
        amount
      }
    }
  }
}

Query to fetch a specific member joined parties

Fetch a specific member joined parties.

{
  user(id: "0x7fd0c5bde1e12629cd16f3f57793add7b62ffdc0") {
    parties(where: {status: Joined}) {
      party {
        id
        name
      }
      joinedSince
      leftAt
      status
    }
  }
}

Query to fetch a specific party transactions (swaps)

Fetch a specific party transactions.

{
  tokenSwaps(where: {party: "0xa112e1441820b8f75b5905a0495a6e344f855c65"}) {
    sellToken {
      id
      name
      symbol
      decimals
    }
    buyToken {
      id
      name
      symbol
      decimals
    }
    soldAmount
    boughtAmount
    transaction
    timestamp
  }
}

Query to fetch a specific party join requests

Get a party join requests, those invoked by the joinRequest method for private parties.

{
  joinRequests(where: {party: "0x5c1eda5c26c33d4c3c055f57d2bbfa9eebad2051", handledAt: null, status: Requested}) {
    user {
      id
    }
    requestedSince
  }
}

Query to fetch a specific party managers

Get the list of managers from a party.

{
  userParties(where: { party: "0x5c1eda5c26c33d4c3c055f57d2bbfa9eebad2051", isManager: true }) {
    user {
      id
    }
    managerSince
  }
}

Query to fetch a specific party token gating

Get a party token gating. This is the restriction for any user that is not part of the Party.

{
  partyTokenGate(id: "0x5c1eda5c26c33d4c3c055f57d2bbfa9eebad2051") {
    party {
      id
      name
    }
    tokens {
      token
      name
      symbol
      type
      value
    }
  }
}

Query to fetch a specific party investment cost and value

Get a party investment cost and current value. Investment cost consists on the total deposits minus the total withdrawals made into the party. The current party value is the current USD sum of all its current holdings

{
  party(id: "0x0243b9787150bf8a022ee8866807495909893cb1") {
    name
    investmentCost {
      totalDeposits
      totalWithdrawals
      value
      withUncalculatedPrices
      deposits {
        investmentAmount
        fee
      }
      withdrawals {
        redeemedAmount
        fee
        redeemedAmounts {
          asset {
            symbol
          }
          amount
          price
        }
      }
    }
    portfolio {
      value
      withUncalculatedPrices
      holdings {
        asset {
          symbol
        }
        amount
        price
      }
    }
  }
}