This file contains hidden or 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
# @version 0.3.10 | |
""" | |
@title SDOLA Rate Calculator | |
@notice Provides a per-second yield rate for sDOLA, based on previous week rewards | |
@author Curve.fi | |
""" | |
interface IDolaVault: | |
def totalAssets() -> uint256: view | |
def weeklyRevenue(epoch: uint256) -> uint256: view |
This file contains hidden or 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
# @version 0.3.10 | |
""" | |
@title fxSAVE Rate Calculator | |
@notice Calculates a per-second yield rate based on wstETH rewards using Curve's crvUSD oracle for price. | |
""" | |
interface IFxUSDBasePool: | |
def nav() -> uint256: view | |
def balanceOf(account: address) -> uint256: view |
This file contains hidden or 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
# @version 0.3.10 | |
""" | |
@title SfrxusdMonetaryPolicy | |
@notice Based on SecondaryMonetaryPolicy, however following EMA of sfrxUSD yield rate | |
@author Curve.fi | |
@license Copyright (c) Curve.Fi, 2020-2024 - all rights reserved | |
""" | |
from vyper.interfaces import ERC20 | |
This file contains hidden or 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
# @version 0.3.10 | |
""" | |
@title OracleProxy | |
@notice Oracle proxy allowing LlamaLend factory admin to set price oracle contract after deployment | |
@author Curve.Fi | |
@license MIT | |
""" | |
interface Factory: | |
def admin() -> address: view |
This file contains hidden or 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
# @version 0.3.10 | |
""" | |
@title CryptoFromPoolsVaultWAgg | |
@notice Price oracle for chained pools (up to 8) combining crypto/crvUSD pricing and vault redemption rate. | |
It also references aggregated USD, so works for mint markets. | |
Only suitable for vaults which cannot be affected by donation attack (like sFRAX) | |
@author Curve.Fi | |
@license MIT | |
""" |
This file contains hidden or 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
# @version 0.3.10 | |
""" | |
@title SemiLog monetary policy | |
@notice Monetary policy to calculate borrow rates in lending markets depending on utilization. | |
Unlike "core" policies, it does not depend on crvUSD price. | |
Calculated as: | |
log(rate) = utilization * (log(rate_max) - log(rate_min)) + log(rate_min) | |
e.g. | |
rate = rate_min * (rate_max / rate_min)**utilization | |
@author Curve.fi |
This file contains hidden or 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
import json | |
import os | |
import warnings | |
import requests | |
from brownie import Contract, accounts, chain, web3 | |
from eth_abi import encode_single | |
warnings.filterwarnings("ignore") |
This file contains hidden or 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
from brownie import Contract | |
from brownie_safe import BrownieSafe | |
def silo_deposit_borrow(): | |
DEPOSIT_AMOUNT = 4_000_000e18 | |
BORROW_AMOUNT = 200_000e18 | |
safe = BrownieSafe('0xc420C9d507D0E038BD76383AaADCAd576ed0073c') | |
crv = safe.contract('0xD533a949740bb3306d119CC777fa900bA034cd52') | |
crv_usd = safe.contract('0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E') |
This file contains hidden or 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
import json | |
import os | |
import warnings | |
import requests | |
from ape import Contract, accounts, chain | |
warnings.filterwarnings("ignore") | |
# this script is used to prepare, simulate and broadcast votes within Curve's DAO |