Liquidity Smart contracts

A complete ecosystem for tokenized assets distribution

Liquidity smart contracts are the most efficient way to turn the blockchain into a decentralized marketplace for secondary markets opportunities.

Liquidity smart contracts

At its core, the system enables these parties to post and browse trading intentions, known as Offers, through token-specific liquidity smart contracts. This innovation ensures that all offers are transparent and accessible on the blockchain, creating continuous live feeds of available trading intentions for all to see.

Further enhancing the system's utility, distribution platforms can tap into these live feeds of trading intentions, harvesting blockchain events to showcase offers to their clients and investors. This capability allows distribution platforms to enrich their services by incorporating digital assets into their portfolios. Depending on their licenses and service offering, they can bolster their value proposition by offering additional layers of service, such as curation of offers, advisory services, and automatic matching of trading intentions, among others. In essence, these platforms serve as intermediaries that connect investors with the burgeoning world of digital asset trading, facilitated by the blockchain's inherent transparency and security.

Built-in compliance

In order to leverage the blockchain as a foundational infrastructure for transferring and managing financial assets, it's crucial to simultaneously represent the various stakeholders through their blockchain identities, as well as the assets themselves along with their governance and compliance mandates.

To achieve this, a comprehensive suite of smart contracts is essential. Adopting industry standards is paramount to ensure all participants can forge a coherent and effective ecosystem. Highlighted below are the pivotal smart contracts utilized within this ecosystem:

  • ERC-3643 for Asset Representation: This open-source standard caters to permissioned tokens, facilitating the compliant issuance and management of tokenized assets.
  • ERC-734/735 (OnchainID) for Decentralized Identities: This standard facilitates the creation of blockchain identities using verifiable credentials, enabling a robust framework for identity verification and management.
  • ERC-20 Payment Tokens for Transactional Currency: These tokens serve as the blockchain's currency, enabling the representation of real-world money within the blockchain ecosystem.
  • Liquidity Smart Contracts for Market Transactions: Employed in both primary and secondary markets, these contracts underpin the creation and execution of offers, ensuring a seamless distribution mechanism for tokenized assets. Liquidity smart contracts can be parametrized and/or modified per token.

By implementing these standards, the ecosystem ensures a standardized, compliant, and efficient framework for asset management and identity validation on the blockchain.


Cross-Chain Capabilities and EVM Support

The liquidity smart contracts are designed for the efficient management and execution of market transactions. These contracts can be seamlessly deployed on any blockchain that supports the Ethereum Virtual Machine (EVM), showcasing the adaptability of our ecosystem to various blockchain environments.

Moreover, leveraging the cross-chain capabilities inherent in the EVM ecosystem, we plan to enable sophisticated transaction structures. This approach will facilitate transactions involving the tokenized asset on one blockchain network and the corresponding cash leg on another, thereby enhancing the fluidity and accessibility of digital assets across different blockchain platforms.

This strategic initiative underscores our commitment to fostering a truly interoperable and scalable blockchain infrastructure for financial assets.

📘

Smart contract Documentation

Complete smart contract documentation can be provided on demand by token issuers or their authorized agents.


Events

BillboardDeployed

The event is emitted when Billboard gets deployed
token is the address of the T-REX (ERC-3643) token associated with this billboard contract. Each billboard contract is linked to a single T-REX token.

event BillboardDeployed(address token)

BillboardFeePaid

feePayer payer of the fee
collector recipient of the fee
amount amount of tokens paid

event BillboardFeePaid(address feePayer, address collector, uint256 amount)

FixedFeePaid

taker payer of the fee
collector recipient of the fee
amount amount of tokens paid

event FixedFeePaid(address taker, address collector, uint256 amount)

FixedFeeSet

feeToken token used to pay the fees
feeRecipient recipient of the fee
amount amount of tokens paid

event FixedFeeSet(address feeToken, address feeRecipient, uint256 amount)

OfferCancelled

offerId unique identifier of the cancelled offer.

event OfferCancelled(uint256 indexed offerID)

OfferCreated

offerID token used to pay the fees
offerCreator creator of the offer
tokenOut The address of the token the offerer wants to sell.
amountOut The amount of tokenOut to sell.
tokenIn The address of the token the offerer wishes to receive.
amountIn The amount of tokenIn expected.
creationTime Timestamp when the offer was created
expiry The timestamp until which the offer remains valid.

event OfferCreated(uint256 indexed offerID, address offerCreator, address tokenOut, uint256 amountOut, address tokenIn, uint256 amountIn, uint256 creationTime, uint256 expiry)

OfferFilled

Is emitted by takeOffer function when an offer is completely filled

