Skip to content

PaladinFinance/Dullahan

Repository files navigation

Dullahan

Overview

A Dullahan comes from the Irish mythology, and is depicted as a headless knight riding a black horse, holding its own head in its hand. This product is the newest member of the Paladin round table, and is aimed to use the best synergy betwenn stkAAVE, GHO & vote lending, the image of a ghost knight is the best incarnation of it.

Dullahan is the next evolution of the palStkAave, aiming to supercharge the staked AAVE token.
The Dullahan vault will allow users to deposit their stkAAVE tokens to get the best yield from it, through different mechanisms:

  • claim & auto-compound rewards from the Safety Module
  • any yield coming from vote lending or voting incentives around the Aave Governance
  • yield from users looking to lend stkAAVE to harness the GHO interest rate discount coming from stkAAVE

Any reward in AAVE, coming from the Safety Module claim or any other source, will always be staked again into stkAAVE, to allow to auto-compound the yield and get Safety Module yield on a higher total amount, while participating in securing the Aave protocol by increasing the size of the Safety Module.
The Vault will also allow approved Manager contracts to rent stkAave for GHO minting. The 1st version of the Pod Manager allow users looking to mint GHO to create Pods, and rent stkAAVE, allowing them to deposit their collateral and borrow GHO from the Aave market through Pod with the best interest rate discount they can get. All the stkAAVE that is not necessary to get the best interest rate discount can be clawed back into the main Vault, only leaving the exact amount of stkAAVE needed for the current borrow GHO amount. In the same logic, the Pod can also get more stkAAVE from the Vault to increase the amount of GHO borrowed (if the deposited collateral allows it). When the user GHO debt is repayed (or when the user get liquidated), all stkAAVE are returned to the Vault. Pods accrued fees over the rented stkAAVE, following a decided fee pricing model. The collateral of an user is locked in the Pod as long as retning fees are owed to the Dullahan system. All the Governance power held by the vault & all the Pods will always be delegated to a Governance Module, that can be a multisig, a chosen Delegate from the Aave governance, or a smart contract, allowing to have the best use of the Vault (& Pods) global voting power, and harvest any incentive that could come from any source (paid vote delegation, voting incentives/bribes, purchase of Proposal power, ...)

The Dullahan Vault uses the Scaling ERC20 logic (inspired by the Aave aToken) so 1 share is always equal to 1 stkAAVE, where the depositors balance will automatically increase based on the yield generated by the Vault. This system will also allow the deposited stkAAVE to have a liquid wrapper that is always equivalent to 1 AAVE, and to be used in DEX Stable Pools so stkAAVE LPs never lose on Safety Module yield when being liquidity providers.

Dullahan diagram

Deployed contracts

Main contracts

DullahanVault (dstkAAVE) : 0x167c606be99DBf5A8aF61E1983E5B309e8FA2Ae7
DullahanRewardsStaking : 0x990f58570b4C7b8b7ae3Bc28EFEB2724bE111545

DullahanPod : 0xC2F3B8ED2f461D9A8a6FF9B67E2759F64540A947
DullahanPodManager : 0xf3dEcC68c4FF828456696287B12e5AC0fa62fE56

Modules

OracleModule : 0x69b503f57734bCD71D2096898Dd0fc02c32Fe3ae
DullahanDiscountCalculator : 0xC23a7e7c463BAD1ae1fD9D962b04BBcB9441A10E
DullahanRegistry : 0xEc7d50D40917CF5c25A8AAae0093db165f93E2A0
DullahanFeeModule : 0x09F8e2311E0F4a9A3617667F514812522A51E41d

DullahanZapDeposit : 0x653050F11B5f20213C9d1Ee62Cc02A76518649c6

Dependencies & Installation

To start, make sure you have node & npm installed :

  • node - tested with v16.4.0
  • npm - tested with v7.18.1

Then, clone this repo, and install the dependencies :

git clone https://github.com/PaladinFinance/Dullahan.git
cd Dullahan
npm install

This will install Hardhat, Ethers v5, and all the hardhat plugins used in this project.

Contracts

Tests

Tests can be found in the ./test directory.

To run the tests :

npm run test

Deploy

Deploy to Mainnet :

npm run build
npm run deploy <path_to_deploy_script>

Security & Audit

Dullahan was adited by Pessimistic : Audit Report

Ressources

Website : paladin.vote

Documentation : doc.paladin.vote

Community

For any question about this project, or to engage with us :

Twitter

Discord

License

This project is licensed under the MIT license