Friday, December 30, 2022

Graph pop-answer: removing dead-end paths

Graph pop-answer: the solution is to subtract (sub-)graphs from the FIN graph, and the answer lives on queries.cyp.


To remove the ATOM/OSMO order book, we remove all ratios between the two, thusly:

match (n:Coin { name: 'ATOM'})-[r]-(n1:Coin { name: 'OSMO'})
delete r

To remove all references to $SCRT and $STARS, we remove those tokens from the graph:

match (n:Coin)
where n.name in ['SCRT', 'STARS']
detach delete n

Now, there's a danger here. We are destroying the FIN graph-structure.

An entirely safer approach is to imbue each ratio with a risk-factor, then rank paths by risk. That way, as these order books become viable, we haven't lost these paths as we do with this approach.

No comments:

Post a Comment