Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 6 columns, instead of 4 in line 8.
token_amount,end_block,start_block,borrower,account,no_of_block
2.362284676443115,124577008,124334809,0xce721a2b363c73cb22B00b9863C2fEbC79fAf369,0x1EFc7AC70D81ADe486dB80eE5B9D873Cbc1aaC4a,242199
1.5748453380906857,124577008,124334830,0xC52Ad39F7EE32b0AA3BBd54468f5984f0bDA48CB,0x76a06ea97b0d4c92810e33B5B79Ce8d44c8fe5AD,242178
31.408559668163395,124334958,124334910,0xDB611d682cb1ad72fcBACd944a8a6e2606a6d158,0x59394541ADC04949fE9EFF8939f1cf6c1a58e7b0,48
144.25110214116935,124577008,124334858,0xD360EcB91406717Ad13C4fae757b69B417E2Af6b,0x5c709EDF28053eAe6A7AfE925A9c91893DF5AbAf,242150
51.08782067436718,124334986,124334972,0xDB611d682cb1ad72fcBACd944a8a6e2606a6d158,0x59394541ADC04949fE9EFF8939f1cf6c1a58e7b0,14
31.408559668163395,124334972,124334958,0xDB611d682cb1ad72fcBACd944a8a6e2606a6d158,0x59394541ADC04949fE9EFF8939f1cf6c1a58e7b0,14
51.08782067436718,124335003,124334986,0xDB611d682cb1ad72fcBACd944a8a6e2606a6d158,0x59394541ADC04949fE9EFF8939f1cf6c1a58e7b0,17
70.75848533096406,124335058,124335040,0xDB611d682cb1ad7
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 6 columns, instead of 1 in line 7.
session, user, avg_total_value, started_ts, closed_ts, usd_value*holder_period
0x4F2174380779a2525Fbe456Fe34e22D8505907e8_19367865_91, 0x5C3f8fDc2c99cD27576F36d13446F33c58e67a24, 81769.861984, 1709628455, 1710342887, 58419006037.260063
0xfc016282EA04e10E84C54e5cBC038c8e0F5fbA2D_18919949_271, 0x0e53986793fD99012f2BF78d47dF89e2ed8C2290, 181232.835766, 1704201539, 1704878915, 122762773359.805511
0x80e4ca0b82783CCB26bEf2B6FFc60CeCE2B5AAf0_19372408_10, 0x3ef5BECf7be659186a21A8B0DcCfcc583B0De69F, 148391.085392, 1709683175, 1709684231, 156700986.173482
0x548AF8808a6e0f736ffd567941e487311fF3DCC7_18992873_13, 0xCcbA00c0f9d994389B38fb907fe35fF97b7008C8, 469644.874974, 1705087343, 1708908119, 1794407866822.521484
0x192B7cE3fe2208924CEAE2D2C70D5beCBb1539dd_18838373_130, 0xba5d74913ca02d12532fB9710d469A32198a501E, 43441.721192, 1703211599, 0, 720281157501.817749
0xBa6F97bD4ef979858ac290b4C07E82A3f9964F22_19934526_4, 0xc4900871ad90b33018ac521D0F8C003c3ee79d50, 87861.720197, 1716490787, 1716506135, 1348501681.576553
0x479a
@harsh-98
harsh-98 / arb campaign 4.csv
Last active September 17, 2024 10:40
stimmies
user points
0xc11c720C554db80A89FfEA960633429be61c6a10 2368702.110139
0x1395f53B0472827c78964316a7f5595f302e10c9 952985.170615
0x0e2852b070fbF866acecb93DeC04b91F02804cFE 909932.757591
0x125DBE70459b36A4C71664DcC97224EafEb4AeE0 879781.875390
0xc2eDdAE2045D48223166d1CAB66fED3c7C97c9d6 606844.734529
0x4F0A01BAdAa24F762CeE620883f16C4460c06Be0 592695.909550
0xDB611d682cb1ad72fcBACd944a8a6e2606a6d158 571670.720549
0xb808F3E9fd1D124b9c3504b5f60fCBb641D29384 423432.324400
0x36B57d9d1E3388aF84E40be2197EE70208c040ef 417648.036808
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 5 columns, instead of 2 in line 8.
User,Token,avgValue=sigma/HowLongAgoFirstDeposit,HowLongAgoFirstDeposit, sigma[deposit*(1julyts-depoitts)-withdraw*(1julyts-withdrawts)]
0xE9548dE676021a1085A28Be7c4E9c8Da623F52f8,0x82aF49447D8a07e3bd95BD0d56f35241523fBab1,0.412122,3188760,1314157.787497
0xD4fE31E0005cF3Be991868d43Cb8bb61a6207A50,0x82aF49447D8a07e3bd95BD0d56f35241523fBab1,0.159495,2961791,472389.684185
0x36C9fdBF2EaFdb64F0082bE0E824Dc4605603E71,0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8,615.228666,2113587,1300339309.466808
0xBd9fcE89358c6897692a99C3717c370AB9d0cc35,0x82aF49447D8a07e3bd95BD0d56f35241523fBab1,0.099508,7177122,714181.898781
0x58Fc8a5d2bc89Dc1a353537271a217a6f64c92A4,0x82aF49447D8a07e3bd95BD0d56f35241523fBab1,858.587264,7022336,6029288253.128704
0xC929fD701A001518dAefaf870A40e8bDc4E3766d,0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8,66.213349,516442,34195354.572226
0x6B1c3D31e59790d40ecb09a5e11431d0C8a1d1E6,0x82aF49447D8a07e3bd95BD0d56f35241523fBab1,0.354947,8844967,3139494.766645
0x61f59CE34a5502493074257b2598457Bf6B2F242,0x82aF494
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 13 columns, instead of 5 in line 7.
Date,BlockNum,ezETH,wstETH,cbETH,rETH,USDe,WBTC,WETH,LINK,GMX,PENDLE,ARB
2024-07-05,228769400,1175499.127076,49989.925614,0.000000,726484.146254,1029876.729700,0.000000,435103.218160,0.000000,0.000000,0.000000,802.734900
2024-07-06,229120406,1563987.015121,1216352.567862,0.000000,877833.550869,2289303.841861,0.000000,898435.498263,0.000000,0.000000,0.000000,698.332800
2024-07-07,229496377,1624891.622776,1558981.443974,0.000000,899392.588944,2531527.141096,0.000000,978703.277833,0.000000,0.000000,0.000000,776.767455
2024-07-08,229851421,1572879.392524,1505022.105604,0.000000,868378.723682,3274020.153516,0.000000,919127.974732,0.000000,0.000000,0.000000,741.922500
2024-07-09,230206028,1610612.642829,1628190.338895,0.000000,889573.095693,3764213.197070,0.000000,1036009.598897,0.000000,0.000000,0.000000,750.662633
2024-07-10,230581596,1430847.254555,2280765.615407,0.000000,867170.040994,4081398.262274,0.000000,947849.727687,0.000000,0.000000,0.000000,793.927200
2024-07-11,230961536,1437998.253231,2543981.800197,0
package main

