PALMTerms
Deploys and tracks ArrakisV2 vaults created for PALM market making
Last updated
Deploys and tracks ArrakisV2 vaults created for PALM market making
Last updated
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
create a PALM vault, a private-use ArrakisV2 vault that is managed automatically by Gelato Network keepers (via PALMManager contract). Keepers serve predefined strategy templates that the PALM vault owner can configure with custom parameters.
must approve PALMTerms to spend sufficient token0/token1 before calling this method
parameters :
modifiers :
collect and return leftover
checks :
check mintAmount is greater than 0
check allocation of (at least) one token non-zero
check token ordering (lower hex address first)
check initial allocation is greater than 0 in at least one token
events :
SetupVault(address creator, address vault)
increase the amount of tokens in a private PALM vault. Can be any proportion of token0/token1
must approve PALMTerms to spend sufficient token0/token1 before calling this method
parameters :
modifiers :
msg.sender is vault owner
checks :
check deposit is non-zero for at least one token
events :
IncreaseLiquidity(address creator, address vault)
remove all tokens from private PALM vault and reset the ArrakisV2 vault contract (no longer a PALM vault)
parameters :
modifiers :
newOwner_
is non-zero address
to_
is non-zero address
msg.sender is vault owner
events :
CloseTerm(address creator, address vault, uint256 amount0, uint256 amount1, address to, uint256 emolument0, uint256 emolument1)
after a term ends, collect prior term emolument (fee on principal) to the treasury address
parameters :
checks :
check that term has ended (ready for rollover)
events :
RenewTerm(address vault, uint256 emolument0, uint256 emolument1)
vault owner whitelists swap routers on their PALM vault.
parameters :
modifiers :
msg.sender is vault owner
vault_
is non-zero address
events :
LogWhitelistRouters(address creator, address vault, address[] routers)
vault owner blacklists swap routers on their PALM vault.
parameters :
modifiers :
msg.sender is vault owner
vault_
is non-zero address
events :
LogBlacklistRouters(address creator, address vault, address[] routers)
vault owner adds Uniswap V3 fee tiers to the whitelist of pool addresses
parameters :
modifiers :
msg.sender is vault owner
vault_
is non-zero address
events :
LogAddPools(address creator, address vault, uint24[] feeTiers)
vault owner removes Uniswap V3 pools from whitelist of pool addresses
parameters :
modifiers :
msg.sender is vault owner
vault_
is non-zero address
events :
LogRemovePools(address creator, address vault, address[] pools)
parameters :
modifiers :
msg.sender is vault owner
checks :
check that delegate_
is not the same as existing address
events :
DelegateVault(address creator, address vault, address delegate)
set the custom parameters to the selected vault strategy on-chain. Only called by PALM vault owner or delegate if owner has set delegate address.
parameters :
vault_
is non zero address
msg.sender is vault_
delegate (or is owner if delegate unset)
events :
LogSetVaultData(address creatorOrDelegate, address vault, bytes data)
set vault strategy template to be run by Gelato Keepers from list of whitelistsed strategy templates. Only called by PALM vault owner or delegate if owner has set delegate address.
parameters :
checks :
check that msg.sender
is vault_
delegate (or owner if delegate = 0)
interactions :
Manager setVaultStratByName
called, resetting vault strategy stored in Manager.
events :
LegSetVaultStratByName
: log new vault strat name
PALM vault owner withdraws network token from vault gas tank on PALMManager. (Gas tank
parameters :
modifiers :
vault_
is non-zero address
checks :
check that msg.sender
is the vault owner
events :
LogWithdrawVaultBalance
: log old balance, amount withdrawn and the vault address
terms contract owner sets the fee-on-principal per epoch for PALM vaults
parameters :
modifiers :
only Owner
checks :
check that emolument only decreases
events :
SetEmolument(uint16 oldEmolument, uint16 newEmolment)
terms contract owner sets the treasury to collect fee-on-principal
parameters :
modifiers :
only Owner
termTreasury_
is non-zero address
checks :
check that new termTreasury_
address is different than existing termTreasury
events :
SetTermTreasury(address oldTermTreasury, address newTermTreasury)
terms owner sets ArrakisV2Resolver contract
parameters :
modifiers :
only Owner
resolver_
is non-zero address
checks :
check that new resolver_
address is different than existing resolver
events :
SetResolver(IArrakisV2Resolver oldResolver, IArrakisV2Resolver newResolver)
terms owner sets PALMManager address
parameters :
modifiers :
only Owner
manager_
argument is non-zero address
checks :
check that manager_
argument is different than existing manager
events :
SetManager(address oldManager, address newManager)
Ownable (transferOwnership)
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
name | type | description |
---|---|---|
v2Factory
address
ArrakisV2Factory address
vaults
mapping(address => address[])
Maps vault owner address to a list of vault addresses (that the owner address has control of)
termTreasury
address
Address where fees paid to terms accrue
manager
address
Address of PALMManager contract
emolument
uint16
Amount of principal taken off the top of deposited liquidity (each epoch) for Terms, in BPS
resolver
address
Address of ArrakisV2Resolver contract
delegateByVaults
mapping(address => address)
delegate who can set strategy parameters instead of vault owner for each vault. Only owner can set if delegate is unset (zero address)
_owner
address
Owner of PALMTerms contract who can set Terms-wide configurable parameters
feeTiers
uint24[]
Uniswap V3 fee tiers to whitelist
token0
address
ERC20 token, token0 MUST be smaller hex number than token1
token1
address
ERC20 token, token1 MUST be larger hex number than token0
owner
address
Address who owns PALM vault, only owner can add and remove liquidity to vault
amount0
uint256
Amount of token0 to initially deposit
amount1
uint256
Amount of token1 to initially deposit
datas
bytes
JSON encoded configurable parameters to strat
strategy type
strat
string
Name of strategy type to subscribe vault to
isBeacon
bool
Flag for if vault is BeaconProxy or TransparentProxy
delegate
address
Optionally set a delegate who can manage vault strategy and parameters
routers
address[]
swap routers to whitelist
vault
address
Address of ArrakisV2 vault
amount0
uint256
Amount token0 to deposit
amount1
uint256
Amount token1 to deposit
setup_
SetupPayload
Struct for creating a new PALM vault via Terms
increaseBalance_
IncreaseBalance
struct with information about amounts to increase on which vault.
vault_
address
vault to close and eject
to_
address
receiver of underlying tokens
newOwner_
address
new vault owner
newManager_
address
new vault manager
vault_
address
address of vault to be renewed
vault_
address
vault to operate on
routers_
address[]
addresses to add to the whitelist of swap routers
vault_
address
vault to operate on
routers_
address[]
addresses to remove from the whitelist of swap routers
vault_
address
vault to operate on
feeTiers
uint24[]
fee tiers to whitelist
vault_
address
vault to operate on
pools
address[]
pools to remove from the whitelist of fee tiers
vault_
address
vault address
delegate_
address
New delegate address
vault_
address
vault address
data_
bytes
vault data (encoded in a given format for each "strategy")
vault_
address
vault address
strat_
string
strategy name (certain strategies indexed by a string a registered on the Manager)
vault_
address
address of vault
amount_
uint256
amount to withdraw
to_
address
receiver address
emolument_
uint16
New emolument value
termTreasury_
address
where Terms contract collects earned fees.
resolver_
address
New resolver address
manager_
address
New manager address