offerId unique identifier of the offer filled
taker address of the user that took the offer

event OfferFilled(uint256 indexed offerID, address taker)

OfferPartiallyFilled

Is emitted by takeOffer function when only part of the offer is filled (only part of the tokens have been bought/sold)

offerId unique identifier of the offer filled
amount amount of tokens taken
remainingAmountremaining amount of tokens in the offer
takeraddress of the user that took the offer

event OfferPartiallyFilled(uint256 indexed offerID, uint256 amount, uint256 remainingAmount, address taker)

OfferPruned

Is emitted when an offer is pruned
offerId is the unique identifier for the pruned offer

event OfferPruned(uint256 indexed offerID)

PartialOfferCreated

This event is emitted when a partial offer is created due to a filled take of an offer
newOfferId Unique identifier for the new partial offer
oldOfferId Unique identifier of the old offer
offerCreatorCreator of the original offer
tokenOutToken Out of the original offer
amountOutAmount Out of the original offer
tokenInToken In of the original offer
amountIn Amount of tokens in of the partial offer taken
expiryExpiry timestamp of the original offer

event PartialOfferCreated(uint256 indexed newOfferID, uint256 indexed oldOfferID, address offerCreator, address tokenOut, uint256 amountOut, address tokenIn, uint256 amountIn, uint256 expiry)

UpdatedOffer

offerId Unique identifier for the new partial offer
offerCreatorCreator of the original offer
tokenOutToken Out of the original offer
amountOutAmount Out of the updated offer
tokenInToken In of the original offer
amountIn Amount of tokens in of the partial offer taken
expiryExpiry timestamp of the updated offer

is emitted by the updateOffer function

event UpdatedOffer(uint256 indexed offerID, address offerCreator, address tokenOut, uint256 amountOut, address tokenIn, uint256 amountIn, uint256 expiry)

VolumeBasedFeeSet

feeRecipient The address of the entity or account that will receive the volume-based fee.
basisPoints The fee rate expressed in basis points, where 100 basis points equal 1% of the transaction volume.

is emitted by setVolumeBasedFee function

event VolumeBasedFeeSet(address feeRecipient, uint16 basisPoints)

VolumeFeePaid

feePayeraddress of the payer of the fees
collectorThe address of the entity or account that will receive the volume-based fee.
amountamount of tokens paid

event VolumeFeePaid(address feePayer, address collector, uint256 amount)

Functions

pause

Pauses the contract when the contract is paused Offers cannot be created, taken, updated or pruned.
Only the owner of the T-REX token can call this function

function pause() external nonpayable

unpause

Unpauses the contract when the contract is unpaused Offers can be created, taken, updated or pruned
Only the owner of the T-REX token can call this function

function unpause() external nonpayable

createOffer

Creates a new offer on the billboard contract, allowing a user to list tokens for sale.
Parameter 1: tokenOut The address of the token the offerer wants to sell.
Parameter 2: amountOut The amount of tokenOut to sell.
Parameter 3: tokenIn The address of the token the offerer wishes to receive.
Parameter 4: amountIn The amount of tokenIn expected.
Parameter 5: expiry The timestamp until which the offer remains valid.

returns offerID The unique identifier for the newly created offer. Only callable when the contract is not paused.

emits OfferCreated event

function createOffer(address tokenOut, uint256 amountOut, address tokenIn, uint256 amountIn, uint256 expiry) external nonpayable returns (uint256 offerID)

takeOffer

Allows a user to accept an existing offer on the billboard. This function handles the transfer of tokens and updating of the offer state.

Parameter 1: offerID The unique identifier of the offer to be taken.
Parameter 2: amount The amount of tokens the taker wants to accept from the offer.

function takeOffer(uint256 offerID, uint256 amount) external nonpayable

cancelOffer

Allows the creator of an offer to cancel it.
This will trigger the release of any locked tokens if applicable, particularly in cases involving ERC-3643 tokens.
Parameter 1: offerID The unique identifier of the offer to be cancelled.

emits OfferCancelled event

Only callable when the contract is not paused

function cancelOffer(uint256 offerID) external nonpayable

updateOffer

Updates the offer by allowing the offer creator to update the amount of tokens for sale. Price cannot be changed, only the amount of tokens for sale and expiry.
Parameter 1: offerID The unique identifier of the offer to be updated.
Parameter 2: amountOut The new total amount of tokenOut that the offerer wants to sell.
Parameter 3: expiry The new expiry timestamp. Only callable when the contract is not paused.

Only callable when the contract is not paused

function updateOffer(uint256 offerID, uint256 amountOut, uint256 expiry) external nonpayable

pruneOffer

