Skip to content

Instantly share code, notes, and snippets.

View buddies2705's full-sized avatar
🏠
Working from home

Gaurav buddies2705

🏠
Working from home
  • Bangalore
View GitHub Profile
@buddies2705
buddies2705 / 1Paykw4s2WX4SaVjDrQkwSiJr16AiANhiM.csv
Created October 27, 2020 22:14
1Paykw4s2WX4SaVjDrQkwSiJr16AiANhiM
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 3.
[
{
"symbol": "BTC",
"direction": "outbound",
"path": [
{
"depth": 1,
"block": 654328,
"tx_time": "2020-10-26 05:55:30",
"amount": 2,
@buddies2705
buddies2705 / 0x6fdc428d10baec5e4a114363d261c3f56b4aadb9.json
Created October 27, 2020 20:45
0x6fdc428d10baec5e4a114363d261c3f56b4aadb9
{
"symbol": "ETH",
"token_id": 0,
"token_type": "",
"token": "0x0000000000000000000000000000000000000000",
"direction": "inbound",
"path": [
{
"depth": 1,
"block": 11128247,
@buddies2705
buddies2705 / CrudApp.sol
Last active June 21, 2021 19:58
Solidity Crud Smart Contract
pragma solidity ^0.4.23;
contract CrudApp {
struct country{
string name;
string leader;
uint256 population;
}
@buddies2705
buddies2705 / latest_trades_for_currency.ql
Created October 16, 2020 16:01
Latest trades of a specific currency pair on a DEX protocol
{
ethereum(network: ethereum) {
dexTrades(options: {limit: 10, desc: ["block.height", "tradeIndex"]},
protocol: {is: "Uniswap v2"},
buyCurrency: {is: "0xdac17f958d2ee523a2206206994597c13d831ec7"},
sellCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}) {
block {
height
timestamp {
iso8601
@buddies2705
buddies2705 / graphql_example.js
Last active April 14, 2021 09:00
Using GraphQL by Javascript
const query = `
query{
bitcoin{
blocks{
count
}
}
}
`;
const url = "https://graphql.bitquery.io/";
@buddies2705
buddies2705 / graphql_example.rb
Last active April 14, 2021 08:58
GraphQL with Ruby
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://graphql.bitquery.io/")
header = {'Content-Type': 'application/json'; 'X-API-KEY': 'YOUR API KEY'}
query = "{ bitcoin { blocks { count } } }"
# Create the HTTP objects
http = Net::HTTP.new(uri.host, uri.port)
@buddies2705
buddies2705 / monthly_trade_volume_dex.ql
Created October 16, 2020 16:03
Monthly DEX trading volume for a specific Token
{
ethereum(network: ethereum) {
dexTrades(options: {asc: "date.date"},
buyOrSellCurrency: {is: "0xdac17f958d2ee523a2206206994597c13d831ec7"}) {
date {
date(format: "%Y-%m")
}
amount
currency {
symbol
@buddies2705
buddies2705 / latest_trades.ql
Created October 16, 2020 15:59
Latest trades on a DEX Protocol
{
ethereum(network: ethereum) {
dexTrades(options: {limit: 10, desc: "trades"}, protocol:
{is: "Uniswap v2"}) {
protocol
buyCurrency {
symbol
address
}
buyAmount
@buddies2705
buddies2705 / top_DEX_Protocols.ql
Created October 16, 2020 15:58
Top DEX Protocols
{
ethereum(network: ethereum) {
dexTrades(options: {limit: 100, desc: "trades"}) {
protocol
started: minimum(of: date)
trades: count
}
}
}
@buddies2705
buddies2705 / flashloanevent.ql
Created October 2, 2020 12:18
Aave Flashloan events from Bitquery GraphQL APIs
{
ethereum {
smartContractEvents(options: {desc: "block.height", limit: 10},
smartContractEvent: {is: "FlashLoan"},
smartContractAddress:
{is: "0x398eC7346DcD622eDc5ae82352F02bE94C62d119"}) {
block {
height
timestamp {
iso8601