import (
	"math/big"

	"github.com/Gearbox-protocol/go-liquidator/config"
	"github.com/Gearbox-protocol/go-liquidator/ethclient"
	"github.com/Gearbox-protocol/sdk-go/core"
	"github.com/Gearbox-protocol/sdk-go/log"
type LastTs mutex[[]int64]
REQUEST_PER_PEER = 10
func (l LastTs) check() error {
l.lock()
l.unlock()
fiveMinAgo:=time.Now().Sub(5*Second).Unix()
streamBeforeFiveMin = sort.Search(len(l), func(i int) bool { return l[i] >= fiveMinAgo })
if len(l) - streamBeforeFiveMin > REQUEST_PER_PEER {
@harsh-98
harsh-98 / connect.md
Last active May 30, 2023 19:54
websocket for trading app

wss://gearbox-ws.fly.dev/ws

Send ->

{"type":"subscribe:Updates", "data":{ "borrower":"0x1B3dfF537b7d46A0d30B1D20b101c483586747AA"}}

Receive updates in form of:

{
  "address": "0xD3BeD41dc971225a759fFd6122Af3b40Da1e882C",
@harsh-98
harsh-98 / a.sql
Last active January 26, 2023 14:00
init collateral+ total borrowedamount
borrow_amt | borrow_usd | init_col | col_usd | underlying_token
--------------------+--------------------+-------------------+--------------------+--------------------------------------------
16992380.838408105 | 16995650.68225284 | 2978216.706608446 | 2978789.8048492973 | 0x6B175474E89094C44Da98b954EedeAC495271d0F
14837.437708756617 | 23430508.59916383 | 3018.486498765127 | 4766636.615703305 | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
26601062.457343996 | 26601062.457343996 | 4889989.477375998 | 4889989.477375998 | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
with t1 as (select underlying_token, account, init_col*price col_usd, init_col, borrow_amt , borrow_amt *price borrow_usd, (borrow_amt+ init_col)*price total_usd from
@harsh-98
harsh-98 / doc.md
Last active January 24, 2023 16:40
Calculating trade volume on gearbox v2

All the operations done on v2:

 depositAll(uint256,bool)
 CloseCreditAccount(address,address)
 swapExactTokensForTokens(uint256,uint256,address[],address,uint256)
 withdrawAndUnwrap(uint256,bool)
 unwrap(uint256)
 exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160))
 DecreaseBorrowedAmount(address,uint256)