The protocol allows users to deposit native assets on any supported chain and borrow native assets on any other chain, while being backed by their entire multi-chain portfolio.
⚠️ Warning!⚠️ This project is in its early and experimental stages. It is undergoing an audit and has not yet been thoroughly reviewed for security vulnerabilities. Do not use in production.
Please report any security issues you find to security@pike.finance
The Hub
Hub is the chain which controls the universal liquidity. It performs the global accounting, maintains all the information from Spokes, approves or declines users' actions.
The Spoke
Spoke is the chain where users interact with the protocol (except for liquidations). Actions taken on Spokes are forwarded to the Hub for getting approvals.
Generic messaging
Pike employs the Wormhole protocol for generic messages passing.
HubState
HubState is the central point of the Pike protocol and maintains the aggregated state from all Spokes. Also, HubState performs all the necessary calculations to validate key users actions like depositing, borrowing, repaying and withdrawing.
Hubstate inherits from multiple auxiliary contracts related to the Hub state.
The only publicly accessible functions are designed for liquidations.
Gateway
The contract is deployed on each Spoke and serves as a communication means between the Pike contracts and Wormhole message-passing solution. Wormhole triggers actions with payload on Gateway which delegates these actions to their relevant destinations.
Gateway holds a mapping of authorized contracts and supported chains. Only these contracts can call functions that forward messages to relevant chains.
BorrowEngine
BorrowEngine contract is deployed on each Spoke and used for the management of loans taken on that Spoke. Contains logic which allows users to perform borrowings and repayments.
Treasury
Treasury contract holds pooled reserve assets and is controlled only by the Hub.
CollateralEngine
The contract calculates how much user can borrow against his deposits.
InterestRateEngine
The contract is used for algorithmically increasing or decreasing interest rates for various supported assets based on multiple internal and external factors.
OracleEngine
The contract is responsible for retrieving actual price feeds from various sources.
- Install Foundry by following the instructions from their repository.
- Copy the
.env.example
file to.env
and fill in the variables - Install the dependencies by running :
yarn install && forge install
yarn build
- Unit tests: WIP
- E2E tests: requires Wormhole generic relayers
Configure the .env
variables.
yarn deploy:sepolia
yarn deploy:base