Buy & Sell G$
Instruction guide on how to interact with GoodDollarV2 contracts for buying and selling G$s directly
Last updated
Instruction guide on how to interact with GoodDollarV2 contracts for buying and selling G$s directly
Last updated
There are key user and stakeholder hypotheses built into our theory of change and adoption. Ultimately, the success of the GoodDollar economy is contingent upon market demand from both those who support G$ and those who claim it, as the economy itself is a balance between supply and demand.
G$ is designed to gain usage and to be widely adopted as a means of exchange over time. Like Bitcoin, the initial dollar value, or “price”, of each G$ will be low – in the tenths of a cent on the dollar range to begin with. Our belief is that, because it offers free access to an instantly liquid, global basic income network, G$ will first be adopted in markets where smartphone-enabled populations currently live on less than US$10 a day. We believe that, for these populations, G$ could emerge as a useful complementary currency for use in peer-to-peer digital marketplaces as well as for on-the-ground goods and services, particularly as the network grows.
GoodDollar ERC20 is a reserve backed currency with issuance governed by an AMM (automated market maker) encoded in the GoodReserve contract. Each time you buy or sell, from or to, the reserve - tokens are respectively being minted or burned according to equation 2 WhitePaper.
You are able to buy and sell G$ directly to, and from, the GoodDollar Reserve contract. This healthy activity grows the liquidity of the ecosystem and increases the impact of the UBI GoodDollar delivers. Two key enhancements to the Reserve AMM contract support this change:
The introduction of a 3% “exit contribution” fee on all sales of G$ into the #GoodDollar Reserve in exchange for supported cryptocurrencies. All fees go back into the #GoodDollar Reserve and grow the value of the overall economy.
The creation of a new ERC20 token – G$X – that lets people buy and sell G$ to the Reserve without a fee. All those who buy G$ from the reserve will also receive an equal number of G$X.
You should have a web3 wallet (like MetaMask).
You should have enough ETH in your wallet in order to pay the gas fees of the transaction.
You should have enough balance of the currency you are using to buy/sell with.
You should approve to exchangeHelper enough allowance to use your balance in order to buy/sell G$.
Go to the contract page of the currency you are willing to buy/sell with, for example cDAI contract page and click on “Contract”:
2. Now click on “Write as Proxy”:
3. Connect to your wallet by clicking on “Connect to Web3”:
4. Now scroll down and click on “11. approve”:
5. You will have to enter two parameters: Spender and Amount. The spender is the contract address of the ExchangeHelper (find the relevant exchangeHelper address in the references section on the bottom of the page), the amount is the amount you would like to approve in the currency you are buying with, click Write.
First, make sure you have done everything in the prerequisites section.
Optional step, using the buyReturn function you can check how much G$ you will get.
Go to GoodMarketMaker (either Mainnet, Kovan or Ropsten, link in the references below).
Click on “Contract”:
3. Click on “Read as Proxy”:
4. Click on “2. buyReturn”:
5. At “_token (address) insert the address of the token you are planning to buy with and at the “_tokenAmount (uint256)” insert the amount that you would like to pay with (don’t forget to add the relevant amount of decimals.
6. For example, let’s check how much G$ you will get for 10 cDAI, so you will put cDAI contract address (in this case it’s Kovan network) at the first field and 1000000000 (which is 10 cDAI because cDAi has 8 decimals):
And you got a result of 9080104 which is 90801.04 G$ because G$ has 2 decimals.
3. Now, go to the exchangeHelper (either Mainnet, Kovan or Ropsten, link in the references below)
4. Click on “Contract”:
5. Click on “Write as Proxy”:
6. Connect your wallet by clicking on “Connect to Web3” button:
7. Click on “1. buy”:
8. Finally, we are about to purchase G$, your screen should look like that now:
9. Now let’s explain those 6 parameters, followed by an example:
buy: Payable amount in ether, if you buy in DAI / cDAI insert 0.
_buyPath (address[]): The address of the token you want to buy with, if you buy with DAI / cDAI than insert one of those addresses.
_tokenAmount (uint256): Amount of G$ you would like to buy in the currency you are paying with, don’t forget to add the correct amount of zeros according to the specific token, for example 8 zeros for cDAI and 18 zeros for DAI.
_minReturn (uint256): Minimum amount of G$s expected after buy transaction.
_minDAIAmount (uint256): If input token is not cDAI then this parameter must be provided in order to correct swap and this parameter for minimum DAI return amount from Uniswap swap transaction
_targetAddress (address): Recipient address, if the recipient is you then insert 0x0000000000000000000000000000000000000000
Example with cDAI:
G$X token lets people buy and sell G$ to the Reserve without an exit fee. All those who buy G$ from the reserve will also receive an equal number of G$X. See Claim GOOD and G$X
Optional step, using the sellReturn function you can check how much you will get for the G$ you are planning to sell.
Go to GoodMarketMaker (check the references section for the relevant link).
Click “Read as Proxy”.
Go to “13. sellReturn”.
You will have two parameters to fill;
_token (address) - this is the address of the token contract you would like to check how much you will get for your GoodDollars you are planning to sell.
_gdAmount (uint256) - this is the G$ amount you would like to sell and check how much you will get for, don’t forget to add the two decimals.
Go to exchangeHelper contract page.
Click on “Contract”.
Click on “Write as Proxy”.
Connect to your wallet by clicking on “Connect to Web3” button.
Open the sell function by clicking on “3. Sell”.
Now the parameters here are almost the same as the parameters on the buy function.
_sellPath (address[]): The address of the token you would like to get for the G$ you are selling, if you buy with DAI / cDAI than insert one of those addresses.
_gdAmount (uint256): Amount of G$ you would like to sell, don’t forget to add two zeros as G$ has two decimals.
_minReturn (uint256): Minimum amount of G$s expected after buy transaction.
_minTokenReturn (uint256): If input token is not cDAI then this parameter must be provided in order to correct swap and this parameter for minimum DAI return amount from Uniswap swap transaction
_targetAddress (address): Recipient address, if the recipient is you then insert 0x0000000000000000000000000000000000000000
Contract
Mainnet
Kovan
Ropsten
Gooddollar ERC20
exchangeHelper
Did not released yet
GoodMarketMaker
Did not released yet
DAI
cDAI