Marketplace Pools

Introduction

Oceanpoint enables everyone to crowd fund their own whitelabel marketplace using the so called Marketplace Pool. The idea behind this pool is that a certified partner that wants to run a white-label marketplace and might lack the funding to do so on their own can raise funds from the community in order to acquire a total of 100.000 sBST (Received from the Governance pool). The 100.000 sBST would mean a 100% discount on the whitelabel marketplace subscription fee.

The certified partner needs to initiate the marketplace pool with at least 10.000 sBST as collateral their side and a lockup period for which the tokens the users deposit are locked.

Once the pool is initiated by the CP, Oceanpoint will need to configure the marketplace pool campaign, which is made up of start time, the duration of the campaign and also the initial max amount each user can contribute. This is done to ensure that enough users have a chance of participating rather than a single whale filling up the entire pool. The max pledge amount increase over time the longer the pool is already running.

The owner of the pool can either allow the certified partner to withdraw the sBST for their use if the campaign is successful or it can liquidate the certified partner collateral in case of a failed campaign.

If a campaign is successful, rewards will be added to the marketplace pool and distribute among all participants.

Key Events

Event
Description

Capped(uint256 lockEnd)

An event emitted when a pool was successful and will receive rewards.

PoolCampaignConfigured(uint256 startTime, uint256 duration, uint256 maxPledge)

Deposit(address indexed owner, uint256 inAmount, uint256 outAmount)

Withdraw(address indexed owner, uint256 inAmount, uint256 outAmount, uint256 reward)

Reward(address indexed from, uint256 amount)

CP Init

The certified partner needs to initialize the pool in order for users to participate. During the initialization the certified partner needs to add collateral which will get returned in case the pool is considered as successful. A pool is considered successful if 100.000 sBST are added. Otherwise a pool is considered as failed and the certified partner will lose the collateral via a liquidation.

  • MIN_AMOUNT_DEPOSITED: 10.000 sBST

  • MAX_AMOUNT_DEPOSITED: 99.000 sBST

  • MIN_LOCK_PERIOD: 90 days

  • MAX_LOCK_PERIOD: 365 days

Marketplace Pool

function CPInit(uint256 amount, uint256 lockPeriod)
  • amount: Amount of sBST a certified partner adds as collateral.

  • lockPeriod: Duration in seconds of how long users are locked.

  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.CPInit(amount, lockPeriod);

Web3 1.2.6

const amount = 50000 * e18 // 50.000 BST as certified partner collateral
const lockPeriod = 15552000; // 180 days in seconds

const tx = mPool.methods
  .CPInit(amount, lockPeriod)
  .send({ from: sender });

Configure Pool Campaign

Used to configure and enable user deposits to the pool.

Marketplace Pool

function configurePoolCampaign(uint256 start, uint256 duration, uint256 maxPledge)
  • start: Time when users are allowed to deposit in the pool as timestamp.

  • duration: Duration in seconds of how long the investment period last.

  • maxPledge: Starting maximum amount in sBST a user can contribute. This increase over time.

  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.configurePoolCampaign(start, duration, maxPledge);

Web3 1.2.6

const start = 1735490002 // Timestamp when users are allowed to deposit
const duration = 15552000; // 180 days in seconds
const maxPledge = 1000 * e18; // 1000 sBST maximum pledge at the start

const tx = mPool.methods
  .configurePoolCampaign(start, duration, maxPledge)
  .send({ from: sender });

Deposit In Campaign

Used by the user to contribute sBST to the pool during an ongoing campaign.

Marketplace Pool

function depositInCampaign(uint256 amount)
  • amount: Amount of sBST a user want to contribute.

  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.depositInCampaign(amount);

Web3 1.2.6

const amount = 1000 * e18; // 1000 sBST

const tx = mPool.methods
  .depositInCampaign(amount)
  .send({ from: sender });

Redeposit

Used by the user in order to contribute more sBST to the pool after a campaign finished. While the campaign is still ongoing users can use depositInCampaign.

Marketplace Pool

function redeposit(uint256 amount)
  • amount: Amount of sBST a user want to add to his existing stake.

  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.redeposit(amount);

