Tyler van der Hoeven
2 min readMar 28, 2018

List out all accounts who trust USD from issuer X

query {
allTrustlines(
filter: {
assetcode: {equalTo: "USD"},
issuer: {equalTo: "GCNVBFN3GLYI4YXR5CW7MKIVN2UIMMJOKNVB7PRJG7ZDOHSREL6KTY2T"},
}
) {
nodes {
accountid
balance
}
}
}

Show me all the trustlines for issuer X

query {
allTrustlines(
filter: {
issuer: {equalTo: "GCNVBFN3GLYI4YXR5CW7MKIVN2UIMMJOKNVB7PRJG7ZDOHSREL6KTY2T"}
}
) {
nodes {
assetcode
tlimit
}
}
}

Which accounts haven’t yet set an inflation destination?

query {
allAccounts(
first: 10
filter: {
inflationdest: {isNull: true}
}
) {
totalCount
nodes {
accountid
balance
inflationdest
}
pageInfo {
endCursor
startCursor
hasPreviousPage
hasNextPage
}
}
}

List all accounts ordered by their XLM volume

query {
allAccounts(
first: 10
orderBy: BALANCE_DESC
) {
totalCount
nodes {
accountid
balance
}
pageInfo {
endCursor
startCursor
hasPreviousPage
hasNextPage
}
}
}

Rank accounts based on their level of “trust” throughout the network

This would be a more involved example as you’d need to determine what trust actually meant for your use case. In my mind let’s say some account was offering you a fiat or standard but non native asset. A USD, BTC or LOAN token. Token names are not unique, it’s a pair of both the asset name and the issuer address. Anyone can issue a USD, BTC, XLM or LOAN asset, it’s only if you trust both the asset and the issuer that you should actually accept anything from anyone. One way to test that trust level or at least measure it would be to rank asset issuers based on the number of other accounts who trust that asset. It’s not a bullet proof solution as a bad actor could create thousands of “fake” accounts and simply create a trustline back to their fraudulent issuer account. You’d likely want to test / rank by number of trustlines as well as a volume of activity / history as well as duration or lifespan of an account. Giving preference or greater weight to accounts which were created before the issuer account in question but who now trust the asset / issuer of the account in question.

This obviously wouldn’t be a single query but rather a service mixing several queries together and parsing the responses in a meaningful manner to return a sort of risk level for any given asset or issuer.

A service like this would actually be pretty simple to make but incredibly useful. Enter an asset and get the most trusted issuer for that asset as a response. Enter an issuer and get their risk value back to test how trustworthy they are.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Tyler van der Hoeven
Tyler van der Hoeven

Written by Tyler van der Hoeven

Engineering better financial futures @StellarOrg through funding, education and innovation. I write my own words. — “Work, and stuff will happen.”

No responses yet

Write a response