Skip to content

Instantly share code, notes, and snippets.

@Galahad091
Galahad091 / bellman_ford.go
Created September 20, 2022 01:33 — forked from ewancook/bellman_ford.go
Arbitrage with Bellman Ford
package bellmanford
import (
"math"
)
// Graph represents a graph consisting of edges and vertices
type Graph struct {
edges []*Edge
vertices []uint
@Galahad091
Galahad091 / arbitrage.py
Created September 15, 2022 08:11 — forked from noxx3xxon/arbitrage.py
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
@Galahad091
Galahad091 / MultiSwap.sol
Created August 10, 2022 17:09 — forked from gorgos/MultiSwap.sol
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 {