Showing posts with label ontology. Show all posts
Showing posts with label ontology. Show all posts

Monday, May 20, 2024

Entailing Metadata as Data: Cryptocurrency pop-quiz answer

#cryptocurrency part I answer



Representing coins across the Blockaverse as a Voronoi-chart had more snags than I was prepared for:  the javascript equates "$0" to null, leading to some undesirable results. Thus, my cypher query (coins.cyph) entails a null-check-guard. 



This, of course, comes after I upload the token-kinds-data into my @neo4j Blockaverse portfolio ontology with a load-script (token-kinds.cyph)




This is all explained in ./ont

Part II answer


The part I answer entails the part II answer, as you now see that coins.cyph no longer uses a CASE-statement. 

Realizing the metadata as data simplifies the graph.

Q.E.D. 

Sunday, May 19, 2024

Cryptocurrency pop-quiz: realizing metadata as data in a graph

Looking at the answer to the previous #cryptocurrency pop-quiz ("What's my $ETH position?") leaves something to be desired, particularly, a CASE-statement in graph query always, always, always means you're creating a metagraph of the graph.



Creating a meta-graph is all well and good for a quick-n-dirty solution, and that's fine for some.

Not for me.

#cryptocurrency pop-quiz


Create a (meta-)mapping of token-types to tokens, e.g.: 'blue chip' to $BTC, 'stable' to $USDC, etc.

Then, upload that meta-data as a graph.

Part II, pop-quiz:


When you've realized these metadata as data, rewrite the query to entail this embedded knowledge.

Show your work and results.

Cryptocurrency pop-quiz answer: "What's my $ETH position?" as a Voronoi chart

For the #cryptocurrency pop-quiz on "What's my $ETH position?" I went with option 3, creating a cypher query against my @neo4j Blockaverse portfolio ontology.

This approach allows me to map out my positions and their relative strengths in, say, a Voronoi chart. 




Wednesday, May 8, 2024

neo4j ontology of Terra portfolio

Query: Is $KUJI in my @terra_money portfolio?



Response: my portfolio-as-ontology on @neo4j-query

match (t:Token)-->{2}(:Blockchain {name: "Terra"})
return distinct t.name


says 'No.'

Adjusting my tracked-tokens list on that portfolio accordingly.


Friday, May 3, 2024

Rust pop-quiz: deploying liquidity across intersecting domains

#Rust pop-quiz

Okay, we've got domains overlaying protocols to give us liquidity deployed across the Blockaverse!

But, unfortunately, @neo4j doesn't deal well with set-theory, which makes representing intersecting liquidity difficult.

dom.cyph gives protocols, domains, and liquidity, output as records.json

Reduce the result to intersecting domains-vs-liquidity, so that the results can be represented as a Venn diagram.



See the dom README

Cryptocurrency pop-quiz answer: liquidity by domain

#cryptocurrency pop-quiz answer

Rust is not necessary, as a simple @neo4j cypher load-script overlays domains onto protocols


We can now query liquidity by domain to see to what end the liquidity is deployed. 





Thursday, May 2, 2024

Cryptocurrency pop-quiz: mapping domains to protocols

#cryptocurrency pop-quiz:

Create a SPREADSHEETSZORXEN! that maps Domains --v to protocols. 



Write a #Rust program, ./dom, that, from the provided SPREADSHEETSZORxEN!, creates the Domains in a graph database (if not present) and maps those Domains to their respective protocols.
So, the standard view of a blockchain is that it has tokens, transactions, and protocols.

The idea that protocols are purposed into domains (e.g.: "Ghost is a money market") views the blockchain from a different Aspect.

Aspect-orientation cross-cuts standard models.

Aspects, interestingly, can be multiparametric.

 What do I mean?

Take @Levana_protocol: it's both in the Trading-Domain and in the Leverage-Domain.

@NolusProtocol: Trading-, Leverage-, and Leasing-Domains.

This creates incredible flexibility for data visualizations.

Blockaverse portfolio as ontology

"How much liquidity do I have in @TeamKujira Ghost?"

If you upload your portfolio into a (e.g.) @neo4j graph, the question reduces to a graph: 


match (g:Protocol {name: "Ghost"})<-[o:ON]-(t:Token) 
return sum(o.value)

> sum(o.value) = 76.67


A generalization is also possible:

"How much liquidity do I have in ALL money markets?"

Simply by overlaying a new graph of "Money Market" Domain over the Blockaverse-graph, the query becomes simple:




match ()-[o:ON]->(p:Protocol)<--(d:Domain { kind: "Money Market"})


You can also look at things from another way:

"How much $ETH do I have? And on which blockchains?"




Another simple query gives you that answer:

match (t:Token { name: "ETH"})-[o:ON]->()-->(b:Blockchain)
return t.name, b.name, sum(o.value)


SPREADSHEETSZORXEN! are great: all my data are archived on SPREADSHEETSZORXEN!

But when I want to gain insights into my data: what am I doing? Where am I doing it? What's working? What's not? I create an ontology-as-graph (./ont) and start querying that knowledge base, visually.

Wednesday, April 10, 2024

Rust pop-quiz answer: portfolio-as-ontology in neo4j

#Rust pop-quiz answer to the quiz of: portfolio-as-ontology.

Behold! ./ont.



Also, I have a video walkthrough of creating, viewing, and querying the ontology in @neo4j. 

Rust pop-quiz: ontology of integrated cryptocurrency portfolio

#Rust pop-quiz: #cryptocurrency 

Say you have your portfolio data of tokens, blockchains, protocols, say, in the following format.



Read in those data and associate tokens to protocols to blockchains, the output expressed to an ontology of your choice.