Removes an invalid or expired offer from the Billboard contract. This function is essential for maintaining the cleanliness and efficiency of the marketplace.
Parameter 1: offerID The unique identifier of the offer to be pruned.
This function should be called when an offer is no longer valid, such as when it has expired, when compliance status changes render it untradeable or when the promised ERC20 left the wallet of the offer maker.

emits OfferPruned event

Only callable when the contract is not paused.

function pruneOffer(uint256 offerID) external nonpayable

setFixedFee

Sets a fixed fee amount that must be paid for each takeOffer transaction. This fee is denominated in a specified token and paid to a designated recipient. The fixed fee is intended to cover operational or other specified costs associated with transactions.

Parameter 1: feeToken The address of the token in which the fee is to be paid.
Parameter 2: feeRecipientThe address of the entity or account that will receive the fixed fee.
Parameter 3: amountThe fixed amount of the feeToken that will be charged per takeOffer transaction.

emits event FixedFeeSet

This function can only be called by the owner of the T-REX (ERC-3643) token associated with this billboard contract.

function setFixedFee(address feeToken, address feeRecipient, uint256 amount) external nonpayable

setVolumeBasedFee

Sets a volume-based fee, calculated as a percentage of the transaction volume in basis points, applicable to the non ERC-3643 leg of the transaction.

Parameter 1: feeRecipientThe address of the entity or account that will receive the volume-based fee.
Parameter 2: basisPointsThe fee rate expressed in basis points, where 100 basis points equal 1% of the transaction volume.

emits VolumeBasedFeeSet event

This fee is capped at 100 basis points (1%) to prevent excessive charges. The volume-based fee is designed to align the incentives of the token owner with the transaction volume, ensuring fair and reasonable charges.
Only the owner of the T-REX (ERC-3643) token associated with this billboard contract can invoke this function.

function setVolumeBasedFee(address feeRecipient, uint16 basisPoints) external nonpayable

TREX

Retrieves the address of the T-REX (ERC-3643) token associated with this billboard contract. Each billboard contract is linked to a single T-REX

returns address The address of the associated T-REX token.

function TREX() external view returns (address)

fixedFee

Retrieves the details of the fixed fee set for the billboard contract. The fixed fee is charged per takeOffer transaction.

returns fee A struct containing details of the fixed fee, including the token in which the fee is paid and the amount of the fee.

function fixedFee() external view returns (struct IBillboard.Fee fee)

volumeFee

Retrieves the volume-based fee rate, expressed in basis points, applicable to the non-ERC-3643 leg of the transaction. This fee is calculated based on the transaction volume.
returns bp The volume-based fee rate in basis points. One hundred basis points equate to 1% of the transaction volume. This rate is capped at 100 basis points to ensure fairness.

function volumeFee() external view returns (uint16 bp)

fixedFeeRecipient

Retrieves the recipient address for the fixed fee charged on each takeOffer transaction. This address receives the fixed fees accumulated from offer transactions.
returns recipient The address that receives the fixed fee.

function fixedFeeRecipient() external view returns (address recipient)

volumeFeeRecipient

Retrieves the recipient address for the volume-based fee, which is calculated as a percentage of the transaction volume. This address receives the volume-based fees accumulated from the offer transactions.

returns recipient The address that receives the volume-based fee.

function volumeFeeRecipient() external view returns (address recipient)

billboardFee

Retrieves the fixed fee amount set by the billboard protocol, not by the T-REX token owner. This fee is required for every interaction with the billboard and is paid in a specific token as designated by the billboard protocol.

returns fee The fixed fee required per transaction, specified by the billboard protocol.

function billboardFee() external view returns (struct IBillboard.Fee fee)

getOfferExpiry

Retrieves the expiry time of a specific offer. This is the timestamp after which the offer is considered invalid.

Parameter 1: offerID The unique identifier of the offer.

returns expiryThe timestamp of when the offer expires..

function getOfferExpiry(uint256 offerID) external view returns (uint256 expiry)

getOfferDetails

Retrieves the detailed information of a specific offer.
Parameter 1: offerID The unique identifier of the offer.
returns offerDetails The detailed information of the offer, including the creator, tokens involved, amounts, and expiry.

function getOfferDetails(uint256 offerID) external view returns (struct IBillboard.Offer offerDetails)

getInitialOffer

Retrieves the initial state of an offer for the purpose of tracking partial fillings. This function is used to compare the initial terms of the offer against its current state to determine how much of the offer has been filled.
Parameter 1: offerID The unique identifier of the offer.
returns initialOfferThe original details of the offer at the time of creation, including the creator, tokens involved, amounts, and expiry.

function getInitialOffer(uint256 offerID) external view returns (struct IBillboard.Offer initialOffer)