donoso-eth / spool-foundry

3 stars 1 forks source link

Questions & Suggestions For Super Pool V1 #2

Open saflamini opened 1 year ago

saflamini commented 1 year ago

Overview

First off, here’s my general understanding of how this works. Please correct me if I am wrong about this @donoso-eth

You can send funds to a given super pool contract by doing the following 1) Acquire super tokens by wrapping an existing ERC20 (if you already have super tokens in your wallet, great) 2) Calling send() on the super token you’re working with to send these tokens into the pool you’re interacting with or creating a stream of tokens to the pool you’re interacting with Correct 👍

Once you’ve sent super tokens into a pool contract, you’ll receive spTokens in return Correct 👍

Users can redeem their underlying tokens using either a stream or lump sum withdrawal. However, there are some limits on which of these you can use depending on the circumstance:

Questions

General

Pool-V1 Contract

PoolInternal-V1 Contract

  1. The pool is outstreaming (pool.outFlowRate > 0) and the time elapsed since the last execution is greater than BALANCE_TRIGGER_TIME (24h), then we need to rebalance the pool to ensure remains with enough liquidity for the next 24 hours.
  2. If the pool superToken balance is greater than a certain threshold the balance treasury task will push this amount to our strategy ensuring max capital efficiency.

cc @kobuta23

donoso-eth commented 1 year ago

Your comments are incredibly valuable, will change accordingly! 🫡 Answers are inlined

donoso-eth commented 1 year ago

all comments done, only still to be done:

Can we use the new SuperTokenV1Library instead of CFALibrary? Will save a lot of boilerplate and be much more readable. I can help with this and you can find the library here