Energy Station (testnet only)¶
Concept¶
The Bancor Protocol enables automatic price determination and an autonomous liquidity mechanism for tokens on smart contract blockchains. In this case, we took advantage of the automatic price adjustment mechanism from the Bancor protocol. We use the concept of Relay Token but simplified the process of buying and selling. So the concepts of Energy Station
are:
- Create a Bancor conversion contract connecting two tokens.
- One connector token is VET, the other one is VTHO token.
- The weight of connector token is 50%.
- No smart token concept needed. Just allow the convention between VET and VTHO token.
Buying VTHO by spending VET¶
+----+ +--------------+
| | ---VET-->| |
|User| |Energy-Station|
| | <--VTHO--| |
+----+ +--------------+
Buying VET by spending VTHO¶
+----+ +--------------+
| | --VTHO-->| |
|User| |Energy-Station|
| | <--VET---| |
+----+ +--------------+
Deployment¶
- Deploy
EnergyStation
EnergyStation.setConversionFee(conversionFee in ppm)
- Send VET by
EnergyStation.fillVET()
- Approve EnergyStation for VTHO token
- Send VTHO by
EnergyStation.fillEnergy()
- Enable conversion by
EnergyStation.disableConversions(false)
The amount of VET and VTHO sent to EnergyStation
will be the initial supply of two connector token.
Usage¶
- Simulate
EnergyStation.getEnergyReturn(amount)
orEnergyStation.getVETReturn(amount)
to get converted value and calc minimum return asminReturn
- Convert VET to VTHO:
EnergyStation.convertForVET(minReturn)
- Convert VTHO to VET:
Energy.approve(EnergyStation, amount)
andEnergyStation.convertForEnergy(amount,minReturn)