import wixUsersBackend from 'wix-users-backend'; import {fetch} from 'wix-fetch'; const CLIENT_ID = '1112811133259218974'; const CLIENT_SECRET = 'MorYUCBU0MLMKdAnkggpOxon-GaXSbLG'; const REDIRECT_URI = 'https://www.stockmarketchat.net/_api/wix-public/myapp/auth/callback'; // Handles the authentication callback export function myApp_auth_callback(request) { const code = request.query.code; const tokenEndpoint = `https://discord.com/api/oauth2/token`; const payload = { grant_type: 'authorization_code', code, redirect_uri: REDIRECT_URI }; const options = { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': `Basic ${Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString('base64')}` }, body: Object.keys(payload) .map(key => encodeURIComponent(key) + '=' + encodeURIComponent(payload[key])) .join('&') }; return fetch(tokenEndpoint, options) .then(response => response.json()) .then(data => { const accessToken = data.access_token; // Use the access token to authenticate the user and handle the login logic here // e.g., create a session for the authenticated user // wixUsersBackend.createSession() }); }
top of page

Macroeconomics Basics: GDP

I'm not an economist. Nor am I planning to be one. But I am studying "Macro" as part of a Bachelor's Degree I'm taking in Business Management, and invariably, if you like and invest the stock market, even if you're not studying Macro like I am, it's fundamental to understand at least the basics of how a country's economy and government's policies can influence stock market moves, so as to better your decision making on your equity investments. Macroeconomics study the working of an economy as a whole (all households, all firms, all markets). Some of the macro variables/indicators are GPD, inflation, central bank interest rates, or the unemployment rate. In this series we will overview these 4 variables, starting with GDP.

 

GDP


Gross Domestic Product is the standard measure of the value added created through the production of goods and services in a country during a certain period. It's usually measured in timeframes of 1 year. To summarize it in practical and investment-oriented terms, it's an indicator by which we can measure the economic growth/contraction from one year to the other, by watching GDP values over different timeframes. There are several different approaches by which we can measure GDP, like the Production approach, or the Expenditure approach. Each tackles economic activity from a different angle, and as such, GPD is defined by whatever approach we decide to have. It's important to note that's it's inherently hard to measure economic activity to pinpoint accuracy. GDP measures don't account for certain activities, like the transaction of used goods, and goods sold in the black market, or tax evasion.


There are several important details to consider with Macroeconomic variables like GDP. Inaccurate/wrong measurements of macroeconomic aggregates may lead to dangerous or perverse policy measures, or private agents may make the wrong decisions. Also, the state of the economy and our well-being may give a misleading view of the true state we are living in. In fact, in economics, there may be very few things more important than measuring correctly the main macroeconomic aggregates.


Real GDP vs Potential GDP


Potential GDP refers to the level or measure of output that an economy can produce at a constant inflation rate. Potential output is estimated by estimating potential gross domestic product. Capital accumulation, or stock, labor growth, market efficiency, liquidity, and government policies influence this measure. To give it some context, it's a long term trend around which the economy oscillates.