TRIM-AF Cohorts
Inclusion Criteria:
1. Permanent pacemaker or implantable cardioverter-defibrillator (ICD) (with or without cardiac resynchronization therapy (CRT) with an implanted atrial lead capable of providing AF diagnostics and remote monitoring.
2. Paroxysmal AF, or persistent AF with plans for conversion.
3. AF on cardiac implantable electrical device (CIED) over the past 3 months with at least 1 episode lasting ≥5 minutes.
4. If on an antiarrhythmic drug, then on a stable regimen for the past 3 months.
Exclusion Criteria:
1. Permanent AF with no plans to convert to sinus rhythm.
2. If in persistent AF, current episode \>12 months in duration (current long-standing persistent AF)
3. NYHA Functional Class IV heart failure
4. On metformin or other pharmacologic therapy for diabetes mellitus.
5. Use of anti-retroviral protease inhibitors (e.g. ombitasvir, paritaprevir, ritonavir, dasabuvir) or topiramate.
6. Known sensitivity to metformin
7. Moderate renal disease (eGFR \<45 ml/min/1.73 m2)
8. Significant alcohol use (average \>2 drinks/day)
9. Hepatic dysfunction - bilirubin \>1.5x ULN, unless due to Gilbert's syndrome
10. Planned antiarrhythmic (class I or III) drug change, AF ablation/PVI procedure or cardiac surgery over the first 3 mos of the study
11. AF ablation/PVI procedure performed in the past 6 months
12. Device changed or implanted in the past 3 months
13. For patients on dofetilide with a pacemaker, QTc \>490 ms if QRS duration is \</=100 ms. If QRS duration is \>100 ms, adjusted QTc \>490 ms. Adjusted QTc = QTc - (QRS duration - 100 ms).
14. Women who are pregnant, breast-feeding or of child-bearing potential and not willing or able to use an acceptable form of contraception.
15. Participants considered by the investigator to be unsuitable for the study for any of the following reasons: Not agreeable for treatment with metformin or anticipated to have poor compliance on study drug treatment; inability to follow diet or exercise instructions; unwilling to attend study follow-up visits
16. Life expectancy less than 2 years due to concomitant disease.
17. Age \<18 years old.
TRIM - No AF Cohort
Inclusion Criteria:
1. Permanent pacemaker or ICD (with or without CRT) with an implanted atrial lead capable of providing AF diagnostics and remote monitoring.
2. No AF on CIED over the past 6 months.
3. No history of AF.
4. Age \>/=18 years old.
Exclusion Criteria:
1. History of AF.
2. NYHA Functional Class IV heart failure
3. On metformin or other pharmacologic therapy for diabetes mellitus.
4. Use of anti-retroviral protease inhibitors (e.g. ombitasvir, paritaprevir, ritonavir, dasabuvir) or topiramate.
5. Moderate renal disease (eGFR \<45 ml/min/1.73 m2)
6. Significant alcohol use (average \>2 drinks/day)
7. Hepatic dysfunction - bilirubin \>1.5x ULN, unless due to Gilbert's syndrome
8. Planned antiarrhythmic (class I or III) drug change, cardiac surgery over the first 3 mos of the study
9. Device changed or implanted in the past 3 months
10. For patients on dofetilide with a pacemaker, QTc \>490 ms if QRS duration is \</=100 ms. If QRS duration is \>100 ms, adjusted QTc \>490 ms. Adjusted QTc = QTc - (QRS duration - 100 ms).
11. Women who are pregnant, breast-feeding or of child-bearing potential and not willing or able to use an acceptable form of contraception.
12. Participants considered by the investigator to be unsuitable for the study for any of the following reasons: Not agreeable for treatment with metformin or anticipated to have poor compliance on study drug treatment; inability to follow diet or exercise instructions; unwilling to attend study follow-up visits
13. Life expectancy less than 2 years due to concomitant disease.
14. Age \<18 years old.