Onchain Architecture
Let's say we create an strategy for a client, which wants to automatically swap 2 yield-bearing positions, depending which one returns more APY.
The asset flow starts when the depositor transfers any digital asset, lets say $100 in USDC.
Through a payment abstraction layer this $100 in USDC will be split on the ratio the vault enforces at the moment, e.g. 40% Treasury Bills and 60% ETH.
These assets deposited on the Multi Asset Vault, which mints back tokenized shares, which have a redeeming capability over a percentage of the vault.
Rebalancer and PriceFeeds Module
The Rebalancer module will probably be unique for each use case, for the above case, we'll need an atomical router for lending and redeeming the position every time we have to adjust the balances.
These assets will be rebalanced when the assets value proportion doesn't align with the ratio + a minimum deviation constant, and this can happen for 2 possible reasons:
The strategy inside functions has defined a new balance ratios.
The asset price has moved over the minimum deviation trigger.
The asset price is fetched from the Price Feeds module, which serves as an oracle aggregator.
Using Chainlink Automation, we ensure any deviation is only momentary.
Staking Module
Chainlink Functions doesn't work like a cron task that constantly evaluates if its strategy should be executed, that is why we have ideated the staking module.
It serves as a crypto-economic security for ensuring the strategy is automatic, while keeping its operational costs as low as possible.
It works by requiring the actor executing the Functions oracle to have 5 times the estimated cost of the Chainlink service staked.
After the asynchronous request is send, the funds are atomically locked until the request is fulfilled.
If the new ratios returned from Functions are different plus a deviation margin, the staked funds are unlocked and a dynamic reward is paid depending on how much the new ratios values differ from the previous.
Last updated