Skip to content

Commit

Permalink
positive interest works
Browse files Browse the repository at this point in the history
  • Loading branch information
mcclurejt committed Sep 4, 2024
1 parent e7c090a commit f764193
Show file tree
Hide file tree
Showing 19 changed files with 1,297 additions and 498 deletions.
357 changes: 325 additions & 32 deletions contracts/Everlong.sol

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions contracts/interfaces/IEverlong.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.20;

import { IERC4626 } from "openzeppelin/interfaces/IERC4626.sol";
import { ERC4626 } from "solady/tokens/ERC4626.sol";
import { IEverlongAdmin } from "./IEverlongAdmin.sol";
import { IEverlongEvents } from "./IEverlongEvents.sol";
import { IEverlongPositions } from "./IEverlongPositions.sol";
import { IEverlongPortfolio } from "./IEverlongPortfolio.sol";

interface IEverlong is
abstract contract IEverlong is
ERC4626,
IEverlongAdmin,
IERC4626,
IEverlongEvents,
IEverlongPositions
IEverlongPortfolio
{
// โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
// โ”‚ Structs โ”‚
Expand All @@ -32,15 +32,15 @@ interface IEverlong is
// โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

/// @notice Gets the address of the underlying Hyperdrive Instance
function hyperdrive() external view returns (address);
function hyperdrive() external view virtual returns (address);

/// @notice Gets the Everlong instance's kind.
/// @return The Everlong instance's kind.
function kind() external pure returns (string memory);
function kind() external pure virtual returns (string memory);

/// @notice Gets the Everlong instance's version.
/// @return The Everlong instance's version.
function version() external pure returns (string memory);
function version() external pure virtual returns (string memory);

// โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
// โ”‚ Errors โ”‚
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.20;

import { IEverlong } from "./IEverlong.sol";

interface IEverlongPositions {
interface IEverlongPortfolio {
// โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
// โ”‚ Stateful โ”‚
// โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Expand All @@ -17,13 +17,13 @@ interface IEverlongPositions {

/// @notice Gets the number of positions managed by the Everlong instance.
/// @return The number of positions.
function getPositionCount() external view returns (uint256);
function positionCount() external view returns (uint256);

/// @notice Gets the position at an index.
/// Position `maturityTime` increases with each index.
/// @param _index The index of the position.
/// @return The position.
function getPosition(
function positionAt(
uint256 _index
) external view returns (IEverlong.Position memory);

Expand All @@ -34,7 +34,7 @@ interface IEverlongPositions {
/// @notice Determines whether Everlong has sufficient excess liquidity
/// for opening a long.
/// @return True if sufficient excess liquidity, false otherwise.
function hasSufficientExcessLiquidity() external view returns (bool);
// function hasSufficientExcessLiquidity() external view returns (bool);

/// @notice Determines whether Everlong's portfolio can currently be rebalanced.
/// @return True if the portfolio can be rebalanced, false otherwise.
Expand Down
45 changes: 0 additions & 45 deletions contracts/internal/EverlongAdmin.sol

This file was deleted.

252 changes: 0 additions & 252 deletions contracts/internal/EverlongPositions.sol

This file was deleted.

Loading

0 comments on commit f764193

Please sign in to comment.