I really wanted to add an event management system to dYdX's microservices to allow for more accurate updates on the position, poeple who are lending, and unfortunately web3.js's event module was not sufficient for me.

The JSON-RPC actually doesn't support event management that well. When you query for events you have to call eth_installFilter which will only get you events from when that filter is installed. The graph protocol allowed me to index events and query them super easily using GraphQL

What it does

It was supposed to tweet out when positions were being margin called, increased, or the liqudity was added for the lender. it only worked reliably about 10% , and i was running my own node, which could have been an issue as well.

How I built it

Challenges I ran into

it either would straight up go past the block in which the transaction was confirmed and not index it, or index it way later, the twitter bot produced about 5-6 tweets but i regrettably deleted because i wanted it to be clear for a demo and then i never got a tweet out again :(.

Accomplishments that I'm proud of

Meeting the graph protocol team Learning a lot more about event management on ethereum

What I learned

so much. graphql, assemblyscript, ipfs hashing,

What's next for Margin Troll (GraphProtocol X dYdX)

Well, I really really like the team and the idea behind the protocol. the protocol is obviously new and up and coming but it's a novel idea. I hope that this idea will come to fruition if I had more time to deliberate on the bugs that caused this project to go awry.

Built With

Share this project: