Skip to content

Instantly share code, notes, and snippets.

View JTraversa's full-sized avatar

Julian Traversa JTraversa

View GitHub Profile
@JTraversa
JTraversa / gist:40ab855c58bc2e24cdcfe2cf729a4faf
Created July 19, 2022 08:29
Rinkeby DAI market Vault balances
This file has been truncated, but you can view the full file.
{
"market": {
"underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa",
"maturity": "1669957199"
},
"users": [
{
"user": "0x7111F9Aeb2C1b9344EC274780dc9e3806bdc60Ef",
"amounts": {
"notional": "111522090989082212503037",
[
{
"market": {
"underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"maturity": "1648177200"
},
"users": [
{
"user": "0xe6d79FD38ad0b7C9be78F03f8fBe4CF01B49a559",
"amounts": {
@JTraversa
JTraversa / LibCompound2.sol
Last active August 4, 2022 15:47
LibCompound -- Compound Math
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.4;
import {FixedPointMathLib} from "./Marketplace/FixedPointMathLib.sol";
import "./ExponentialNoError.sol";
import "./Marketplace/Interfaces.sol";
/// @notice Get up to date cToken data without mutating state.
/// @author Transmissions11 (https://github.com/transmissions11/libcompound)
library LibCompound {
@JTraversa
JTraversa / YieldPool...Pool.sol
Created September 21, 2022 23:48
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.14+commit.80d49f37.js&optimize=true&runs=2000&gist=
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.14;
import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./MinimalTransferHelper.sol";
import "./CastU256U128.sol";
import "./CastU256U112.sol";
import "./CastU256I256.sol";
import "./CastU128U112.sol";
@JTraversa
JTraversa / gist:fae47e0ca66f6f7a2aa0a2a8b5ad7dd8
Created April 7, 2023 06:07
YearnSpace-TV _wrapPreview
function _wrapPreview(
uint256 base_
) internal view virtual override returns (uint256 shares) {
IYVToken yvToken = IYVToken(address(sharesToken));
uint256 DEGRADATION_COEFFICIENT = 10 ** 18;
uint256 freeFunds = yvToken.totalAssets();
uint256 lockedProfit = yvToken.lockedProfit();
if (lockedProfit > 0) {
uint256 lockedFundsRatio = (block.timestamp -