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"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
wss://gearbox-ws.fly.dev/ws
Send ->
{"type":"subscribe:Updates", "data":{ "borrower":"0x1B3dfF537b7d46A0d30B1D20b101c483586747AA"}}
Receive updates in form of:
{
"address": "0xD3BeD41dc971225a759fFd6122Af3b40Da1e882C",
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ConvexBooster": { | |
"methods": [ | |
"depositAll", | |
"deposit2", | |
"withdraw2", | |
"withdrawAll" | |
], | |
"stat": { | |
"CONVEX_BOOSTER": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"os" | |
"github.com/Khan/genqlient/graphql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%lang starknet | |
from starkware.cairo.common.math import (signed_div_rem, sqrt) | |
from starkware.cairo.common.cairo_builtins import HashBuiltin | |
const FP = 10 ** 12 | |
const RANGE_CHECK_BOUND = 2 ** 64 | |
const FRICTION = 40 * FP | |
@event | |
func increase_balance_called( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/Gearbox-protocol/sdk-go/artifacts/poolService" | |
"github.com/Gearbox-protocol/sdk-go/core" | |
"github.com/Gearbox-protocol/sdk-go/core/schemas" | |
"github.com/Gearbox-protocol/sdk-go/ethclient" | |
"github.com/Gearbox-protocol/sdk-go/log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hdkey = require('hdkey') | |
const bip39 = require('bip39') | |
const ethUtil = require('ethereumjs-util') | |
const BigNumber = require('bignumber.js'); | |
require('dotenv').config() | |
function hdwallet(){ | |
let mnemonic , seed; | |
if (! process.env.MNEMONIC) { | |
mnemonic = bip39.generateMnemonic(); //generates string | |
} else { |
NewerOlder