Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
This is the overall repository of PERI Finance Project.
Users can access to get basic information and current TVL, partners list, etc.
Github: To check PERI Finance's contract source code, please visit
Contact: If you need any questions or support, you can access to get answers.
PERI Finance is a Polkadot-based cross-chain innovative synthetic assets issuance and derivatives market protocol.
Users can access a wide range of both traditional financial and crypto assets in the form of synthetic and leveraged products through PERI Finance, such as synthetic assets, perpetual future swaps, etc.
Through adding Layer 2 with the OVM(Optimistic Virtual Machine) solution, we provide users with a lower GAS fee, speedy transactions, and robust security solutions from front-running or flash loan.
Our goal to users is making an opportunity to access a wide range of financial and crypto assets with various synthetic products, removing any difficult verification procedure on connecting to the finance sector.
Also, PERI Finance provides synthetic assets of high valued properties and assets through the Metaverse ecosystem. PERI DEX benefits users who want to take advantage of priceless assets on multi-Metaverse.
PERI staking dApp allows users to mint pUSD by staking PERI, USDC, DAI, and DEX LP tokens. Users can participate staking with their holding USDC and DAI stablecoin by PERI 80% : Stablecoin 20% ratio.
By staking tokens on PERI staking dApp, holders will receive regular staking rewards based on the vesting plan. These tokens are distributed to stakers based on their amounts of staking at the dApp. Users can also anticipate the inflation profit of PERI token prices.
Staking dApp has following four major functions:
Mint: Users can mint pUSD, the basic Pynths(PERI synthetic asset) of PERI Finance through their owned PERI token, stablecoin, and LP tokens. Minted pUSD used in trading various Pynths, perpetual futures swap on the PERI.Exchange.
Burn: By burning pUSD, staked tokens are unstaked. Unstaked tokens can freely transfer to other wallets(without escrowed amounts of PERI token).
Reward: PERI Finance distributes staking rewards to users on weekly basis. Users can claim their staking rewards and re-stake to mint additional pUSD on staking page.
Earn: LP tokens are issued by adding liquidity on DEX platforms. Users can earn LP rewards by staking LP tokens on PERI Finance staking dApp.
PERI Exchange is a Pynths(PERI Synthetic Assets) derivative Decentralized Exchange(DEX) where users can trade a variety of financial assets. PERI Exchange offers spot trading as well as perpetual contract exchange, and users can invest Pynths for long or short positions with up to 20x leverage. PERI Finance will provide wide range of synthetic asset products over the traditional finance’s barrier. Users can participate trading various kinds of financial synthetic assets by staking PERI tokens on dApp.
Various kinds of Pynths will be included such as a synthesized blockchain asset (pBTC, pETH, pBNB, etc), stocks(pTSLA, pGOOGL, pAMZN, etc), commodities (pXAU, pXAG, pWTI, etc.), inverse products(piBTC, piETH, piTSLA, piXAU, etc). Wide range of financial assets will provide to users by trade with the minted pUSD, and users don’t need to buy or hold the original assets.
PERI Exchange doesn’t need any kind of bid/ask sheets, liquidity provider on trading perpetual futures swap. The vAMM determines Pynths’ trade price on the PERI Exchange based on fixed formula. Since PERI Exchange Pynths are not the real asset, so it doesn’t need any liquidity of vAMM, and amounts of collateral is stored on the smart contract vault. Collaterals are issued through the staking, so the total valued locked(TVL) on PERI Finance is the essential asset of trading pynths.
Step 1. Connect the wallet to DEX dApp.
Step 2. Select the Pynths to trade with pUSD. On the main page, users can check the price index of pynths trading pair.
Step 3. Check the exchange rate between pUSD and Pynths, and click ‘Confirm’.
Step 4. When the Metamask confirm screen appears, check the transaction gas fee and click ‘Confirm’.
Step 5. Once you see the submit alert, your transaction has confirmed.
Step 6. After the trade is completed, alert and order history is displayed on the dApp.
Step 7. Users can see the current Pynths asset status on the Assets page.
PERI is the primary form of collateral backing the synthetic assets available in the PERI Finance protocol.
The PERI token is an ERC-20 compatible token with the addition of a snapshot feature, allowing gas-less transactions and one transaction approval/transfer.
PERI Finance’s token, $PERI is a utility token used to create a liquidity pool in the process of staking, generating the basic Pynths (PERI Synthetic assets) called pUSD. The staking dApp of PERI Finance is running on Ethereum, Polygon, and BSC mainnets, so users can stake their PERI/stablecoin/LP tokens and claim rewards.
This pUSD can exchange at other Pynths on our upcoming dApp, PERI Exchange. Users can get an arbitrage profit through trading various Pynths on the dApp.
By the profit of pUSD through the Pynth trade, users can swap the pUSD token to PERI and re-stake it. This virtuous circle allows users to earn an additional profit and makes the growth of PERI Finance platform ecosystem.
Pynths are synthetic assets, minted against the value of crypto assets staked as collateral. The values of Pynths are provided by external price feeds fed on-chain.
PERI Users provide Liquidity to Pools like Pancakeswap, Uniswap or Quickswap hence received LP token as a reward. LP rewards are added to the ‘Transferable’ amount, this means that users can transfer and trade rewarded PERI tokens immediately.
PERI Finance has allocated more than 40% of the overall supply for the staking rewards. As this graph details, PERI Finance recommends users participating in the staking program to get plenty amounts of token rewards.
PERI tokens are now vesting to various users through the vesting schedule below. Since the token distribution has started in May 2021, this vesting is scheduled for 52 weeks issuing 76,924.72 PERI every week. After 52 weeks of issuing, the vesting amount will decrease 1.25% per week, until the total supply reaches 20,000,000 PERI.
PERI Finance will keep allocating tokens to staking users/investors/advisors through the elaborately composited smart contract.
The source code for the PERI token can be found on .
Please check the BNB/PERI trading pair on the .
In this guide, we will explain to you how to use the official Polygon Bridge.
Step 1. You need to possess PERI Token on your Ethereum wallet
Step 2. You need to possess ETH on your Ethereum wallet to pay for the bridge transaction fee
To connect Polygon Mainnet, Users should add network address on their Metamask.
Step 1. Open the Metamask app on your web browser and click the right top Network icon.
Step 2. Press ‘Custom RPC’.
Step 3. Fill contents as below:
Network Name: Polygon Matic Mainnet
Chain ID: 137
Symbol: MATIC
And click ‘Save’
Step 2. Before you connect the wallet to the Polygon bridge website, the network of your wallet should be set at the Ethereum mainnet.
Step 3. Connect your wallets and Click ‘Sign’ button.
Step 4. Click ‘Apps’ on the right top conner and choose ‘Polygon Wallet’.
Step 5. Search PERI on search box.
Step 6. Click ‘Deposit’ button to transfer PERI from Ethereum Mainnet to Matic(Polygon) Mainnet.
Step 7. On the bridge screen, select ‘PERI Token’ from the dropdown menu or this will be automatically selected if you go through the previous processing.
Step 8. Input amounts of PERI Token that you want to transfer into the Polygon network and click ‘Transfer’ button.
Step 9. After the transfer button is clicked, you will see these pages to continue transfer.
Step 10. Click ‘Confirm’ button.
Step 11. The transaction is processing and when progress approached to the confirmed period. Click ‘Continue’ button.
Step 12. At this point, your wallet will be asked for gas fee to transfer into polygon network. Check the gas fee and click the ‘Confirm’ button.
Step 13. Wait until the transfer in progress is completed. It regularly takes 7–8 mins.
Step 14. Once the transfer is completed, PERI token will be successfully added to your meta mask wallets in the Polygon network.
Step 15. To see details about holding PERI on Matic Mainnet(Polygon Network), you have to add Peri Token in the wallet.
Click ‘Add Token’ button. And insert PERI contract address at Polygon:
0xDC0E17eAE3B9651875030244b971fa0223a1764f
And Click ‘Next’, ‘Confirm’.
Also, you can see PERI contract address details on the Polygonscan page:
New RPC URL:
Block Explorer URL:
Step 1. Go to
PERI Finance liquidity providers will earn a percentage share of the pool that you provided liquidity.
Distribution Support: PERI/BNB, PERI/MATIC
Start Date: Aug. 08th, 2021 00:00 (UTC)
Duration of Program: 12 Weeks + Until Further Notice
the expected APR is about 945%- this rate is not the fixed rate that can be changed by liquidity providing rate.
LP token address: PancakeSwap: 0xb68ebcec4c7aba66f5b8ed62e8c98b269cf918c8 QuickSwap: 0x98f675b60769abc732ee59685bffa19ea3c8e81c
Step 2. Choose ‘LP’ button to add liquidity on PERI dApp. Make sure to have an equivalent amount of $PERI and ETH/BNB/MATIC in your own wallet(Metamask/Ledger/Trezor/Coinbase Wallet)
Step 4. Input the liquidity amount of $PERI to BNB/MATIC into the pool and approve request.
Step 5. After adding the liquidity, you will receive LP tokens respectively.
PERI Finance reserve the right to change the amount of PERI that are given as liquidity rewards, at any time, and without notice.
The number of PERI tokens earned as a reward in this program may vary due to other participants in the separate pool.
PERI Finance makes no warranties or guarantees as to the safety and security of any and all funds deposited by participants on Pancakeswap/Quickswap.
PERI Finance has no liability or control over users’ funds lost due to bugs or breaches on Pancakeswap and Quickswap, or due to the user’s negligence.
PERI Finance reserves the right to modify or cancel this Rewards Program at any time, for any reason.
When staking cryptocurrency assets, APY (Annual Percentage Yield) is one of the most crucial factors to consider for optimal efficiency. APY stands for Annual Percentage Yield and is the projected rate of annual return after taking compounding interest into account. In order to understand how APY is calculated, it is important to understand compound interest.
In essence, compound interest is interest earned on previously earned interest. For example, let’s say you deposit $1USD into a CD(Cash Deposit) savings account at your bank with a simple interest of 1%. You are constantly receiving same amounts of monthly interest: $0.00083 ($0.01 for the annual interest)
Let’s assume that you deposit $1USD into a CD savings account at your bank with an APY of 1%. Your primary monthly interest is $0.00083. However in second month, your monthly interest is increased to $0.00084. It is because the interest that received in previous month is added to your deposit. As the your deposit value increased, your interest also increases. We call this as compound interest.
This system is also applied in PERI Finance’s staking dApp. If you staked PERI into staking pool, you can receive following APY in PERI staking dApp:
According to the data at 10th August 2021, BSC APY recorded about 960% and Polygon was about 530% on PERI Finance staking dApp. It’s because APY is affected by how much amount of token(PERI and stablecoins) have staked on each Mainnet, so the more amount staked on certain Mainnet, the lower APY appears on dApp.
You can check current APY status by switching the networks on our dApp like below:
This means that the total staking amount in BSC is relatively low, so staking users in BSC can get more rewards than other networks.
Any APY is subject to change based on the number of users staking their PERI, as well as the market volatility. This is the initial absolute APY rate based on this exact time’s conditions, without any guarantee and are non-binding, they are listed solely for information purposes.
Step 1. Click ‘Burn’ on the main page.
Step 2. Input the amount that you want to burn pUSD, and click ‘Burn’.
Note — For users who staked both PERI and Stablecoin(USDC, DAI) If users who staked PERI and other kinds of stablecoin, you should maintain the staking ratio(PERI 80% : other stablecoin 20%)on the staking dApp. So, if you unstake all PERI amount in the dApp, you should burn pUSD by the stablecoin first.
Step 3. Check the gas fee on the Metamask, and click ‘Confirm’.
Once the transaction is completed, you can see the alert on dApp and Metamask.
Step 4. After you see the alert on dApp. you can see staked amount on dApp page and Metamask.
Burn pUSD by unstake USDC or DAI proceeds similar with PERI.
Step 1. Click ‘Burn’ on the main page.
Step 2. Scroll and Select USDC or DAI and Input the amount that you want to burn pUSD, and click ‘Burn’.
Note — For users who staked both PERI and Stablecoin(USDC, DAI) If users who staked PERI and other kinds of stablecoin, you should maintain the staking ratio(PERI 80% : other stablecoin 20%)on the staking dApp. So, if you unstake all amount in the dApp, you should burn pUSD by stablecoin first.
Step 3. Check the gas fee on the Metamask, and click ‘Confirm’.
Once the transaction is completed, you can see the alert on dApp and Metamask respectively.
Step 4. After you see the alert on dApp. you can see the current amount on dApp page and Metamask.
Step 1. Open the Metamask app on your web browser and click the right top Network icon.
Step 2. Press ‘Custom RPC’ to set BSC network.
Step 3. Fill contents as below:
Network Name: Polygon Matic Mainnet
Chain ID: 137
Symbol: MATIC
And click ‘Save’
Step 1. Click ‘Add Tokens’ on the metamask. (Make sure your current network is set on Matic Mainnet(Polygon))
Step 2. Add Tokens on following address:
(If users have following kinds of stablecoin, please add tokens below)
And click ‘Next’
Step 3. After you click ‘Add tokens’, you can see the current PERI amounts.
Step 1. Click ‘Add Tokens’ on the Metamask. (Make sure your current network is set on BSC Mainnet(Binance Smart Chain))
Step 2. Add Tokens on following address:
(If users have following kinds of stablecoin, please add tokens below)
And click ‘Next’
Step 3. After you click ‘Add tokens’, you can see the current PERI amounts.
Users can mint PERI’s basic Pynth(PERI Synthetic Asset)pUSD through the staking process.
Step 1. Click ‘Stake’ — ‘Mint’ on the main page.
Step 2. Input the pUSD amount that you want to mint by staking PERI, and click ‘Mint’.
Step 2–1. If you first time that you’re request staking PERI on our dapp, this Metamask approval window will appear. Click ‘Confirm’
Step 2–2. And Click ‘Mint’ again.
Step 3. Check the gas fee on the Metamask, and click ‘Confirm’. Once the transaction is completed, you can see the alert on dApp.
Step 4. You can see the staked PERI on the status window.
If you scroll down from the Mint page, you can select staking DAI or USDC stablecoin. The process of staking DAI and USDC are the same as PERI. (For staking stablecoin, users should stake PERI token on dApp beforehand. Amount of staking stablecoin is limited to 20% of the whole staked amount)
Step 1. Input the pUSD amount that you want to mint by staking DAI/USDC, and click ‘Mint’.
Step 2. Check the transaction fee on the Metamask, and click ‘Confirm’.
After you see the alert on dApp, you can see staked amounts on dApp page and Metamask.
You can swap ETH/PERI by finding PERI or paste the following Smart Contract Address:
Note — PERI/ETH trading pair has in the Uniswap V2.
Participate the LP pool by adding PERI BSC Smart Contract Address:
Join the LP pool by adding PERI Polygon Smart Contract Address:
Step 1. Click ‘Add Tokens’ on the Metamask.
Step 2. Add Tokens on your appropriate network’s following LP token address:
And click ‘Next’
Step 3. After you click ‘Add tokens’, you can see the current LP token amounts.
We will explain the whole procedure in the Polygon Network. The process of Staking LP Reward on ETH and BSC are the same with following steps on Polygon Network.
Step 1. Click Stake — Earn on the staking dApp main page.
Step 2. Input amounts of LP token you want to stake and click ‘Stake’.
Step 3. Check the gas fee on the Metamask, and click ‘Confirm’.
Step 4. Once the transaction is completed, you can see the alert on dApp and Metamask.
Step 4-1. Check the staked LP amount on ‘Balance’ window.
Liquidity Providing could have risk of impermanent loss in PERI token price change. As a liquidity provider, your position may fall in value with respect to either asset (before fees) and impermanent loss is often defined as the percentage loss an LP would experience for a given price movement. PERI Finance do not guarantee regarding impermanent loss, and all risk of loss is bourn by the user.
Step 1. Click ‘Reward’ on the main page.
Step 2. Check your reward amount on the ‘PERI’, and click ‘CLAIM’.
Step 3. Check the gas fee on the Metamask, and click ‘Confirm’.
Step 4. Once the transaction is completed, you can see the alert on dApp and Metamask.
Step 4-1. You can check the claimed amounts on the ‘Balance’ — ‘Reward Escrow’ window. Note — Rewards are escrowed for 52 weeks from the claim approval.
Step 1. Click ‘Reward’ on the main page.
Step 2. Scroll down to LP reward, and check the reward amount of ‘PERI’ token. Click ‘Claim’.
Step 2–1. If users added LP on the PancakeSwap, you can see the LP reward window like this below.
Check the reward amount of ‘PERI’ token and click ‘Claim’.
Step 3. Review the gas fee on the Metamask, and click ‘Confirm’.
Step 4. Once the transaction is completed, you can see the alert on dApp and Metamask.
Step 4-1. You can check the claimed amounts on the ‘Balance’ window. LP rewards are added to the ‘Transferable’ amount, this means that users can transfer and trade rewarded PERI tokens immediately.
Claim schedule refreshes at every Saturday 00:00AM UTC. If you staked amount in weekdays, you can request claim from upcoming Saturday 00:00 UTC. Users should request their claim rewards on weekly basis.
All staking rewards are given by PERI token, including users who have staked PERI, stablecoin, LP tokens.
Step 1. Go to
Step 3. Go to the pool page that you have added liquidity. (Page Link: | )
New RPC URL:
Block Explorer URL:
Source -
Description
Auditor
Audit Type
Date
PERI Finance
Smart Contract
July. 2021
We encourage the hunting of bugs and potential exploits in our protocol. Refer to our page for full details.
Peri Finance Protocol using below equations to handle staking and subject to change
Staked Amount (User)
C-Ratio
Peri locked amount
Available External token stake Amount
Staked Escrow Balance
APR
APR by user
Reward Distribution
Fit to claimable
LP Price
Staking Reward(LP) reward calculation algorithm
If ( transferable PERI
> 0 )
Staked Escrow PERI
= PERI Locked Amount
- PERI Balance
If ( transferable PERI
= 0)
Staked Escrow PERI
= 0
at, PERI Locked Amount
= (debt / issuanceRatio
) - USDC Staked Amount
PERI holders will receive three different rewards by staking PERI.
The first reward comes from PERI inflationary supply policy. PERI staking rewards are generated through the inflationary monetary policy implemented. Stakers can claim their staking rewards, which are escrowed for a year. 52 weeks After , Peri staking rewards start, inflation amounts decrease weekly by 1.25%.
After 40 months, the annual inflation rate will be fixed at 5%. 80% of the inflation reward will go to users who staked PERI and the rest to users staking USDC or DAI, which can be changed by PERIDAO community in the future
The second reward is the distribution of PERI.Assets' revenue. The managed funds come from 50% of the fund raised by PERI token sales, so the holders can be rewarded additional profits only by staking PERI. The profit only goes in proportion to those who maintain C-Ratio (collaterization ratio) above 400% during the rewards claiming period with PERI (50%) and BTC/ETH (50%).
Finally, the distribution of commissions incurred in Pynths transactions and leveraged Pynths contract trading.
PERI stakers can stake their PERI and receive rewards. But by staking, they also take on the risk of 'debt.' When someone stakes their PERI, to then immediately unstake it they need to burn as much pUSD as they just minted — this pUSD figure is their debt, and all PERI stakers' debt is pooled together (with each staker holding a proportion of it). But this pooled debt is also where profits and losses from people trading on PERI.Exchange is represented, so a staker's debt can change over time depending on traders' overall profits and losses. This is the risk they assume when staking their PERI.
It is possible to mint Pynths by staking USDC. However, USDC stakers' debt is denominated in pUSD. It does not get added to the system's pooled debt, and thus does not fluctuate depending on traders' outcomes. The ratio of PERI to other coin will be 8:2, which can be changed by PERI DAO later
It is possible to mint Pynths by staking DAI too. However, DAI stakers' debt is also denominated in pUSD. It does not get added to the system's pooled debt, and thus does not fluctuate depending on traders' outcomes. The ratio of PERI to other coin will be 8:2, which can be changed by PERI DAO later
The APY(Annual Percentage Yield) is affected by how many amounts of tokens are staked(amounts of TVL) on the network. So the more users and amounts participate in the staking, the lower APY appears. This means that you can expect a higher APY by joining staking dApp earlier than others.
Please check each network’s APY on our staking dApp. You can see the details in the Stake-Mint section of the dApp window.
Please scroll up/down with your mouse click wheel or touchpad. You can choose the tokens on the Mint/Burn/Reward section.
Yes, you can. PERI Finance dApp is on both laptop and mobile. Users can access our dApp on mobile by following dApp address(users need install Metamask mobile application):
PERI Finance is planning to launch a mobile-friendly staking dApp page. We will announce additional updates to users.
PERI token has listed on the following centralized exchanges:
You can also trade PERI tokens by paste the following address on DEX:
Uniswap: 0x5d30ad9c6374bf925d0a75454fa327aacf778492 Pancakeswap: 0xb49B7e0742EcB4240ffE91661d2A580677460b6A Quickswap: 0xDC0E17eAE3B9651875030244b971fa0223a1764f
Gate.io: Liquid: MEXC: XT: Hotbit:
Peri Finance's historical data ca access using number of ways in future
Using calls on the Graph subgraphs
Using an Archive Node to fetch state at some block in the past
Using Query event logs on the Graph Subgraph
Using Third party service like Google BigQuery
To Query Network Data from Decentralized Network , Peri Finance has indexed protocol data on the Graph. The Graph allows for the creation of custom data sets called Subgraph , which allowed to be queryable.
Peri Finance currently has One separate subgraphs for retrieving information specific to Peri Finance smart contracts. A subgraph is an entity-based data source which replays all transactions since the genesis block and uses custom code to create queryable entities as each block is processed.
Alternatively, each of these subgraphs can be queried using GraphQL.
Instead of using the subgraphs provided, you could directly query the EVM via most free providers (such as Infura ).
You can also use an Network(Polygon/Ethereum/BSC) node with full historical state to read the blockchain state at some block in the past.
Peri finance provides below method to handle staking
Staking
Lock
Mint
Update debt
Update total supply
Transfer
Burn
Burn
Unlock
Update debt
Update total supply
Claim Rewards
List of Peri Finance integrations both on and off chain. For projects wishing to integrate with Peri Finance
Uniswap is a decentralised exchange for exchanging PERI and ETH tokens. Peri Finance integrates with it to deepen the Peri Finance ecosystem's liquidity, and it acts as an on-ramp/off-ramp for the Pynth market. Users who provide liquidity to the PERI/ETH pool are provided with staking rewards as part of the Peri Finance Protocol.
Pancakeswap is a decentralised exchange for exchanging PERI and BNB tokens. Peri Finance integrates with it to deepen the Peri Finance ecosystem's liquidity, and it acts as an on-ramp/off-ramp for the Pynth market. Users who provide liquidity to the PERI/BNB pool are provided with staking rewards as part of the Peri Finance Protocol.
QUICKSWAP is a decentralised exchange for exchanging PERI and MATIC tokens. Peri Finance integrates with it to deepen the Peri Finance ecosystem's liquidity, and it acts as an on-ramp/off-ramp for the Pynth market. Users who provide liquidity to the PERI/MATIC pool are provided with staking rewards as part of the Peri Finance Protocol.
The Graph is a decentralised indexer and GraphQL query engine of blockchain events and function calls. Peri Finance will provide number of subgraphs to track number of events and key metrics within the Peri Finance System historically. Planning to Integrate Graph in future - to query or subscribe to events in real time see Historical Data.
This contract is a type of Service Locator pattern that allows for easier interaction between multiple contracts. Instead of contract A needing references to contracts B and C (and updating every release), contract A can refer to an AddressResolver
and query for B and C at transaction time. Then, during a release, the AddressResolver is updated with the latest B and C contract. Thus this ensures that contract A always has the latest B and C contracts.
repository
The mapping of contract name to address
Type: mapping(bytes32 => address)
constructor
Signature
constructor(address _owner)
Visibility
public
State Mutability
areAddressesImported
Signature
areAddressesImported(bytes32[] names, address[] destinations) view returns (bool)
Visibility
external
State Mutability
view
getAddress
Returns a single address by it's bytes32
key.Details
getPynth
Returns Issuer address
Signature
getSynth(bytes32 key) view returns (address)
Visibility
external
State Mutability
view
Requires
require(..., "Cannot find Issuer address")
requireAndGetAddress
Signature
requireAndGetAddress(bytes32 name, string reason) view returns (address)
Visibility
external
State Mutability
view
Requires
importAddresses
Import one or more addresses into the system for the given keys. Note: this function will overwrite any previous entries with the same key names, allowing for inline updates.
Signature
importAddresses(bytes32[] names, address[] destinations)
Visibility
external
State Mutability
Requires
Modifiers
onlyOwner
rebuildCaches
Signature
rebuildCaches(contract MixinResolver[] destinations)
Visibility
external
State Mutability
AddressImported
Signature: AddressImported(bytes32 name, address destination)
Source:
This is a list of the most common user-facing transactions possible in the PERI Finance ecosystem, and the events they emit on success.
Called contract: ProxyERC20
Target (underlying) contract: PeriFinance
Methods:
issuePynths(uint256 amount)
issuePynthsOnBehalf(address user, uint256)
issueMaxPynths()
issueMaxPynthsOnBehalf(address user)
Events Emitted:
On a successful transaction, the following events occur:
Transfer
from 0x0
to account
for amount
emitted on ProxypUSD
Issued
amount
to account
emitted on ProxypUSD
IssuanceDebtRatioEntry
emitted on ProxyFeePool
More info
Check out our unstaking walkthru for more information
Called contract: ProxyERC20
Target (underlying) contract: PeriFinance
Methods:
burnPynths(uint256 amount)
burnPynthsOnBehalf(address user, uint256 amount)
burnPynthsToTarget()
burnPynthsToTargetOnBehalf(address user)
Events Emitted:
On a successful transaction, the following events occur:
Transfer
from account
to 0x0
for amount
emitted on ProxypUSD
Burned
amount
from account
emitted on ProxypUSD
IssuanceDebtRatioEntry
emitted on ProxyFeePool
Check out our claiming walkthrough for more information
Called contract: ProxyFeePool
Target (underlying) contract: FeePool
Methods:
claimFees()
claimOnBehalf(address user)
Events Emitted:
On a successful transaction, the following events occur:
Transfer
from FEE_ADDRESS
to 0x0
for amount
emitted on ProxypUSD
Burned
amount
from FEE_ADDRESS
emitted on ProxypUSD
Transfer
from 0x0
to account
for amount
emitted on ProxypUSD
Issued
amount
to account
emitted on ProxypUSD
VestingEntryCreated
emitted on RewardEscrow
FeesClaimed
emitted on ProxyFeePool
Check out our trading walkthrough for more information
Called contract: ProxyERC20
Target (underlying) contract: PeriFinance
Methods:
exchange(bytes32 src, uint256 fromAmount, bytes32 dest)
exchangeOnBehalf(address user, bytes32 src, uint256 fromAmount, bytes32 dest)
Events Emitted:
On a successful transaction, the following events occur:
If fees are owing on the src
pynth, these events come first:
Transfer
from account
to 0x0
for feesOwing
emitted on Proxy<pynth>
for the src
pynth.
Burned
feesOwing
from account
emitted on Proxy<pynth>
for the src
pynth.
ExchangeReclaim
from account
for feesOwing
on src
synth emitted on ProxySynthetix
Else if fees are owed on the src
pynth, then these events come first:
Transfer
from 0x0
to account
for feesOwed
emitted on Proxy<pynth>
for the src
pynth.
Issued
feesOwed
to account
emitted on Proxy<synth>
for the src
synth.
ExchangeRebate
from account
for feesOwed
on src
pynth emitted on ProxySynthetix
For every exchange, the following events then occur:
Transfer
from account
to 0x0
for fromAmount
emitted on Proxy<pynth>
for the src
pynth.
Burned
fromAmount
from account
emitted on Proxy<pynth>
for the src
pynth.
Transfer
from 0x0
to account
for toAmount - fee
emitted on on Proxy<pynth>
for the dest
pynth.
Issued
toAmount - fee
to account
emitted on Proxy<pynth>
for the dest
pynth.
Transfer
from 0x0
to FEE_ADDRESS
for fee
emitted on ProxypUSD
Issued
amount
to FEE_ADDRESS
emitted on ProxypUSD
PynthExchange
for account
emitted on ProxySynthetix
The PERI Finance system is encapsulated of a number of core contract complexes, and several auxiliary contracts that enhance token liquidity and overall system functionality. These on-chain component and how they communicate is reflected in the following high-level diagram.
The oracle, PERI Finance, pynths, inflationary supply, and fee pool elements encapsulated core functionality of PERI Finance system. Supporting Component like arbitrage and depot contracts ensure economic health of the system and does not change the fundamental behavior of system tokens.
They make sure that PERI and pynths flow freely through markets like Uniswap, improving liquidity and encouraging prices to be close to their theoretically correct values.
Each of the elements in this graph may be a complex composed of several contracts, as described below. Some relatively unimportant links have been omitted, but more detailed descriptions are available at the documentation pages for each specific contract.
PERI token Implementation.
Tracking Operational pynths.
Issues and burns pynths.
Exchanges between pynth flavours.
Mints the inflationary supply.
Maintains the system debt ledger.
PERI Finance smart contract communicates with pynths smart contract to manage their supply, and also the fee pool to remit fees when there is exchanges occur in pynths.
In order to properly convert between pynths, and to understand value of debt induced by minting tokens, the PERI Finance contract retrieves current token prices from the oracle. when expanding the supply of PERI, and to distribute the new tokens appropriately this contract communicates with the inflationary supply complex to mint the correct quantity.
Along with the debt ledger, which is a time series history of the overall value of the PERI Finance ecosystem, issuance data for the current fee period is updated whenever pynths are issued or burnt. This is also responsible for pushing historical issuance information to the fee pool, so that as fee periods roll over, a record of what portion of the total system debt is owned by different issuers is known when computing their fee entitlements.
Constituent Contracts
Contract
Description
PeriFinance
The main token contract.
PeriFinanceState
An auxiliary state contract which tracks current issuer data and the debt ledger.
Issuer
An auxiliary helper contract that performs the issuing and burning functionality.
Exchanger
An auxiliary helper contract that performs the exchange and settle functionality.
Implements all pynth tokens.
No of instances of the Pynth token contract are deployed, one for each flavour of pynth. pynths are largely interchangeable, being differentiate only by their names and prices because they run the same logic,
Pynths implement their own issuance and burning logic, but only the PeriFinance and fee pool contracts may invoke them. The PeriFinance contract uses these functions for issuance and burning by stakers, while the fee pool uses them to burn fees at the fee address and issue them to the claimers address.
Constituent Contracts
Contract
Description
Pynth
The base ERC20 token contract comprising most of the behaviour of all pynths. Each pynth has an associated proxy and token state contract.
Computes fee entitlements based on the current exchange fee rate
Tracking the fees and rewards to be distributed in each one.
Allows anyone to roll over to the next fee period once the current one has closed.
Directs the RewardEscrow to escrow inflationary PERI rewards for eligible issuers.
Stores and manages the details of the last several mint/burn events for each account, in order to compute the quantity of fees and rewards they are owed for the past several fee periods.
Allows issuers to claim any fees and rewards owed to them.
The fee pool mostly interacts with other system components through PERI Finance only. Whenever fees are collected, PeriFinance contract informs to the fee pool, it is allowed to append historic issuance records to its own account issuance ledger.
For example, Fee Pool interacts with the oracle through the PERI Finance contract, in order to issue fees and rewards. It also retrieves other data from there, like debt ledger information, issuance and collateralization ratios, and the addresses of pynth contracts.
Fee pool is responsible for computing the quantity of inflationary rewards that issuers are entitled to, it also communicates with the inflationary supply complex.
The Rewards distribution contract set the level of inflationary rewards to be distributed through the fee pool, which then disburses them by adding new vesting schedule entries in the Reward escrow contract.
Constituent Contracts
Contract
Description
FeePool
The main contract responsible for computing and storing the level of fees and rewards issuers are entitled to.
FeePoolState
Stores a limited history of issuance data per user.
FeePoolEternalStorage
Stores fee withdrawal times for each address.
DelegateApprovals
Allows addresses to delegate to others the right to claim fees on their behalf.
Defines the schedule according to which PERI tokens are generated from the inflationary supply.
Tracks for each year how many inflationary tokens have been minted so far, and how many remain.
Distributes inflationary rewards to different recipients in the proportions specified by the Peri finance protocol; i.e. for staking versus providing Uniswap liquidity.
Holds the minted inflationary rewards in escrow for a year after they are claimed.
Holds and distributes the escrowed tokens from the original token sale.
The inflationary supply complex control the flow of new PERI tokens being injected into the market. It communicates with the PeriFinance
contract.
The actual fraction of the weekly PERI rewards that a particular account is entitled to claim is computed by the fee pool, which is able to direct the RewardEscrow
and RewardsDistribution
contracts as to how they should distribute the new tokens.
Constituent Contracts
Contract
Description
SupplySchedule
Determines the rate that inflationary PERI tokens are released.
RewardEscrow
Receives inflationary PERI rewards to be distributed after a year escrow.
RewardsDistribution
Apportions designated quantities of inflationary rewards to the RewardEscrow
contract.
PeriFinanceEscrow
Holds the escrowed balances of PERI from the original token sale.
EscrowChecker
Augments the PeriFinanceEscrow
contract with a function for dApps to conveniently query it.
Updates, stores, and distributes up-to-date token prices .
Provides functionality to perform exchange rate conversions between pynth flavours.
The on-chain explanation of the oracle is the ExchangeRates
contract, whose stored prices it frequently updates. The primary user of these prices is the PeriFinance
contract, which needs them to calculate debt allocations when issuing and burning pynths, and to determine the correct quantity of pynths when performing an exchange of one flavour for another.
It is also used by some other contracts, such as the Depot
and PurgeablePynth
contracts.
Constituent Contracts
Contract
Description
Oracle
The oracle is responsible for collecting and updating all token prices known to the PeriFinance system. Although it is not a contract, it controls a known Ethereum address from which price updates are sent to the ExchangeRates
contract.
ExchangeRates
The PeriFinance exchange rates contract which receives token prices from the oracle, and supplies them to all contracts that need it.
The Depot allows users to exchange their pUSD for PERI. The depot has its own dedicated oracle, and all exchanges are performed at the current market prices, assuming pUSD is priced at one dollar.
Tracks the latest instances of all contracts required in the PeriFinance system, allowing them to be queried by a bytes32
name
Each contract which inherits MixinResolver
will have access to the AddressResolver
contract, and can lookup at transaction time where it's sibling contracts are located.
Provides a static addresses for contracts where the underlying logic can be upgraded.
Provides an interface that allows contracts to operate beneath a proxy.
Each contract which uses a proxy must inherit from Proxyable
. Function calls are forwarded from the proxy to the proxyable base, while return data and event information travels the other way. Ultimately most contracts should communicate with one another by proxy
The PeriFinance
, FeePool
, and all Pynth
contracts exist behind their own individual proxies.
Contracts
Contract
Description
Proxy
The PeriFinance proxy contract.
ProxyERC20
A proxy contract which explicitly supports the ERC20 interface.
Proxyable
An abstract base contract designed to work with the PeriFinance proxy.
These contracts mostly are not deployed on their own, but provide functionality inherited by other contracts already listed.
Contracts
Contract
Description
EternalStorage
A persistent/unstructured smart contract storage pattern.
ExternStateToken
A partial ERC20 token contact with an external state, which all tokens in PeriFinance are built upon.
LimitedSetup
A contract which can disable functions a set time after deployment.
MixinResolver
A mixin to give the inheritor access the AddressResolver
instance.
Owned
A contract with a distinct owner who can have special privileges.
Pausable
A contract whose operations can be paused by its owner.
SafeDecimalMath
A library for performing fixed point arithmetic at two different precision levels.
SelfDestructible
A contract that can be self destructed by its owner after a delay.
State
An external state contract which can restrict its fields to be modifiable only by a particular contract address.
TokenState
A state contract to be used with ExternStateToken
to store balances.
PERI stakers can lock their PERI COIN into the Peri Finance protocol Staking Dapp and take on a debt position in the shared pool of the combined USD value of all Pynths . After Successful staking, they issued pUSD that represents their current debt position in USD.
As the prices of underlying pynths fluctuate with oracle updates, the size of the debt pool fluctuates too, It means that staker's debt independent from the amount of pUSD that was issued.
To consider the risk stakers take on by being exposed to a shared debt pool, they are rewarded each week in the form of pUSD trading fees and PERI inflationary rewards .
Destination contract (address): ProxyERC20
Target contract (ABI): PeriFinance
Note: PeriFinance uses a proxy system. The ABI of the underlying PeriFinance ProxyERC20 contract you need is PeriFinance.
issuePynths(uint256 amount)
issuePynthsOnBehalf(address user, uint256)
issueMaxPynths()
issueMaxPynthsOnBehalf(address user)
On a successful transaction, the following events occur:
name
emitted on
address from
address to
uint value
Transfer
ProxypUSD
0x0
msg.sender
(or user
)
amount
of sUSD
name
emitted on
address account
uint value
Issued
ProxypUSD
msg.sender
(or user
)
amount
name
emitted on
address account
uint debtRatio
uint debtEntryIndex
uint feePeriodStartingDebtIndex
IssuanceDebtRatioEntry
FeePool
msg.sender
(or user
)
debtRatio
debtEntryIndex
feePeriodStartingDebtIndex
In order to close their position, PERI stakers need to burn enough pUSD to cover their debt position
Destination contract (address): ProxyERC20
Target contract (ABI): PeriFinance
Note:
PeriFinance
uses a proxy system. The ABI of the underlyingPeriFinance
ProxyERC20
contract you need isPeriFinance
. Learn more about how proxies work by visiting the overview page.
burnPynths(uint256 amount)
burnPynthsOnBehalf(address user, uint256 amount)
burnPynthsToTarget()
burnPynthsToTargetOnBehalf(address user)
On a successful transaction, the following events occur:
name
emitted on
address from
address to
uint value
Transfer
ProxypUSD
msg.sender
(or user
)
0x0
amount
of pUSD
name
emitted on
address account
uint value
Burned
ProxypUSD
msg.sender
(or user
)
amount
name
emitted on
address account
uint debtRatio
uint debtEntryIndex
uint feePeriodStartingDebtIndex
IssuanceDebtRatioEntry
FeePool
msg.sender
(or user
)
debtRatio
debtEntryIndex
feePeriodStartingDebtIndex
PERI stakers (aka minters, aka issuers) get staking rewards each week, in the form of pUSD trading fees and PERI inflationary rewards.
Destination contract (address): ProxyFeePool
Underlying contract (ABI): FeePool
Methods
claimFees()
claimOnBehalf(address user)
On a successful transaction, the following events occur:
name
emitted on
address from
address to
uint value
Transfer
ProxypUSD
FEE_ADDRESS
to 0x0
amount
of pUSD
name
emitted on
address account
uint value
Burned
ProxypUSD
FEE_ADDRESS
amount
name
emitted on
address from
address to
uint value
Transfer
ProxypUSD
0x0
msg.sender
(or user
)
amount
of pUSD
name
emitted on
address account
uint value
Issued
ProxypUSD
msg.sender
(or user
)
amount
of pUSD
name
emitted on
address beneficiary
uint time
uint value
VestingEntryCreated
RewardEscrow
msg.sender
(or user
)
now
amount
of PERI rewards
name
emitted on
address account
uint sUSDAmount
uint snxRewards
FeesClaimed
ProxyFeePool
msg.sender
(or user
)
pUSDAmount
periRewards
Below mentioned script used to build, deploy and Verify the PERI Finance Source code to a Different testnet and mainnet Network.
This will compile bytecode and ABIs for all .sol files found in node_modules and the contratcs folder. It will output them in a compiled folder in the given build path mentioned below, along with the flattened source files under the folder flattened
This will deploy (or reuse) all of the contracts listed in the contract-flags input file, as well as perform initial connections between the contracts.
-a, --add-new-pynths
Whether or not any new pynths in the pynths.json file should be deployed if there is no entry in the config file.
-b, --build-path [value]
Path for built files to go. (default of ./build
- relative to the root of this repo). The folders compiled
and flattened
will be made under this path and the respective files will go in there.
-c, --contract-deployment-gas-limit <value>
Contract deployment gas limit (default: 7000000 (7m))
-d, --deployment-path <value>
Path to a folder that has your input configuration file (config.json
), the synths list (synths.json
) and where your deployment.json
file will be written (and read from if it currently exists).
-g, --gas-price <value>
Gas price in GWEI (default: "1")
-m, --method-call-gas-limit <value>
Method call gas limit (default: 150000)
-n, --network <value>
The network to run off. One of mainnet, kovan. (default: "kovan")
-o, --oracle <value>
The address of the oracle to use.
-f, --fee-auth <value>
The address of the fee Authority to use for feePool. --oracle-gas-limit
To verify the contracts on Etherscan (by uploading the flattened source files and ABIs).
For all given contracts, will invoke nominateNewOwner for the given new owner;
It assist owner take ownership of nominated contracts and run any deployment tasks deferred to them.
This script attempt to remove all given synths from the PERI finance contract (as long as they have total supply of 0 and update config.json and pynths.json for the deployment folder.
This will attempt to replace all given synths with a new given subclass It does this by disconnecting the existing TokenState for the Pynth and attaching it to the new one.
Will attempt purge the given synth with all token holders it can find. Uses the list of holders from mainnet, and as such won't do anything for other networks.
Will initiate the PeriFinance release process, publishing the PeriFinance npm
module and updating all dependent projects in GitHub and npm
.
Will deploy an instance of StakingRewards.sol with the configured stakingToken and rewardsToken in rewards.json. Then run node publish verify
For PeriFinance
repo, we are using the following branch mapping:
alpha
is KOVAN
beta
is RINKEBY
rc
is ROPSTEN
master
is MAINNET
PRs should start being merged into develop
then deployed onto KOVAN
, then merged into staging
once deployed for releasing onto rinkeby
and ropsten
for staging into a mainnet
release. These can be done multiple times for each branch, as long as we keep these up to date.
Using semantic versioning (semver): v[MAJOR].[MINOR].[PATCH]-[ADDITIONAL]
MAJOR
stipulates an overhaul of the Solidity contracts
MINOR
are any changes to the underlying Solidity contracts
PATCH
are for any JavaScript or deployed contract JSON changes
ADDITIONAL
are for testnet deployments
-alpha
is for Kovan
-beta
follows alpha, and contains Rinkeby
.
-rc[N]
follows beta, and contrains Ropsten
. N
starts at 0
and can be incremented until we are ready to release without the suffix.
In the environment folder you are deploying to, add the synth key to the pynths.json
file. If you want the synth to be purgeable, add subclass: "PurgeablePynth"
to the object.
[Optional] Run build
if you've changed any source files, if not you can skip this step.
Run deploy
as usual but add the --add-new-pynths
flag
Run verify
as usual.
Source:
Source:
Source:
Source:
Source:
Source: c
Source:
Source:
Source:
Source: c
Source: c
Source:
Source:
Source:
Source: c
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source:
Source: