---
# System prepended metadata

title: Highly engaged - protocol usage

---

# Highly engaged - protocol usage


## Identify people who are highly engaged in the governance of selected token
```
with
    tolower($address) as add
match
    (w:Wallet)-[r:VOTED]->(p:Proposal)-[:HAS_PROPOSAL]-(e:Entity)-[:HAS_STRATEGY]-(t:Token {address: add})
with 
    w, count(distinct(r)) as votes, add
with 
    apoc.agg.percentiles(votes, [.8])[0]  as threshold, add
match
    (w:Wallet)-[r:VOTED]->(p:Proposal)-[:HAS_PROPOSAL]-(e:Entity)-[:HAS_STRATEGY]-(t:Token {address: add})
with
    w, count(distinct(p)) as votes, threshold, add
where
    votes > threshold
match
    (w)
match
    (e:_Element:_Token {address: $add})
with 
    w,e 
merge
    (w)-[:HIGHLY_ENGAGED]->(e)
return
    count(distinct(w)) as count
```

## Identify close associates

### Voters
```
with 
    tolower($address) as add
match 
    (w:Wallet)-[:HIGHLY_ENGAGED]->(element:_Element:_Token {$address: add})
match 
    (w)-[:VOTED]->(p:Proposal)-[:VOTED]-(x:Wallet)
where not
    (x)-[:HIGHLY_ENGAGED]->(element)
and not 
    (p)-[:HAS_PROPOSAL]-(e:TooBig)
with
    w, element
merge
    (w)-[r:HIGHLY_ENGAGED]->(element)
set
    r.type = 'Voting'
return 
    count(distinct(r))
```

### Grants

```
with 
    tolower($address) as add
match 
    (w:Wallet)-[:HIGHLY_ENGAGED]->(element:_Element:_Token {$address: add})
match 
    (w:Wallet)-[:DONATION]->(y:Grant)-[]-(x:Wallet)-[:_HAS_CONTEXT]-(context)
where not 
    y:TooBig
and not
    (x)-[:HIGHLY_ENGAGED]->(element)
where not 
    context:_IncentiveFarming
and not 
    y:TooBig
merge
    (x)-[r:HIGHLY_ENGAGED]->(elements)
set
    r.type = "Grants"
return 
    count(distinct(r))
```

### Tokens

```
with 
    tolower($address) as add
match 
    (w:Wallet)-[:HIGHLY_ENGAGED]->(element:_Element:_Token {$address: add})
match
    (w:Wallet)-[r:HOLDS]->(token:Token:ArtisanToken)<-[:HOLDS]-(x:Wallet)
where not 
    y:TooBig
and not
    (x)-[:HIGHLY_ENGAGED]->(element)
where not 
    context:_IncentiveFarming
with
    x, element
merge
    (x)-[r:HIGHLY_ENGAGED]->(element)
set
    r.type = "Tokens"
```

## Delete outside of scope

```
call apoc.periodic.commit('
with 
    tolower($address) as add
match 
    (w:Wallet)-[mem:HIGHLY_ENGAGED]->(element:_Element:_Token {$address: add})
where 
    (w:Wallet)-[r:_HAS_CONTEXT]->(:_IncentiveFarming)
with 
    mem
limit
    5000
return 
    count(*)
    ')
```


### Incentive Farmers

```
call apoc.periodic.commit('
with 
    tolower($address) as add
match 
    (w:Wallet)-[mem:HIGHLY_ENGAGED]->(element:_Element:_Token {$address: add})
match
    (w)-[:_HAS_CONTEXT]->(:_IncentiveFarming)
with 
    mem
limit
    5000
delete 
    mem
return
    count(*)
```

### People who don't have at least one of the filters

```
call apoc.periodic.commit('
match
    (c:_Context)
where
    [x in labels(c) in $personas]
with
    c, tolower($address) as add
match 
    (w:Wallet)-[mem:HIGHLY_ENGAGED]->(element:_Element:_Token {$address: add})
where not
    (w)-[:_HAS_CONTEXT]->(c)
with 
    w, mem
limit
    5000
delete
    mem
return
    count(*)
```



## Add others

### Topics

// make sure to lowercase `$address`

```
CALL db.index.fulltext.queryNodes("wicDiversity", "$query", {limit:100000}) YIELD node, score
with node, score
unwind node as nn
order by score desc
limit 2500
match (:_Context)-[]-(w:Wallet)-[]-(nn)
match (e:_Element {address:$address})
optional match (wallet)-[]-(:Nft)-[:HAS_NFT]-(nn)
optional match (wallet)-[:HAS_ALIAS]-(:Alias)-[:HAS_ALIAS]-(t:Twitter)-[:REFERENCES]-(nn)
where not (w)-[:HIGHLY_ENGAGED]->(element)
and not (w)-[:_HAS_CONTEXT]->(:_IncentiveFarming)
with w, element
merge (w)-[r:HIGHLY_ENGAGED]->(element)
return count(*)
```



### Co-signers that aren't trash

`lower case address`

```
match 
    (w:Wallet)-[r:HIGHLY_ENGAGED]->(element:_Element {address: $address})
match
   (:_Context)-[:_HAS_CONTEXT]-(x:Wallet)-[:_IS_SIGNER]-(m:MultiSig)-[:_IS_SIGNER]-(w)
where not
    (x)-[:HIGHLY_ENGAGED]->(element)
with
    x, element
merge
    (x)-[r:HIGHLY_ENGAGED]->(element)
set
    r.type = "Multisig-Cosigners"
return
    count(r)
```
    


## Todo

### Twitter

### Mirror

### Github