Discoin starts with a currency called ABC with a reserve of 100.
Each ABC is equivalent to 2 Discoin tokens (𝔻$), and vice versa.
That means the market cap of ABC is 200𝔻$.
A user wants to convert 10 ABC into XYZ.
Discoin has their 10 ABC added to the reserve.
The Discoin reserve is now holding 110 ABC.
The market cap of all the ABC in 𝔻$ should still be 200𝔻$.
To keep the market cap at the same value we devalue ABC.
The new value of 1 ABC is now 1.81𝔻$.
The response from the API directs the receiving bot to payout the correct amount of XYZ. This value is derived by converting the currencies like this:
Connecting to the reality, Discoin uses a mix of Bretton Woods System (pegging against a certain amount of resource, in their case Gold, in our case Discoin tokens) and floating exchange rate (supply and demand flunctuates the rate).