PALMTerms

Deploys and tracks ArrakisV2 vaults created for PALM market making

Constant/Immutable Properties

Public Properties

Internal Properties

Structs

SetupPayload

IncreaseBalance

External Functions

openTerm

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)

increaseLiquidity

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)

closeTerm

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)

renewTerm

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)

whitelistRouters

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)

blacklistRouters

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)

addPools

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)

removePools

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)

setDelegate

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)

setVaultData

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 :

modifiers :

  • vault_ is non zero address

  • msg.sender is vault_ delegate (or is owner if delegate unset)

events :

  • LogSetVaultData(address creatorOrDelegate, address vault, bytes data)

setVaultStratByName

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

withdrawVaultBalance

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

setEmolument

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)

setTermTreasury

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)

setResolver

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)

setManager

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)

Inherited Standard Interfaces:

  • Ownable (transferOwnership)

Last updated