Skip to content

Instantly share code, notes, and snippets.

View Nemesis313's full-sized avatar

nemesis Nemesis313

View GitHub Profile
// 1. Import everything
import { Wallet, BigNumber, ethers, providers } from 'ethers'
const { FlashbotsBundleProvider, FlashbotsBundleResolution } = require('@flashbots/ethers-provider-bundle')
/*
Mainnet
const provider = new providers.JsonRpcProvider('https://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh')
const wsProvider = new providers.WebSocketProvider('wss://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh')
*/
@noxx3xxon
noxx3xxon / arbitrage.py
Created August 21, 2022 22:34
CFMM Routing Arbitrage Example
import numpy as np
import cvxpy as cp
import itertools
# Problem data
global_indices = list(range(4))
# 0 = TOKEN-0
# 1 = TOKEN-1
# 2 = TOKEN-2
@gorgos
gorgos / MultiSwap.sol
Created August 22, 2021 11:04
Example for how to swap multiple tokens in one on Ropsten
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol";
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/IQuoter.sol";
import {IERC20, SafeERC20} from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC20/SafeERC20.sol";
interface IUniswapRouter is ISwapRouter {
@ader1990
ader1990 / gist:89c70957182cf7f4055179a746202ffb
Last active August 2, 2021 10:12
Install webdollar on android
# How to install and run WebDollar on Android Linux console
# Requires Android 9
# Install termux from
# https://play.google.com/store/apps/details?id=com.termux&hl=en_US
# Install AnLinux
# https://play.google.com/store/apps/details?id=exa.lnx.a
# Follow the instructions from AnLinux for Ubuntu installation from AnLinux