Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Profit Pools Spec [WIP]

Felix Feng edited this page Oct 17, 2019 · 4 revisions

Smart Contracts

  • ProfitPool: Smart contract with a defined token pair and spread requirements. Lower spreads should result in more activity. Higher spreads means lower activity
  • ProfitPoolFactory: Used to add ProfitPools of new spread requirements. Each profit pool factory is linked to a certain oracle. Arbitrary token pairs don't really matter

ProfitPoolFactory

State

ProfitPool.sol is ERC20

State

  • tokenA
  • tokenB
  • spread
  • AToBOracle

Functions

constructor(tokenA, tokenB, spread, oracleAddress)

Sets the above

deposit(uint256 quantity) payable external

Deposits the specified pool token quantities of the specified quantity and generates a token based on the contribution.

withdraw(uint256 quantity) payable external

Burns the representative token and withdraws the current available mix.

use(address token, uint256 quantity)

  • Calls an external function smart contract that retrieves the quantity of tokens
  • Validates that the required spread is made - based on the oraclePrice

tokenAQuantity() public view returns(uint256)

tokenBQuantity() public view returns(uint256)

Clone this wiki locally