PALMManager
Manager contract of all PALM vaults
Constant/Immutable Properties
name | type | description |
---|---|---|
managerFeeBPS | uint16 | fee on fees earned taken by this manager (in BPS of fees earned) |
terms | address | Terms address |
termDuration | uint256 | number of seconds of a Term |
Public Properties
name | type | description |
---|---|---|
vaults | mapping(address => VaultInfo) | Basic information per vault in storage (balance, strat, data, termEnd) |
operators | address[] | list of whitelisted operators who can call rebalance method on vaults |
gelatoFeeCollector | address | address to collect gas fees for Gelato automated executions. |
Internal Properties
name | type | description |
---|---|---|
_owner | address | Owner of PALMManager contract who can set Manager-wide configurable parameters |
_whitelistedStrat | Bytes32Set | set of whitelisted strategy identifiers |
Structs
VaultInfo
name | type | description |
---|---|---|
balance | uint256 | Gas Tank balance for repaying keepers for rebalance gas costs |
lastRebalance | uint256 | timestamp of last rebalance |
datas | bytes | JSON encoded custom parameters to strategy |
strat | bytes32 | Selected Strategy type encoded as |
External Functions
rebalance
perform a ArrakisV2.rebalance
operation on a PALM vault.
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
rebalanceParams_ | Rebalance | Struct with rebalance operation information |
feeAmount_ | uint256 | amount paid in fee to Gelato |
modifiers :
when not paused
msg.sender
inoperators
list in statevault_
is added (VaultInfo initialized)
checks :
check that
feeAmount_
is LTEvault_
balance
events :
RebalanceVault(address indexed vault, uint256 newBalance)
addVault
register a vault to be managed by PALMManager
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
datas_ | bytes | amount of LP token to mint on first mint (arbitrary) |
strat_ | string | strategy string identifier |
modifiers :
when not paused
vault_
non-zero addressvault_
owner is PALMTermsmsg.sender is PALMTerms
checks :
check that
strat_
is a whitelisted strategycheck that
vault_
is not already added (stored VaultInfo)
events :
AddVault(address indexed vault, bytes datas, string strat)
UpdateVaultBalance(address indexed vault, uint256 newBalance)
(possibly)
removeVault
remove vault from PALMManager managed vaults. Any network token in vault balance will be withdrawn
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
to_ | address | receiver of network token if vault is funded |
modifiers :
when not paused
vault_
non-zero addressvault_
owner ismsg.sender
checks :
check that
vault_
is already added (stored VaultInfo)
events :
RemoveVault(address indexed vault, uint256 sendBack)
renewTerm
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
to_ | address | receiver of network token if vault is funded |
modifiers :
when not paused
vault_
non-zero addressvault_
is already added (VaultInfo stored)msg.sender
isterms
address
events :
SetTermEnd(address indexed vault, uint256 oldtermEnd, uint256 newtermEnd)
fundVaultBalance
increase vault balance
(Gas Tank) with msg.value
network token
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
modifiers :
when not paused
vault_
is already added (VaultInfo stored)
events :
UpdateVaultBalance(address indexed vault, uint256 newBalance)
setVaultData
set/reset vault datas
bytes
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
data_ | bytes | new Vault data |
modifiers :
when not paused
vault_
non-zero addressvault_
owner ismsg.sender
vault_
already added (VaultInfo stored)
checks :
check that
data_
is not same as existing stored
events :
SetVaultData(address indexed vault, bytes data)
setVaultStratByName
set/reset vault strategy type (from whitelisted list)
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
strat_ | string | strategy string identifier for vault |
modifiers :
when not paused
vault_
non-zero addressvault_
owner ismsg.sender
vault_
already added (VaultInfo stored)
checks :
check that
strat_
is not same as existing storedcheck that
strat_
is a whilelisted strategy
events :
SetVaultStrat(address indexed vault, bytes32 strat)
withdrawVaultBalance
decrease balance
(Gas Tank) of vault, receive network tokens
parameters :
name | type | description |
---|---|---|
vault_ | address | Vault address |
amount_ | uint256 | amount of Network Token to withdraw |
to_ | address | receiver of Network Token |
modifiers :
when not paused
vault_
non-zero addressvault_
owner is msg.sendervault_
already added (VaultInfo stored)to_
non-zero address
checks :
vault balance exceeds
amount_
to withdraw
events :
WithdrawVaultBalance(address indexed vault, uint256 amount, address to, uint256 newBalance)
addOperators
PALMManager admin adds keeper operator addresses
parameters :
name | type | description |
---|---|---|
operators_ | address[] | new operators (authorized to call rebalance for all vaults) |
modifiers :
when not paused
msg.sender
is Manager-wide_owner
checks :
check that
operators_
are not already in operators array
events :
AddOperators(address[] operators)
removeOperators
PALMManager admin removes keeper operator addresses
parameters :
name | type | description |
---|---|---|
operators_ | address[] | operators to remove |
modifiers :
when not paused
msg.sender
is Manager-wide_owner
checks :
check that
operators_
are already in operators arraye
events :
RemoveOperators(address[] operators)
withdrawFeesEarned
PALMManager admin withdraws any manager fees earned
parameters :
name | type | description |
---|---|---|
tokens_ | address[] | token addresses to remove |
to_ | address | receiver of tokens (fees earned by manager) |
modifiers :
when not paused
msg.sender
is Manager-wide_owner
Inherited Standard Interfaces:
Ownable (transferOwnership)
Pausable (pause, unpause)
Last updated