Arbitrageurs
Last updated
Last updated
Portals earn yield by staking deposited tokens
These accrued assets can be purchased by anyone with a fixed amount of PSM
When the value of the Portal’s earned assets exceeds the value of the PSM needed to buy them, it creates an arbitrage opportunity
Each Portal is created with a setting that determines a fixed amount of PSM which can buy the entire balance of its accrued tokens.
For example, the HLP Portal receives USDC by staking users’ HLP. This accrued yield can be purchased by anybody with 100k PSM. In Portals V2, the arbitrage amount is 100k PSM as well.
Once the value of the accrued Portal yield exceeds the value of the 100k PSM, a riskless profit can be made by buying the accrued assets with PSM.
Additionally, 10% (V1) or 20% (V2) of the PSM used to buy the Portal’s yield is sent to the funding reward pool, which can then be claimed by bToken holders. Once the bToken holders have all been paid back in full, 100% of the PSM will go to the Portal.
This is an effective means to continue funding the Portal with PSM to pay out to depositors. It’s a predictable arbitrage scenario where the arbitrageur wins by making “free money” while the users win as the Portal can continue paying them PSM tokens.
Generally, monitoring the arbitrage opportunities in Portals is best to be automated via bots / scripts. You can find a premade python script in our open source github repo.
That said, the following guide will help you better understand the flow and enable you to manually check for valid arbitrage situations.
First, head over to our assistant contract on arbiscan: ConvertHelper
In the read section, you can retrieve the available yield in each Portal from this smart contract. For the HLP Portal, simply click on V1_getRewardsUSDCE. For the group of V2 Portals you click on V2_getRewards and enter the address of the respective Portal that you want to check for accumulated yield. You find the contract addresses here.
Be aware of the different decimal settings of yield tokens. USDC/e have 6 decimals while WBTC has 8 decimals. The other tokens have 18 decimals.
That means, the displayed number from calling getRewards must be divided by 10^6, 10^8 or 10^18 to get the number of "full tokens". For example 123456 USDC = 0.123456 USDC
All present Portals require 100k PSM tokens to buy the accumulated yield. If the accumulated yield is larger than the market value of 100k PSM, congratulations, you just found an arbitrage opportunity!
The next step is to execute the arbitrage.
First, you need to acquire 100k PSM whichever way. Then you need to approve the ConvertHelper to spend your PSM, otherwise the arbitrage transaction will fail. Go to the PSM contract on a blockexplorer, navigate to the "write as proxy" section, connect your web3 wallet with the blockexplorer and call "approve". The inputs you need are the address of the ConvertHelper (0xa94f0513b41e8C0c6E96B76ceFf2e28cAA3F5ebb) and 100k PSM considering 18 decimals, i.e. 100000000000000000000000. You can also set a higher allowance if you don't want to repeat this process every time.
Lastly, you go back to the ConvertHelper in the "write" section & connect your web3 wallet. Depending on the Portal whose yield you want to acquire, you need to either call V1_convertUSDCE or V2_convert with the target Portal address. Further, you enter the recipient address which shall receive the yield - yes, you can pay 100k PSM with one address and receive the yield straight to a different address. Generally, just put your wallet address there. The field _minReceived allows you to specify how many yield tokens, e.g. USDC you expect to receive, otherwise the transaction will fail. This is an option to prevent frontrunning. At time of writing, Arbitrum still has a centralized sequencer which effectively prevents frontrunning, so you can set this field to 1.