Skip to content

Instantly share code, notes, and snippets.

View ArpitxGit's full-sized avatar
🎯
Focusing

dungexn ArpitxGit

🎯
Focusing
View GitHub Profile

The goal is to

  • Continuously monitor the impermanent loss incurred for a position in Uniswap V3
  • And if there is a loss, we need to exit the position
  • It has to be 100% automated (the end user should not be expected to be online signing the transaction when the liquidity is pulled out)

Monitoring a position

We can use the Uniswap V3's subgraph to know a position's details like tokens, price at the time of providing liquidity, etc. We will also know the current tick in the pool.

@shobhitic
shobhitic / FreeMintToken.sol
Last active January 20, 2023 18:57
Free Mint NFT Smart Contract + UI - https://www.youtube.com/watch?v=5tSKO9WjF7E
// SPDX-License-Identifier: MIT
// Made by @Web3Club
pragma solidity ^0.8.4;
import "erc721a/contracts/ERC721A.sol";
contract FreeMintToken is ERC721A {
uint256 public constant USER_LIMIT = 10;
@karmacoma-eth
karmacoma-eth / sending-ether-cheat-sheet.md
Last active June 14, 2024 04:11
Sending Ether Cheat Sheet

Sending Ether Cheat Sheet

TLDR

🥇 Instead of sending Ether, use the withdrawal pattern

🥈 If you really need to send Ether, use a safe wrapper like OpenZeppelin's Address.sendValue(addr, amount)

🥉 If you really need to send Ether without dependencies, use (bool success, ) = addr.call{value: amount}("")

@dabit3
dabit3 / NFT.sol
Last active March 6, 2022 22:44
Basic NFT Smart Contract
// contracts/NFT.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
@MatthewStanciu
MatthewStanciu / index.html
Last active July 31, 2022 14:09
Simple Ethereum transaction with Web3.js
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="./index.js"></script>
</head>
<body>
<div id="pay">
<form>