Venmo-style peer-to-peer payments database schema

How a social payments app models its data: wallets and balances, linked bank accounts and cards, transfers between friends, payment requests, bill splits, per-payment privacy, and the feed with comments and likes.

Venmo P2P ER diagram

Venmo-style peer-to-peer payments database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 users idBIGINT handleVARCHAR display_nameVARCHAR emailVARCHAR phoneVARCHAR avatar_urlVARCHAR default_audienceVARCHAR identity_statusVARCHAR is_frozenBOOLEAN created_atTIMESTAMPTZ deactivated_atTIMESTAMPTZ wallets idBIGINT user_idBIGINT currency_codeCHAR balance_minorBIGINT pending_out_minorBIGINT statusVARCHAR created_atTIMESTAMPTZ funding_sources idBIGINT user_idBIGINT source_typeVARCHAR processor_tokenVARCHAR institution_nameVARCHAR last_fourCHAR brandVARCHAR verification_stat…VARCHAR is_defaultBOOLEAN can_receive_payoutBOOLEAN linked_atTIMESTAMPTZ removed_atTIMESTAMPTZ transfers idBIGINT sender_idBIGINT recipient_idBIGINT sender_wallet_idBIGINT recipient_wallet_…BIGINT funding_source_idBIGINT payment_request_idBIGINT idempotency_keyVARCHAR amount_minorBIGINT currency_codeCHAR fee_minorBIGINT note_textVARCHAR audienceVARCHAR statusVARCHAR failure_reasonVARCHAR created_atTIMESTAMPTZ completed_atTIMESTAMPTZ payment_requests idBIGINT requester_idBIGINT payer_idBIGINT split_request_idBIGINT amount_minorBIGINT currency_codeCHAR note_textVARCHAR statusVARCHAR reminded_atTIMESTAMPTZ expires_atTIMESTAMPTZ created_atTIMESTAMPTZ resolved_atTIMESTAMPTZ split_requests idBIGINT organizer_idBIGINT total_minorBIGINT currency_codeCHAR note_textVARCHAR split_methodVARCHAR statusVARCHAR created_atTIMESTAMPTZ settled_atTIMESTAMPTZ split_participants idBIGINT split_request_idBIGINT user_idBIGINT payment_request_idBIGINT share_minorBIGINT share_basisVARCHAR statusVARCHAR settled_atTIMESTAMPTZ funding_transfers idBIGINT user_idBIGINT wallet_idBIGINT funding_source_idBIGINT directionVARCHAR amount_minorBIGINT currency_codeCHAR fee_minorBIGINT speedVARCHAR statusVARCHAR external_referenceVARCHAR created_atTIMESTAMPTZ completed_atTIMESTAMPTZ wallet_entries idBIGINT wallet_idBIGINT entry_typeVARCHAR transfer_idBIGINT funding_transfer_…BIGINT amount_minorBIGINT balance_after_min…BIGINT created_atTIMESTAMPTZ friendships idBIGINT user_idBIGINT friend_idBIGINT statusVARCHAR sourceVARCHAR created_atTIMESTAMPTZ accepted_atTIMESTAMPTZ transfer_comments idBIGINT transfer_idBIGINT author_idBIGINT bodyVARCHAR created_atTIMESTAMPTZ deleted_atTIMESTAMPTZ transfer_likes transfer_idBIGINT user_idBIGINT created_atTIMESTAMPTZ

Related database schemas