DataTypes
Structs
TrancheInfo
It contains the details of the tranche
struct TrancheInfo {
uint256 tokensDeposited;
uint256 tokensInvestable;
uint256 tokensExcess;
uint256 tokensInvested;
uint256 tokensAtMaturity;
uint256 tokensReceivedFromLP;
}
TrancheConfig
It contains the configuration of the tranche
It is populated during product creation
struct TrancheConfig {
IERC20Metadata tokenAddress;
uint256 decimals;
uint256 spTokenId;
uint256 capacity;
}
ProductConfig
It contains the general configuration of the product
It is populated during product creation
struct ProductConfig {
uint256 poolId;
uint256 fixedRate;
uint256 startTimeDeposit;
uint256 startTimeTranche;
uint256 endTimeTranche;
uint256 leverageThresholdMin;
uint256 leverageThresholdMax;
uint256 managementFee;
uint256 performanceFee;
}
ProductConfigUserInput
It contains the properties of the product configuration set by the user
The properties are reassigned to ProductConfig during product creation
struct ProductConfigUserInput {
uint256 fixedRate;
uint256 startTimeTranche;
uint256 endTimeTranche;
uint256 leverageThresholdMin;
uint256 leverageThresholdMax;
}
Investor
Struct used to store the details of the investor
Inspired by Ondo Finance
struct Investor {
uint256[] userSums;
uint256[] depositSums;
uint256 spTokensStaked;
bool claimed;
bool depositedNative;
}
SwapPath
Struct of arrays containing all the routes for swap
struct SwapPath {
address[] seniorToJunior;
address[] juniorToSenior;
address[] nativeToSenior;
address[] nativeToJunior;
address[] seniorToNative;
address[] juniorToNative;
address[] reward1ToNative;
address[] reward2ToNative;
}
Addresses
It contains all the contract addresses for interaction
struct Addresses {
IERC20Metadata nativeToken;
IERC20Metadata reward1;
IERC20Metadata reward2;
IJoePair lpToken;
IMasterChef masterChef;
IJoeRouter router;
}
LockedBalance
struct LockedBalance {
int128 amount;
uint256 end;
}
InitConfigParam
struct InitConfigParam {
DataTypes.TrancheConfig configTrancheSr;
DataTypes.TrancheConfig configTrancheJr;
DataTypes.ProductConfig productConfig;
}
FEYGMXProductInfo
The struct contains the product info for the FEYGMXProducts
struct FEYGMXProductInfo {
address tokenA;
uint8 tokenADecimals;
address tokenB;
uint8 tokenBDecimals;
uint256 fsGLPReceived;
uint256 shares;
bool sameToken;
}
Enums
State
- OPEN - Product contract has been created, and still open for deposits
- INVESTED - Funds has been deposited into GMX
- WITHDRAWN - Funds have been withdrawn from GMX
enum State {
OPEN,
INVESTED,
WITHDRAWN
}
Tranche
enum Tranche {
Senior,
Junior
}