-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Develop a SwapPool interface on Sarafu.Network/swap
that allows someone to
Define a Pool, Deposit into a pool and Exchange
Create
- which tokens can go in it and for each there may be a cap - Address and cap (max quantity)
- Define relative pricing assume 1:1
- Define fees: assume 0
Deposit: Add their assets to the pool (given the rules above)
Exchange assets (given the rules above): Add a voucher and specify which other voucher you want in exchange.
Consider a get quote function for checking prices before executing any transfers. (control for potential slippage)
Note that the Price and be pushed to an oracle (like Uniswap can handle bonding curves if needed) (by default static rate)
MVP
Basic functions and visibility to reach the swap-pool on sarafu.network/swap
Notes:
Keep a registry of these contracts up to date (sync) (on chain- and off chain)
and a basic way to lookup existing pools (similar to exploring vouchers)
Consider a graph that holds the nodes (vouchers) and edges (pools) in order to perform offline operations - like shortest paths.
Consider a market place view where all other vouchers (products) are shown that can be reached by this graph of vouchers and pools. The avalaible products to look for would be all those paths from the users holdings to all other vouchers.
Consider a visualization of this graph (similar to that of transfers on (viz.sarafu.network)
use cases
-
upgrading contracts
someone makes the new one, puts it in the pool and specifices that the old one can be swapped
old contracts (with replacements) can be flagged -
Specifying that someone wants to exchange their vouchers (products) for an amount of another asset (like cUSD). // vending machine
https://github.com/nolash/erc20-pool here is the pool contract we've been working on.
https://github.com/nolash/erc20-limiter this is the limiter as well (for capping indexed vouchers)