Web3 1.2.6

const amount = 1000 * e18; // 1000 sBST

const tx = mPool.methods
  .redeposit(amount)
  .send({ from: sender });

Allow Extraction Of Collateral

Used by the owner of the pool to allow the certified partner to withdraw his collateral.

Marketplace Pool

function allowExtractionOfCollateral()
  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.allowExtractionOfCollateral();

Web3 1.2.6

const tx = mPool.methods
  .allowExtractionOfCollateral(amount)
  .send({ from: sender });

Liquidate CP Collateral

Used by the owner of the pool to liquidate the collateral of the certified partner.

Marketplace Pool

function liquidateCPCollateral()
  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.liquidateCPCollateral();

Web3 1.2.6

const tx = mPool.methods
  .liquidateCPCollateral(amount)
  .send({ from: sender });

Extend CP Lock Period

Used by the owner of the pool to extend to lock period for a vertified partner.

Marketplace Pool

function extendCPLockPeriod(uint256 extendBy)
  • extendBy: Duration in seconds of how long to extend the Certified Partner lock period.

  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.extendCPLockPeriod(extendBy);

Web3 1.2.6

const extendBy = 15552000;  // 180 days in seconds

const tx = mPool.methods
  .extendCPLockPeriod(extendBy)
  .send({ from: sender });

Add Reward

Used to add rewards to successful pools. A pool is considered as successful if it reach 100.000 sBST.

Marketplace Pool

function addReward(uint256 amount)
  • amount: Amount of sBST added as rewards to a successful pool

  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.addReward(amount);

Web3 1.2.6

const rewards = 1000 * e18;  // 1000 sBST as reward

const tx = mPool.methods
  .addReward(rewards)
  .send({ from: sender });

Get Total Deposit Amont

Gets the total amount of sBST that was deposit to the pool.

Marketplace Pool

function totalDeposited() returns (uint256)
  • RETURN: The number of total sBST from deposits (integer).

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
uint256 amount = mPool.totalDeposited();

Web3 1.2.6

const amount = await mPool.methods.totalDeposited().call();

Get Total Collateral Amont

Gets the total amount of sBST that was added as collateral to the pool by the certified partner.

Marketplace Pool

function totalCollateral() returns (uint256)
  • RETURN: The number of total sBST collateral (integer).

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
uint256 amount = mPool.totalCollateral();

Web3 1.2.6

const amount = await mPool.methods.totalCollateral().call();

Get User Lock End

Gets the time at which the lock period for users participating in the pool is over.

Marketplace Pool

function userLockEnd() returns (uint256)
  • RETURN: The timestamp when the user lock period ends (integer).

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
uint256 lockEnd = mPool.userLockEnd();

Web3 1.2.6

const lockEnd = await mPool.methods.userLockEnd().call();

Get Unclaimed Reward

Gets the amount of pending rewards for a given wallet in case a campaign was successful.

Marketplace Pool

function getUnclaimedReward(address wallet) returns (uint256)
  • wallet: The account that we want to check unclaimed rewards for.

  • RETURN: The timestamp when the user lock period ends (integer).

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
uint256 lockEnd = mPool.getUnclaimedReward(0xabc...);

Web3 1.2.6

const account = '0xabc...'; // The account we want to check
const unclaimedRewards = await mPool.methods.userLockEnd(account).call();

Withdraw

Used by the participant of the pool to withdraw his sBST and rewards. Rewards are only available if the pool campaign was successful.

Marketplace Pool

function withdraw()
  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.withdraw();

Web3 1.2.6

const tx = mPool.methods
  .withdraw()
  .send({ from: sender });

Deposit

Used to deposit sBST to the pool.

Marketplace Pool

function deposit(uint256 amount)
  • amount: Amount of sBST to deposit to the pool.

  • RETURN: No return, reverts on error.

Solidity

MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.deposit(amount);

Web3 1.2.6

const amount = 1000 * e18; // 1000 sBST

const tx = mPool.methods
  .deposit(amount)
  .send({ from: sender });

Last updated