Docs · For Developers
Marketplace Pools
Introduction
A marketplace pool lets a certified partner (an operator of a white-label marketplace on Blocksquare's infrastructure) raise sBST from the community. sBST is received from the governance pool. The pool targets a total of 100.000 sBST. Marketplace operators who stake BST unlock discounts on Blocksquare's licensing fee, up to the full fee; see Blocksquare pricing. White-label marketplaces are Blocksquare's offer, not Oceanpoint's.
The certified partner needs to initiate the marketplace pool with at least 500 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, the pool owner configures 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 are added to the marketplace pool and distributed among all participants. The reward token is set when the pool is created; the live pools pay rewards in BST. Each pool is a proxy created by the marketplace pool factory; see Smart contracts.
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) | An event emitted when a pool is configured |
Deposit(address indexed owner, uint256 inAmount, uint256 outAmount) | An event emitted when a deposit has been made |
Withdraw(address indexed owner, uint256 inAmount, uint256 outAmount, uint256 reward) | An event emitted when a withdraw has been made |
Reward(address indexed from, uint256 amount) | An event emitted when a reward is added to the pool |
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 it fills to 100,000 sBST during its campaign. If it does not, the campaign has failed and both the community and the certified partner can withdraw their sBST shortly after the campaign ends. After the lock period of a successful pool, the pool owner (the governance multisig) decides whether to release, extend or liquidate the collateral; see Detailed functionalities.
MIN_AMOUNT_DEPOSITED: 500 sBSTMAX_AMOUNT_DEPOSITED: 99,000 sBSTMIN_LOCK_PERIOD: 90 daysMAX_LOCK_PERIOD: 365 days
These are the limits of the implementation deployed on mainnet; older source versions used a 10,000 sBST minimum.
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 sBST 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 lasts (between 5 and 30 days).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 = 2592000; // 30 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()
.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()
.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 the reward token (BST on the live pools) added as rewards to a successful poolRETURN: No return, reverts on error.
Solidity
MarketplacePool mPool = MarketplacePool(0x123...); // contract address
mPool.addReward(amount);
Web3 1.2.6
const rewards = 1000 * e18; // 1000 BST 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 amount of unclaimed rewards (integer).
Solidity
MarketplacePool mPool = MarketplacePool(0x123...); // contract address
uint256 unclaimed = mPool.getUnclaimedReward(0xabc...);
Web3 1.2.6
const account = '0xabc...'; // The account we want to check
const unclaimedRewards = await mPool.methods.getUnclaimedReward(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 });