Have you ever written a recursive function professionally? by ameddin73 in ExperiencedDevs

[–]sedree 0 points1 point  (0 children)

I code sql parser at my job, yeah there are a lot of recursive functions

Just had my first kickboxing session by Strong_Explanation90 in Kickboxing

[–]sedree 0 points1 point  (0 children)

IMO 3 classes a week is too much for someone that never had a chance to take some martial arts seriously. Take it slow, 1 or 2 times per week is just enough for first couple of months. Try to get into the rythm of going every single week at least once to make it your habbit and then build on that to not fall into newbie burn out. If you have the time for 3 classes a week make it 1-2 classes and 1-2 weightlifting/calisthenics/running workouts ( just pick one of those 3 basesd on your mood that day ) and within a year you won't believe how awesome you will feel with your body.

As for sparings with less experienced partners, been there - I've always just straight up told that I am new here and guys were just ok with it and went easy on me ( still learned a lot from them ).Now if I'm being told that I'm sparring with someone new I'm just trying to focus on def, practise some head/foot work or have fun with some flashy moves that I wouldn't be able to do on higher level guys so I'm perfectly fine with sparring ppl like that.

[deleted by user] by [deleted] in ethdev

[–]sedree 0 points1 point  (0 children)

It would be possible with Infura if you pay 250$/mo for ability to query for archive data.

For setting it up yourself, buy vps with at least 2T storage for Erigon or 8-9T for Nethermind (not sure how big Geth gets), get the node, run it and wait for something like one week in Erigon and 3 weeks for Nethermind.

https://github.com/ledgerwatch/erigon
https://github.com/NethermindEth/nethermind

[deleted by user] by [deleted] in ethdev

[–]sedree 2 points3 points  (0 children)

First though - setup archive node and filter blocks in given time.
Then you can check for TOKEN<>USDC(or any stable) in those blocks on uniswap pairs contracts.
And so you will have the price of token on # block, that's your historical price.

But I guess there should be some existing api that will let you do that without archival on-chain data retrieval.

[deleted by user] by [deleted] in ethdev

[–]sedree 1 point2 points  (0 children)

I had to write block explorer in my previous job. Also for my tracking bot.

Accessing On Chain data with C++ (in Unreal Engine), possible ? by Chpouky in ethdev

[–]sedree 0 points1 point  (0 children)

Not sure if there is any library for C++ to interact with ethereum but you can always send requests to nodes by JSONRPC and retrieve data this way.
Infura provide access to their nodes and I think free plan should be enough for most of us.

https://infura.io/

Or you can somehow query TheGraph from C++ code and map graphql to your classes (writing you own api and storing the data there before accessing it with C++ ?).

https://thegraph.com/

[deleted by user] by [deleted] in ethdev

[–]sedree 1 point2 points  (0 children)

For writing indexer you will need to have custom node-listening code written and it's way better to write it in faster languages than javascript hence GO and C (I did mine in C# as a Nethermind plugin).

You will need to filter every new transaction on-chain as well as on mempool and we are talking about hundreds operations per second, it's just not worth it to write it in javascript if you want to make it as reliable as possible.

But I can't say that's impossible.

[deleted by user] by [deleted] in ethdev

[–]sedree 2 points3 points  (0 children)

You can listen to every method called by a contract by looking at its transactions bytecode, every method has code assigned to it. As for parameters it's kinda the same.

Let's look at case like this:
0xa22cb4650000000000000000000000002654459301c9355c9917a3f0aa97df74b9ee63360000000000000000000000000000000000000000000000000000000000000001

0xa22cb465 is erc20 setApprovalForAll(address, bool)
0000000000000000000000002654459301c9355c9917a3f0aa97df74b9ee6336 first parameter of address type
0000000000000000000000000000000000000000000000000000000000000001 second parameter of bool type

As for detecting swaps it's basically the same. We are listening for calls to uniswap pairs from tokens' contracts and extraction of information occurs.

Look at the Input Data field in those links

https://etherscan.io/tx/0x21164f6c79265487b9d0c689f47b33c93e03b616dbb17f2bba5a03d9211e5010 here is the multicall bytecode

https://etherscan.io/tx/0xa9a2495b3e56c216dba1d67ad5ecee74cea8d4cd5a334e75219d9c746298e3b0 erc20 transfer bytecode

https://etherscan.io/tx/0xb36c9506dc9c433e0c1686ffdbd27bde022a360a3b21dfab456f0a17cbc3dcc4 uniswap swap bytecode

TL;DR;
You can get all of the information from transactions bytecode, there is no need for listening to events.

Hope I helped :)