Fund Pool
TreasuryVault is used for managing liquidity funds, including deposits, certificate minting, certificate burning, and debt investment management. Users can mint Yield Token and Position Token...
TreasuryVault
is used for managing liquidity funds, including deposits, certificate minting, certificate burning, and debt investment management. Users can mint Yield Token and Position Token
by depositing Native-Tokens
such as ETH or BNB
on the corresponding public blockchain. They can also redeem corresponding liquidity assets by burning the certificates whenever needed.
Contract Functions:
Increase Liquidity and Certificate Minting
:
Users can mint Yield Tokens and Position Tokens by adding liquidity in Native-Tokens such as ETH or BNB on the corresponding public blockchain. For example,1 ETH could mint 500 Yield Tokens and 500 Position Tokens, or 1 ETH could mint 1000 Position Tokens.
Redeem Liquidity
:
Users can redeem liquidity by burning corresponding amounts of Yield Tokens and Position Tokens from the contract. For example, redeeming 500 Position Tokens and 500 Yield Tokens could yield 1 ETH.Debt Management
:
The "Cheque Contract" can access funds within the contract based on financing permissions.Repayment Management
:
The "Cheque Contract
" can execute repayment operations through distribution modes to recover debt funds from the contract.
Certificate Usage Scenarios:
Position Token (PT):
Minted by providing liquidity assets, Alpha Voucher utilizes Position Tokens for decision-making proofs, verifying project financing cheques, and incentivizing investments based on guarantees or quantified proofs. Beta Miners can lend Position Tokens to Alpha Voucher on platforms like Uniswap to earn additional liquidity rewards.Yield Token (YT):
Beta Miners stake Yield Tokens to earn farming rewards. These rewards originate from the "interest" and dividends generated by Position Token business activities.
Contract Variables:
sellFee:
Fee percentage when destroying certificates, default is disabled.buyFee:
Fee percentage when minting certificates, default is disabled.feeTo:
Address to receive fee income, used in conjunction with fees when enabled.totalDebt:
Total accumulated debt amount.totalRepay:
Total accumulated repayment amount.PToken:
Address of the Position Token.YToken:
Address of the Yield Token.BaseRate:
Base exchange rate for conversions, e.g., ETH to Position Token and Yield Token.totalDeposit:
Accumulated liquidity added.totalWithdraw:
Accumulated amount withdrawn for debt.
Events:
Deposit:
Triggered when a user adds liquidity and mints certificates.Withdrawal:
Triggered when a user burns certificates and withdraws liquidity.Borrow:
Triggered when the "cheque contract" executes a borrowing operation.Repayment:
Triggered when the "cheque contract" executes a repayment operation.
Function:
initialize(address _ptoken, address _ytoken)
:
Initializes the contract by setting the addresses of thePosition Token (PT) and Yield Token (YT)
.deposit(uint8 _type)
:
Allows a user to deposit ETH and mint Position Token (PT) and Yield Token (YT) based on the_type
parameter. For_type
equal to 1, mints 500 YT and 500 PT; for_type
equal to 2, mints 1000 PT.withdraw(uint wad)
:
Allows a user to burn a corresponding amount of YT and PT to withdrawwad
amount of liquidity. For example,wad * 500 PT + wad * 500 YT = 1 ETH
.borrow(uint256 _amount)
:
Allows the "cheque contract" to borrow financing funds from the contract based on the legitimate rights amount.repayment()
:
Allows the "cheque contract" to execute a repayment operation, reclaiming liquidity funds from the contract.updateSellFee(uint256 _sellFee)
:
Updates the fee percentage for selling certificates.updateBuyFee(uint256 _buyFee)
:
Updates the fee percentage for buying certificates.updateFeeTo(address _feeTo)
:
Updates the address where fee income is received.updatePT(address _pt)
:
Updates the address of the Position Token contract.updateYT(address _yt)
:
Updates the address of the Yield Token contract.updateBaseRate(uint256 _base)
:
Updates the base exchange rate for conversion, such as ETH to Position Token and Yield Token.totalSupply()
:
Returns the total supply of the contract.balance()
:
Returns the liquidity balance of the contract.
Safety and Upgradability
Utilize the SafeMath library
to prevent integer overflow.
Interface
Last updated