Connect DNSE (Vietnamese stocks)
Get your DNSE API key plus a Gmail app password so Fastbot can read the OTP and renew your trading session without you doing anything.
DNSE lets Fastbot read your Vietnamese stock portfolio and place orders on the HOSE and HNX exchanges. Your shares and cash stay in your DNSE account.
Why DNSE needs more settings than the others
DNSE requires two-factor authentication for every trading session: every 8 hours it emails you a 6-digit OTP. Without a way to read that code, you would have to type it in every 8 hours.
Fastbot solves this by reading your mailbox over IMAP, taking the OTP and renewing the session itself. That is why you need a Gmail app password alongside the API key.
Step 1: Get your DNSE API key
- Sign in to DNSE Entrade and open the API settings.
- Create a new key pair and save the API Key and API Secret.
- Note the email address on your DNSE account — that is where OTPs arrive.
Step 2: Create a Gmail app password
This is a 16-character app password, NOT your Gmail password.
- Your Gmail account must have 2-step verification switched on first.
- Go to
myaccount.google.com/apppasswords. - Create a new app password and name it
fastbot. - Google shows a 16-character string — copy it now, it is shown only once.
An app password only allows reading mail and can be revoked at any time without affecting your main password.
Step 3: Enter them into Fastbot
⚙️ Settings → ⚙️ Edit .env, then enter five values:
| Setting | Value |
|---|---|
DNSE_ENABLED | true |
DNSE_API_KEY | API Key from DNSE |
DNSE_API_SECRET | API Secret from DNSE |
DNSE_EMAIL | The email on your DNSE account (where OTPs arrive) |
IMAP_PASSWORD | The 16-character Gmail app password |
For any setting not in the list yet, tap ➕ Add variable and send it as DNSE_ENABLED=true.
When they are all in, tap 🔄 Restart Bot.
Check it worked
Open 🇻🇳 DNSE → 💰 DNSE account:
Fastbot💰 DNSE accountThis screen always shows the current trading session, so you know whether orders will go through.
If the OTP never arrives
Fastbot tells you plainly: "No new OTP from noreply@mail.dnse.com.vn after 120s. Check that the email reached the inbox." Usually one of:
- A Gmail filter is moving the OTP email elsewhere — let it land in the Inbox.
- You pasted your Gmail password instead of the 16-character app password.
- The app password was revoked — create a new one.
Next: DNSE orders and DCA.