+ Entity Relationship Diagram

Scroll to zoom Drag to pan Double-click to fit 100%
erDiagram ACHWithdrawalPendingTransfer { string id PK int amount int account FK string transaction FK } ACHWithdrawalPendingTransfer }o--|| Account : account AccountComment { string id PK int author FK string text } AccountComment }o--|| User : author AccountFoldCardRenewalIntervalEvent { string id PK string old_value string new_value bool user_initiated int account FK } AccountFoldCardRenewalIntervalEvent }o--|| Account : account AccountFoldCardTierEvent { string id PK string old_value string new_value bool user_initiated string reason } AccountFoldCardTierEvent }o--|| Account : account AccountOrderBonusEvent { string id PK int account_order_bonus FK } AccountToSpendForSpinRewardTrigger { string id PK string account FK int spend_for_spin_reward_trigger FK int excess_spend } AccountToSpendForSpinRewardTrigger ||--|| Account : account AccountToSpendForSpinRewardTrigger }o--|| SpendForSpinRewardTrigger : spend_for_spin_reward_trigger AccountUnseenFeature { string id PK int account FK string feature_name } AccountUnseenFeature }o--|| Account : account AddressVerification { string id PK int account FK int fold_card FK string status string address_1_tokenized } AddressVerification }o--|| Account : account Adjustment { string id PK int group FK datetime time string notes string brand } Adjustment }o--|| AdjustmentGroup : group AdjustmentGroup { string id PK int profile FK string notes } AdjustmentGroup }o--|| CardForCoinProfile : profile AdminAuditTrailEvent { string id PK datetime time string http_verb string path int user FK } AdminAuditTrailEvent }o--|| User : user Answer { string id PK int question FK int account string text_tokenized } Answer }o--|| Question : question AppFeaturedItem { string id PK string image string action string additional_data bool is_enabled } AppNotificationTarget { string id PK int app_notification FK int device FK string status int retry_count } AuthorizedUserAudit { string id PK int authorized_user FK string status } AuthorizedUserStatusStateMachine { string id PK } AutoBuyConfig { string id PK int denomination string source int refill_at int refill_to } AutoBuyError { string id PK int auto_buy_config FK int order FK string details datetime time } AutoBuyError }o--|| AutoBuyConfig : auto_buy_config AutoStack { string id PK string reference_id string frequency datetime next_execution_time int input_amount } AutoStack }o--|| Account : account Ban { string id PK string address_type string address string notes datetime time } BaseModelMixin { string id PK datetime created_at datetime modified_at } BitcoinBuyLockOverride { string id PK string account FK bool is_enabled } BitcoinBuyLockOverride ||--|| Account : account BitcoinBuyLockOverrideAudit { string id PK int modified_by FK string action int quote_overridden FK int account_overridden FK } BitcoinBuyLockOverrideAudit }o--|| Account : modified_by BitcoinBuyLockOverrideAudit }o--|| WalletQuote : quote_overridden BitcoinBuyLockOverrideAudit }o--|| Account : account_overridden BitcoinGiftCardChannel { string id PK string name int spread_bips int fee_bips } BitcoinGiftCardPromotion { string id PK int account FK string promotion_name } BitcoinGiftCardPromotion }o--|| Account : account BitcoinGiftCardQuote { string id PK int account FK string gift_card_number int provider_transaction_id int provider_batch_number } BitcoinGiftCardQuote }o--|| Account : account BitcoinGiftCardQuote ||--|| BitcoinGiftCardPromotion : promotion BitcoinSpread { string id PK int bips string transaction_type int fold_card_tier string provider } BitgoTransferAudit { string id PK string fortress_account FK string bitgo_account FK string source int pre_transfer_amount } BrandAccount { string id PK string username string password } BulkImport { string id PK datetime created_at string csv_file string format string origin } Buyer { string id PK string name } CachedAccountCompletedChecklistItem { string id PK int account FK string name } CachedAccountCompletedChecklistItem }o--|| Account : account CardBalance { string id PK int card FK int amount int times_seen datetime first_seen } CardForCoinProfile { string id PK string user string nickname string legacy_referral_tokens FK int reputation_adjustment } CardForCoinProfile }o--o{ LegacyReferralToken : legacy_referral_tokens CardForCoinProfile }o--|| ProfileBitcoinAddress : bitcoin_address CardForCoinProfile }o--|| ProfileEmail : email CardForCoinProfile }o--|| ProfilePhoneNumber : phone_number CardHistory { string id PK int card FK datetime created_at } CardReservation { string id PK datetime created_at int card FK string reason string notes } CardTerm { string id PK int order FK int rate int amount_offered_usd string brand } ChainBucket { string id PK int account FK string bucket_id string wallet_id datetime time } ChainBucket }o--|| Account : account ChainBucket }o--|| ChainBucketBalance : balance ChainBucketBalance { string id PK int bucket FK int total_balance int confirmed_balance int times_seen } ChainBucketBalance }o--|| ChainBucket : bucket CreditCardAutoPay { string id PK string public_id int stripe_account FK int payment_method FK string payment_type } CreditCardAutoPay }o--|| StripeAccount : stripe_account CreditCardAutoPay }o--|| StripePaymentMethod : payment_method CreditCardBonusRewardRate { string id PK string public_id int spending_minimum int bonus_reward int payoff_bonus_reward } CreditCardBonusRewardsQualifyingSpend { string id PK int account FK datetime month int total_qualifying_spend datetime rewards_applied_at } CreditCardBonusRewardsQualifyingSpend }o--|| Account : account CreditCardBonusRewardsQualifyingSpendAudit { string id PK string label string qualifying_spend_id string account_id string wallet_quote_id } CreditCardEvent { string id PK int credit_card FK } CreditCardFoldCHA { string id PK string public_id int version string pdf_template int apr_rate } CreditCardStatement { string statement_id PK int stripe_account FK string status datetime starts_at datetime ends_at } CreditCardStatement }o--|| StripeAccount : stripe_account CreditCardTransaction { string id PK string reference_id string authorization_id string transaction_id string dispute_id } CreditCardTransaction }o--|| StripeAccount : stripe_account CreditCardTransactionAudit { string id PK int original_transaction FK string label string authorization_id string transaction_id } CreditCardTransactionAudit }o--|| CreditCardTransaction : original_transaction CreditCardUnderwritingApplication { string id PK string application_id int stripe_account FK string status datetime submitted_at } CreditCardUnderwritingApplication }o--|| StripeAccount : stripe_account CreditCardUnderwritingApplication }o--|| CreditCardFoldCHA : fold_cha CreditCardUnderwritingApplicationAudit { string id PK int original_application FK string label string application_id string stripe_account_id } CreditCardUnderwritingApplicationAudit }o--|| CreditCardUnderwritingApplication : original_application CreditCardVerification { string id PK string credit_card FK datetime updated int amount string payment_string } CreditCardVerificationAttempt { string id PK int credit_card_verification FK int entered_amount datetime created bool successful } CreditCardVerificationAttempt }o--|| CreditCardVerification : credit_card_verification CreditCardWaitlist { string id PK string user_email int external_user_id bool received_deposit_award bool received_round_ups_enabled_award } CurrencyAmount { string id PK int amount string currency datetime created_at } Deposit { string id PK string api_id int amount string currency int address FK } DepositAddressCandidate { string id PK string address bool ready string extra_data datetime created_time } Dispute { string id PK int account FK int amount_to_refund string merchant_name string reason } Dispute }o--|| Account : account EmailEvent { string id PK string email int associated_account FK datetime time datetime intended_delivery_time } EmailEvent }o--|| Account : associated_account Endpath { string id PK int journey FK string name string template } Endpath }o--|| Journey : journey FeatureAccessCouponRedemption { string id PK int account FK int feature_access_coupon FK datetime created } FeatureAccessCouponRedemption }o--|| Account : account FeatureShowcase { string id PK string image string title string description string action } FoldIssuedCardWaitlistEntry { string id PK string account FK datetime entry_date int referral_count bool is_early_access } FoldIssuedCardWaitlistEntry ||--|| Account : account FortressTransferAudit { string id PK string prime_trust_account FK int pre_transfer_amount int post_transfer_amount datetime initiated_timestamp } Icon { string id PK string name } InstantWithdrawalPendingTransfer { string id PK int amount int account FK string transaction FK } InstantWithdrawalPendingTransfer }o--|| Account : account Journey { string id PK string title string description } KardEvent { string id PK string transaction_id string transaction_status string payload string offer_id } KardUser { string id PK string account FK bool offers_are_active } KardUser ||--|| Account : account LegacyReferralPayout { string id PK int referral_token FK int amount FK int payment FK int order FK } LegacyReferralPayout }o--|| LegacyReferralToken : referral_token LegacyReferralPayout }o--|| CurrencyAmount : amount LegacyReferralToken { string id PK int token bool enabled int original_order FK string payment_address } Listing { string id PK int card FK int balance bool physical datetime time } MandrillEmailEvent { string id PK string email int associated_profile FK datetime time datetime intended_delivery_time } MandrillEmailEvent }o--|| CardForCoinProfile : associated_profile MetaverseBlock { string id PK int status int height string hash datetime timestamp } MetaverseGameConfig { string id PK int reset_hour_utc int reset_time_max_skew_minutes int max_sats int max_spins } MetaverseGameConfigWeight { string id PK string name int weight int index } MetaverseGamePlay { string id PK int account FK int block FK string termination_event datetime created_timestamp } MetaverseGamePlay }o--|| Account : account MetaverseGamePlay }o--|| MetaverseBlock : block MetaverseGamePlayPrize { string id PK int game_play FK string name int count } MetaverseGamePlayPrize }o--|| MetaverseGamePlay : game_play MockStarbucksCard { string id PK string card_number string pin int balance bool activated } OpennodeEvent { string id PK string token string payload datetime created datetime processed } OrderCard { string id PK int order FK string user_input string external_id int status FK } OrderCard }o--|| OrderCardStatus : status OrderCardStatus { string id PK int order_card FK int status datetime time int account_manager FK } OrderCardStatus }o--|| OrderCard : order_card OrderCardStatus }o--|| CardForCoinProfile : account_manager OrderFile { string id PK int order FK string file } OrderNote { string id PK datetime time int author FK int order FK string note } OrderNote }o--|| CardForCoinProfile : author OrderStatus { string id PK int order FK int status datetime time int account_manager FK } OrderStatus }o--|| CardForCoinProfile : account_manager Payment { string id PK datetime created_at int amount_paid FK string recipient_address int usd_equivalent } Payment }o--|| CurrencyAmount : amount_paid PaymentOutput { string id PK int amount FK string recipient_address datetime time int payment FK } PaymentOutput }o--|| CurrencyAmount : amount PaymentOutput }o--|| Payment : payment PrefineryEvent { string token PK string payload string type string user_email datetime processed } ProfileBitcoinAddress { string id PK int profile FK datetime time string address } ProfileBitcoinAddress }o--|| CardForCoinProfile : profile ProfileEmail { string id PK int profile FK string address datetime time } ProfileEmail }o--|| CardForCoinProfile : profile ProfileNote { string id PK datetime time int author FK int profile FK string note } ProfileNote }o--|| CardForCoinProfile : author ProfileNote }o--|| CardForCoinProfile : profile ProfilePhoneNumber { string id PK int profile FK datetime time } ProfilePhoneNumber }o--|| CardForCoinProfile : profile ProxyNode { string id PK string address_ipv4 string provider string geo_location string geo_location_normalized } QualifiedSpendingForACHRewardRate { string id PK int account FK int spending_amount datetime spending_date } QualifiedSpendingForACHRewardRate }o--|| Account : account Question { string id PK string question_id int journey FK string template int index } Question }o--|| Journey : journey QuestionSet { string id PK int time_limit bool expired datetime created_at int score } QuestionSet }o--|| VerificationAttempt : verification RaiseDailyReport { string id PK datetime time string csv } RaiseDailyReportRow { string id PK int report FK string json int card FK } RaiseDailyReportRow }o--|| RaiseDailyReport : report RaiseDenial { string id PK int listing FK int first_report FK } RaiseDenial }o--|| Listing : listing RaiseDenial }o--|| RaiseDailyReportRow : first_report RaiseDenialReview { string id PK int denial FK bool card_destroyed int balance bool accurate } RaiseDenialReview }o--|| RaiseDenial : denial ReferralConversion { string id PK int token FK int order FK datetime time string referral_bonus FK } RewardWithdrawalRequest { string id PK int status string api_id int batch FK int account FK } RewardWithdrawalRequest }o--|| Account : account RewardWithdrawalRequestEvent { string id PK int reward_withdrawal_request FK int new_status } RewardWithdrawalRequestEvent }o--|| RewardWithdrawalRequest : reward_withdrawal_request RoundUp { string id PK int account FK bool is_enabled int multiplier int accumulated_round_up_amount } RoundUp }o--|| Account : account Sale { string id PK string card FK int buyer FK datetime created_at int balance_usd } Sale }o--|| Buyer : buyer SardineExternalAccountStatusAudit { string id PK int sardine_external_account FK string status string info } SardineSession { string id PK int account FK string device_id string session_key string current_flow } SardineSession }o--|| Account : account SeleniumNode { string id PK string address_ipv4 datetime time bool in_use } SeleniumSession { string id PK string selenium_session_id int selenium_node FK int proxy_node FK datetime time } SeleniumSession }o--|| SeleniumNode : selenium_node SeleniumSession }o--|| ProxyNode : proxy_node SeleniumSessionError { string id PK int selenium_session FK string brand string reason datetime time } SeleniumSessionError }o--|| SeleniumSession : selenium_session Slot { string id PK int account FK int amount bool archived string api_id } Slot }o--|| Account : account SpendForSpinRewardTrigger { string id PK int spend_threshold int num_of_spins_to_award } SpendSpinBoost { string id PK int multiplier string spend_source int percentage_to_convert_min } SpendingLimit { string id PK int spending_limit int amount_to_mask int account FK string token } SpendingLimit }o--|| Account : account StripeAccount { string stripe_account_id PK int account FK bool is_deleted string customer_id string gross_yearly_income_tokenized } StripeAccount }o--|| Account : account StripeEvent { string id PK string event_id string payload int stripe_account FK string type } StripeEvent }o--|| StripeAccount : stripe_account StripePaymentMethod { string id PK string payment_method_id string payment_intent_id int stripe_account FK int ach_account FK } StripePaymentMethod }o--|| StripeAccount : stripe_account Tier { string id PK int tier_id string name string config } Transfer { string id PK datetime created_at int status FK int account FK string sources FK } Transfer }o--|| TransferStatus : status Transfer }o--|| BrandAccount : account Transfer }o--|| SeleniumSession : selenium_session TransferLimit { string id PK int amount_per_transaction int amount_per_day int amount_per_month int account FK } TransferLimit }o--|| Account : account TransferSource { string id PK int transfer FK int card FK int amount_usd } TransferSource }o--|| Transfer : transfer TransferStatus { string id PK datetime time int transfer FK string status string failure_reason } TransferStatus }o--|| Transfer : transfer TransferTarget { string id PK int transfer FK int card FK int amount_usd } TransferTarget }o--|| Transfer : transfer TrendingPreference { string id PK string user string email bool keep_updated bool participating } UserInterest { string id PK int account FK string additional_data } UserInterest }o--|| Account : account VerificationAttempt { string id PK bool valid datetime created_at int profile FK } VerificationAttempt }o--|| CardForCoinProfile : profile WalletDeposit { string id PK string asset int amount string public_id string status } WalletDepositWrongCustodian { string id PK int account FK string wallet_deposit FK string receiving_custodian string correct_custodian } WalletDepositWrongCustodian }o--|| Account : account WalletDepositWrongCustodian ||--|| WalletDeposit : wallet_deposit WalletQuote { string id PK string external_id string trade_provider string transaction_type bool async_processing } WalletQuote }o--|| AutoStack : auto_stack WalletQuote }o--|| RoundUp : round_up WalletQuoteStatusAudit { string id PK int wallet_quote FK string status } WalletQuoteStatusAudit }o--|| WalletQuote : wallet_quote WalletTransaction { string id PK int account FK string type string automation_type string quote FK } WalletTransaction }o--|| Account : account WalletTransaction ||--|| WalletQuote : quote WalletTransaction ||--|| WalletWithdrawal : wallet_withdrawal WalletTransaction ||--|| WalletDeposit : wallet_deposit WalletTransaction ||--|| BitcoinGiftCardQuote : bitcoin_gift_card_redemption WalletWithdrawal { string id PK string asset int amount int amount_network_fees int amount_additional_fees } WhatsNewCard { string id PK string title_text string body_text string call_to_action_text string call_to_action_type } WithdrawOnlyAccountDisable { string id PK int account FK int auto_stack FK int direct_to_bitcoin FK int round_up FK } WithdrawOnlyAccountDisable }o--|| Account : account WithdrawOnlyAccountDisable }o--|| AutoStack : auto_stack WithdrawOnlyAccountDisable }o--|| RoundUp : round_up ZendeskTicket { int ticket_number PK string orders FK }

ACHWithdrawalPendingTransfer

Table: fold_ach_withdrawal_pending_transfer Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
amount DecimalField(7,2)
account FK → Account
transaction OneToOne → FoldCardTransaction

Relationships

.account N:1 Account
.transaction 1:1 FoldCardTransaction

Sample Queries (click to expand)

Get all records
ACHWithdrawalPendingTransfer.objects.all()
Get by ID
ACHWithdrawalPendingTransfer.objects.get(id=1)
With related Account
ACHWithdrawalPendingTransfer.objects.select_related("account")
Filter by account
ACHWithdrawalPendingTransfer.objects.filter(account_id=123)

AccountComment

Table: fold_account_comment Extends: AccountEvent
Field Type Constraints
id BigAutoField PK
author FK → User nullable
text TextField default=""

Relationships

.author N:1 User

Sample Queries (click to expand)

Get all records
AccountComment.objects.all()
Get by ID
AccountComment.objects.get(id=1)
With related User
AccountComment.objects.select_related("author")

AccountFoldCardRenewalIntervalEvent

Table: fold_account_card_renewal_interval_event Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
old_value CharField(250) nullable
new_value CharField(250) nullable
user_initiated BooleanField default=False
account FK → Account

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
AccountFoldCardRenewalIntervalEvent.objects.all()
Get by ID
AccountFoldCardRenewalIntervalEvent.objects.get(id=1)
With related Account
AccountFoldCardRenewalIntervalEvent.objects.select_related("account")
Filter by account
AccountFoldCardRenewalIntervalEvent.objects.filter(account_id=123)

AccountFoldCardTierEvent

Table: fold_card_tier_event Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
old_value CharField(250) nullable
new_value CharField(250) nullable
user_initiated BooleanField default=False
reason CharField(30) choices nullableShow 6 choices
ADMIN_INITIATED_TIER_CHANGEAdmin Initiated Tier Change
USER_DISABLED_AUTO_RENEWALUser Disabled Auto Renewal
INSUFFICIENT_FUNDSInsufficient Funds
USER_UPGRADEUser Upgrade
CARD_CREATIONCard Creation
TRIALTrial
account FK → Account

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
AccountFoldCardTierEvent.objects.all()
Get by ID
AccountFoldCardTierEvent.objects.get(id=1)
With related Account
AccountFoldCardTierEvent.objects.select_related("account")
Filter by account
AccountFoldCardTierEvent.objects.filter(account_id=123)

AccountOrderBonusEvent

Table: fold_account_order_bonus_event Extends: AccountEvent
Field Type Constraints
id BigAutoField PK
account_order_bonus FK → AccountOrderBonus

Relationships

.account_order_bonus N:1 AccountOrderBonus

Sample Queries (click to expand)

Get all records
AccountOrderBonusEvent.objects.all()
Get by ID
AccountOrderBonusEvent.objects.get(id=1)
With related AccountOrderBonus
AccountOrderBonusEvent.objects.select_related("account_order_bonus")

AccountToSpendForSpinRewardTrigger

Table: account_to_spend_for_spin_reward_trigger Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account OneToOne → Account
spend_for_spin_reward_trigger FK → SpendForSpinRewardTrigger
excess_spend DecimalField(7,2) default=0

Relationships

.account 1:1 Account
.spend_for_spin_reward_trigger N:1 SpendForSpinRewardTrigger

Sample Queries (click to expand)

Get all records
AccountToSpendForSpinRewardTrigger.objects.all()
Get by ID
AccountToSpendForSpinRewardTrigger.objects.get(id=1)
With related Account
AccountToSpendForSpinRewardTrigger.objects.select_related("account")
Filter by account
AccountToSpendForSpinRewardTrigger.objects.filter(account_id=123)

AccountUnseenFeature

Table: fold_account_unseen_feature
Field Type Constraints
id BigAutoField PK
account FK → Account
feature_name CharField(50)

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
AccountUnseenFeature.objects.all()
Get by ID
AccountUnseenFeature.objects.get(id=1)
With related Account
AccountUnseenFeature.objects.select_related("account")
Filter by account
AccountUnseenFeature.objects.filter(account_id=123)

AddressVerification

Table: fold_address_verification Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
fold_card FK → FoldCardCard nullable
status CharField(250) choicesAddressVerificationStatuses
address_1_tokenized CharField(250) nullable
address_2_tokenized CharField(250) nullable
city_tokenized CharField(250) nullable
state CharField(250) nullable
postal_code_tokenized CharField(250) nullable
country_tokenized CharField(250) nullable
type CharField(250) choicesAddressVerificationTypes
num_of_times_submitted PositiveIntegerField default=0
sardine_session_key CharField(255) nullable

Relationships

.account N:1 Account
.fold_card N:1 FoldCardCard

Sample Queries (click to expand)

Get all records
AddressVerification.objects.all()
Get by ID
AddressVerification.objects.get(id=1)
With related Account
AddressVerification.objects.select_related("account")
Filter by account
AddressVerification.objects.filter(account_id=123)

Adjustment

Table: cardforcoin_adjustment Extends: SubtypedModel
Field Type Constraints
id BigAutoField PK
group FK → AdjustmentGroup
time DateTimeField default=now()
notes TextField
brand CharField(30)
currency CharField(6)
amount DecimalField(30,8)

Relationships

.group N:1 AdjustmentGroup

Sample Queries (click to expand)

Get all records
Adjustment.objects.all()
Get by ID
Adjustment.objects.get(id=1)
With related AdjustmentGroup
Adjustment.objects.select_related("group")
Filter by time (last 7 days)
Adjustment.objects.filter(time__gte=datetime.now()-timedelta(days=7))

AdjustmentGroup

Table: cardforcoin_adjustment_group
Field Type Constraints
id BigAutoField PK
profile FK → CardForCoinProfile
notes TextField

Relationships

.profile N:1 CardForCoinProfile

Referenced By (1 tables)

Adjustment N:1 .group

Sample Queries (click to expand)

Get all records
AdjustmentGroup.objects.all()
Get by ID
AdjustmentGroup.objects.get(id=1)
With related CardForCoinProfile
AdjustmentGroup.objects.select_related("profile")

AdminAuditTrailEvent

Table: fold_admin_audit_trail_event
Field Type Constraints
id BigAutoField PK
time DateTimeField
http_verb CharField(50)
path CharField(1000)
user FK → User
status_code PositiveIntegerField
payload TextField

Relationships

.user N:1 User

Sample Queries (click to expand)

Get all records
AdminAuditTrailEvent.objects.all()
Get by ID
AdminAuditTrailEvent.objects.get(id=1)
With related User
AdminAuditTrailEvent.objects.select_related("user")
Filter by time (last 7 days)
AdminAuditTrailEvent.objects.filter(time__gte=datetime.now()-timedelta(days=7))

Answer

Table: fold_journey_answer Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
question FK → Question
account ForeignKey
text_tokenized TextField

Relationships

.question N:1 Question

Sample Queries (click to expand)

Get all records
Answer.objects.all()
Get by ID
Answer.objects.get(id=1)
With related Question
Answer.objects.select_related("question")

Schema History (click to expand)

#0472CreateModel2024-03-26
#0545RenameField2024-11-19

AppFeaturedItem

Table: fold_appfeatureditem
Field Type Constraints
id UUIDField PK default=uuid4
image ImageField
action TextField
additional_data JSONField default=dict()
is_enabled BooleanField default=True
index PositiveIntegerField

Sample Queries (click to expand)

Get all records
AppFeaturedItem.objects.all()
Get by ID
AppFeaturedItem.objects.get(id=1)

AppNotificationTarget

Table: fold_appnotificationtarget
Field Type Constraints
id BigAutoField PK
app_notification FK → AppNotification
device FK → Device
status CharField(20) choices default=QUEUED()Show 4 choices
QUEUEDQueued
TEMPORARILY_FAILEDTemporarily Failed
SUCCEEDEDSucceeded
FAILEDFailed
retry_count PositiveIntegerField default=0
error_details TextField nullable

Relationships

.app_notification N:1 AppNotification
.device N:1 Device

Sample Queries (click to expand)

Get all records
AppNotificationTarget.objects.all()
Get by ID
AppNotificationTarget.objects.get(id=1)
With related AppNotification
AppNotificationTarget.objects.select_related("app_notification")

AuthorizedUserAudit

Table: fold_authorized_user_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
authorized_user FK → AuthorizedUser
status CharField(255) nullable

Relationships

.authorized_user N:1 AuthorizedUser

Sample Queries (click to expand)

Get all records
AuthorizedUserAudit.objects.all()
Get by ID
AuthorizedUserAudit.objects.get(id=1)
With related AuthorizedUser
AuthorizedUserAudit.objects.select_related("authorized_user")

AuthorizedUserStatusStateMachine

Table: fold_authorizeduserstatusstatemachine
Field Type Constraints
id BigAutoField PK

Sample Queries (click to expand)

Get all records
AuthorizedUserStatusStateMachine.objects.all()
Get by ID
AuthorizedUserStatusStateMachine.objects.get(id=1)

AutoBuyConfig

Table: fold_autobuyconfig
Field Type Constraints
id BigAutoField PK
denomination DecimalField(30,8)
source CharField(20) choices default=TILLO()Show 4 choices
TILLOTillo
INCOMMIncomm
BLACKHAWKBlackhawk
PINE_LABSPineLabs
refill_at PositiveIntegerField
refill_to PositiveIntegerField
is_enabled BooleanField default=True

Referenced By (2 tables)

Order N:1 .auto_buy_config
AutoBuyError N:1 .auto_buy_config

Sample Queries (click to expand)

Get all records
AutoBuyConfig.objects.all()
Get by ID
AutoBuyConfig.objects.get(id=1)

AutoBuyError

Table: fold_autobuyerror
Field Type Constraints
id BigAutoField PK
auto_buy_config FK → AutoBuyConfig
order FK → Order
details TextField
time DateTimeField

Relationships

.auto_buy_config N:1 AutoBuyConfig
.order N:1 Order

Sample Queries (click to expand)

Get all records
AutoBuyError.objects.all()
Get by ID
AutoBuyError.objects.get(id=1)
With related AutoBuyConfig
AutoBuyError.objects.select_related("auto_buy_config")
Filter by time (last 7 days)
AutoBuyError.objects.filter(time__gte=datetime.now()-timedelta(days=7))

AutoStack

Table: fold_auto_stack Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
reference_id UUIDField indexed default=uuid4 nullable unique
frequency CharField(250) choices
next_execution_time DateTimeField
input_amount DecimalField(10,2) nullable
is_deleted BooleanField default=False
is_paused BooleanField default=False
account FK → Account

Relationships

.account N:1 Account

Referenced By (2 tables)

WalletQuote N:1 .auto_stack

Sample Queries (click to expand)

Get all records
AutoStack.objects.all()
Get by ID
AutoStack.objects.get(id=1)
With related Account
AutoStack.objects.select_related("account")
Filter by account
AutoStack.objects.filter(account_id=123)
Filter by next_execution_time (last 7 days)
AutoStack.objects.filter(next_execution_time__gte=datetime.now()-timedelta(days=7))

Ban

Table: fold_ban
Field Type Constraints
id BigAutoField PK
address_type CharField(30) choicesADDRESS_TYPES
address CharField(500)
notes TextField
time DateTimeField default=now()

Sample Queries (click to expand)

Get all records
Ban.objects.all()
Get by ID
Ban.objects.get(id=1)
Filter by time (last 7 days)
Ban.objects.filter(time__gte=datetime.now()-timedelta(days=7))

BaseModelMixin

Table: fold_basemodelmixin
Field Type Constraints
id BigAutoField PK
created_at DateTimeField nullable
modified_at DateTimeField nullable

Sample Queries (click to expand)

Get all records
BaseModelMixin.objects.all()
Get by ID
BaseModelMixin.objects.get(id=1)
Filter by created_at (last 7 days)
BaseModelMixin.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

BitcoinBuyLockOverride

Table: fold_bitcoin_buy_lock_override Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account OneToOne → Account
is_enabled BooleanField default=False

Relationships

.account 1:1 Account

Sample Queries (click to expand)

Get all records
BitcoinBuyLockOverride.objects.all()
Get by ID
BitcoinBuyLockOverride.objects.get(id=1)
With related Account
BitcoinBuyLockOverride.objects.select_related("account")
Filter by account
BitcoinBuyLockOverride.objects.filter(account_id=123)

BitcoinBuyLockOverrideAudit

Table: fold_bitcoin_buy_lock_override_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
modified_by FK → Account
action TextField choices
quote_overridden FK → WalletQuote nullable
account_overridden FK → Account nullable

Relationships

.modified_by N:1 Account
.quote_overridden N:1 WalletQuote
.account_overridden N:1 Account

Sample Queries (click to expand)

Get all records
BitcoinBuyLockOverrideAudit.objects.all()
Get by ID
BitcoinBuyLockOverrideAudit.objects.get(id=1)
With related Account
BitcoinBuyLockOverrideAudit.objects.select_related("modified_by")

BitcoinGiftCardChannel

Table: fold_btc_gift_card_channel Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
name TextField
spread_bips DecimalField(5,0) default=0
fee_bips DecimalField(5,0)

Sample Queries (click to expand)

Get all records
BitcoinGiftCardChannel.objects.all()
Get by ID
BitcoinGiftCardChannel.objects.get(id=1)

BitcoinGiftCardPromotion

Table: fold_bitcoin_gift_card_promotion Extends: BaseModelMixin
Field Type Constraints
id UUIDField PK default=uuid4
account FK → Account nullable
promotion_name TextField choices

Relationships

.account N:1 Account

Referenced By (1 tables)

BitcoinGiftCardQuote 1:1 .promotion

Sample Queries (click to expand)

Get all records
BitcoinGiftCardPromotion.objects.all()
Get by ID
BitcoinGiftCardPromotion.objects.get(id=1)
With related Account
BitcoinGiftCardPromotion.objects.select_related("account")
Filter by account
BitcoinGiftCardPromotion.objects.filter(account_id=123)

BitcoinGiftCardQuote

Table: fold_btc_gift_card_quote Extends: BaseModelMixin
Field Type Constraints
id UUIDField PK default=uuid4
account FK → Account nullable
gift_card_number TextField indexed
provider_transaction_id BigIntegerField nullable
provider_batch_number IntegerField nullable
provider_approval_code TextField nullable
channel_actual TextField nullable
channel_match TextField nullable
redemption_type TextField choices nullable
bitgo_external_id CharField(64) nullable
fortress_external_id UUIDField nullable
btc_txid TextField indexed nullable
rebuy_external_id UUIDField indexed nullable
card_amount_usd DecimalField(10,2)
trade_provider_input_amount DecimalField(10,2) nullable
fee_amount_bips DecimalField(5,0)
fee_amount_usd DecimalField(10,2)
spread_amount_bips DecimalField(5,0) default=0
spread_amount_usd DecimalField(10,2) default=0
network_fee_btc DecimalField(10,8) nullable
trade_output_amount_btc DecimalField(14,8)
btc_amount_sent_to_user DecimalField(14,8) nullable
exchange_rate_provider DecimalField(14,2) nullable
exchange_rate_with_spread DecimalField(14,2) nullable
expiration_time DateTimeField
bitgo_account FK → BitgoAccount nullable
fortress_account FK → FortressAccount nullable
promotion OneToOne → BitcoinGiftCardPromotion nullable
status CharField(255) choices default=value

Relationships

.account N:1 Account
.bitgo_account N:1 BitgoAccount
.fortress_account N:1 FortressAccount

Referenced By (1 tables)

WalletTransaction 1:1 .bitcoin_gift_card_redemption

Sample Queries (click to expand)

Get all records
BitcoinGiftCardQuote.objects.all()
Get by ID
BitcoinGiftCardQuote.objects.get(id=1)
With related Account
BitcoinGiftCardQuote.objects.select_related("account")
Filter by account
BitcoinGiftCardQuote.objects.filter(account_id=123)
Filter by expiration_time (last 7 days)
BitcoinGiftCardQuote.objects.filter(expiration_time__gte=datetime.now()-timedelta(days=7))

BitcoinSpread

Table: fold_crypto_transaction_spread Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
bips PositiveIntegerField
transaction_type TextField choicesBitcoinTransactionType
fold_card_tier SmallIntegerField choices default=valueTiers
provider TextField choices default=valueWalletQuoteTradeProvider

Sample Queries (click to expand)

Get all records
BitcoinSpread.objects.all()
Get by ID
BitcoinSpread.objects.get(id=1)

BitgoTransferAudit

Table: fold_bitgo_transfer_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
fortress_account OneToOne → FortressAccount
bitgo_account OneToOne → BitgoAccount nullable
source TextField choices default=value
pre_transfer_amount DecimalField(12,8)
post_transfer_amount DecimalField(12,8) nullable
fortress_transfer_id TextField nullable
bitgo_transfer_txid TextField nullable
status TextField choices default=value

Relationships

.fortress_account 1:1 FortressAccount
.bitgo_account 1:1 BitgoAccount

Sample Queries (click to expand)

Get all records
BitgoTransferAudit.objects.all()
Get by ID
BitgoTransferAudit.objects.get(id=1)
With related FortressAccount
BitgoTransferAudit.objects.select_related("fortress_account")

BrandAccount

Table: fold_brandaccount
Field Type Constraints
id BigAutoField PK
username CharField(256) unique
password CharField(256)

Referenced By (2 tables)

Card N:1 .registered_to
Transfer N:1 .account

Sample Queries (click to expand)

Get all records
BrandAccount.objects.all()
Get by ID
BrandAccount.objects.get(id=1)

BulkImport

Table: fold_bulkimport
Field Type Constraints
id BigAutoField PK
created_at DateTimeField nullable
csv_file FileField
format CharField(2) choicesShow 2 choices
CSCASHSTARCashStar
NPNUMBER_PINCard Number / Pin
origin CharField(100) nullable
secure BooleanField default=False
complete BooleanField default=False

Referenced By (1 tables)

Card N:1 .imported_batch

Sample Queries (click to expand)

Get all records
BulkImport.objects.all()
Get by ID
BulkImport.objects.get(id=1)
Filter by created_at (last 7 days)
BulkImport.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

Buyer

Table: fold_buyer
Field Type Constraints
id BigAutoField PK
name CharField(255)

Referenced By (1 tables)

Sale N:1 .buyer

Sample Queries (click to expand)

Get all records
Buyer.objects.all()
Get by ID
Buyer.objects.get(id=1)

Schema History (click to expand)

#0001CreateModel2022-05-24

CachedAccountCompletedChecklistItem

Table: fold_cached_account_checklist_item Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
name CharField(500) choices indexedChecklistItemEnum

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
CachedAccountCompletedChecklistItem.objects.all()
Get by ID
CachedAccountCompletedChecklistItem.objects.get(id=1)
With related Account
CachedAccountCompletedChecklistItem.objects.select_related("account")
Filter by account
CachedAccountCompletedChecklistItem.objects.filter(account_id=123)

CardBalance

Table: fold_cardbalance
Field Type Constraints
id BigAutoField PK
card FK → Card
amount DecimalField(7,2) default=Decimal()
times_seen IntegerField default=1
first_seen DateTimeField default=now()
last_seen DateTimeField default=now()

Relationships

.card N:1 Card

Referenced By (1 tables)

Card N:1 .balance

Sample Queries (click to expand)

Get all records
CardBalance.objects.all()
Get by ID
CardBalance.objects.get(id=1)
With related Card
CardBalance.objects.select_related("card")
Filter by first_seen (last 7 days)
CardBalance.objects.filter(first_seen__gte=datetime.now()-timedelta(days=7))

CardForCoinProfile

Table: fold_cardforcoinprofile
Field Type Constraints
id BigAutoField PK
user OneToOneField nullable
nickname CharField(100) nullable unique
legacy_referral_tokens M2M → LegacyReferralToken
reputation_adjustment DecimalField(4,2) default=Decimal() nullable
daily_sales_limit DecimalField(7,2) default=Decimal()
daily_limit_per_brand JSONField default=dict()
minimum_age_per_brand JSONField default=dict()
features_seen JSONField default=dict()
suspended BooleanField default=False
bitcoin_address FK → ProfileBitcoinAddress nullable
email FK → ProfileEmail nullable
phone_number FK → ProfilePhoneNumber nullable
bulk BooleanField default=False
account_manager BooleanField default=False

Relationships

.legacy_referral_tokens N:M LegacyReferralToken
.bitcoin_address N:1 ProfileBitcoinAddress
.email N:1 ProfileEmail
.phone_number N:1 ProfilePhoneNumber

Referenced By (17 tables)

CurrentBalance N:1 .profile
Order N:1 .profile
Order N:1 .account_manager
Withdrawal N:1 .profile
ReferralToken N:1 .profile
ReferralSignup 1:1 .referred
VerificationAttempt N:1 .profile
AdjustmentGroup N:1 .profile
OrderStatus N:1 .account_manager
OrderCardStatus N:1 .account_manager
...and 7 more

Sample Queries (click to expand)

Get all records
CardForCoinProfile.objects.all()
Get by ID
CardForCoinProfile.objects.get(id=1)
With related LegacyReferralToken
CardForCoinProfile.objects.select_related("legacy_referral_tokens")

CardHistory

Table: fold_cardhistory
Field Type Constraints
id BigAutoField PK
card FK → Card
created_at DateTimeField

Relationships

.card N:1 Card

Referenced By (1 tables)

CardEvent N:1 .history

Sample Queries (click to expand)

Get all records
CardHistory.objects.all()
Get by ID
CardHistory.objects.get(id=1)
With related Card
CardHistory.objects.select_related("card")
Filter by created_at (last 7 days)
CardHistory.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

CardReservation

Table: fold_cardreservation
Field Type Constraints
id BigAutoField PK
created_at DateTimeField nullable
card FK → Card nullable
reason TextField nullable
notes TextField

Relationships

.card N:1 Card

Referenced By (1 tables)

Card N:1 .reservation

Sample Queries (click to expand)

Get all records
CardReservation.objects.all()
Get by ID
CardReservation.objects.get(id=1)
With related Card
CardReservation.objects.select_related("card")
Filter by created_at (last 7 days)
CardReservation.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

CardTerm

Table: fold_cardterm
Field Type Constraints
id BigAutoField PK
order FK → Order nullable
rate DecimalField(11,8) nullable
amount_offered_usd DecimalField(12,2) nullable
brand CharField(30) nullable
card_number CharField(125) nullable
card_amount DecimalField(12,2) nullable
url_redemption_link TextField nullable
time DateTimeField
bulk BooleanField default=False
rejected BooleanField default=False
uuid CharField(40) unique

Relationships

.order N:1 Order

Sample Queries (click to expand)

Get all records
CardTerm.objects.all()
Get by ID
CardTerm.objects.get(id=1)
With related Order
CardTerm.objects.select_related("order")
Filter by time (last 7 days)
CardTerm.objects.filter(time__gte=datetime.now()-timedelta(days=7))

ChainBucket

Table: fold_chain_bucket
Field Type Constraints
id BigAutoField PK
account FK → Account
bucket_id CharField(50)
wallet_id CharField(50)
time DateTimeField default=now()
balance FK → ChainBucketBalance nullable

Relationships

.account N:1 Account
.balance N:1 ChainBucketBalance

Referenced By (1 tables)

ChainBucketBalance N:1 .bucket

Sample Queries (click to expand)

Get all records
ChainBucket.objects.all()
Get by ID
ChainBucket.objects.get(id=1)
With related Account
ChainBucket.objects.select_related("account")
Filter by account
ChainBucket.objects.filter(account_id=123)
Filter by time (last 7 days)
ChainBucket.objects.filter(time__gte=datetime.now()-timedelta(days=7))

ChainBucketBalance

Table: fold_chain_bucket_balance
Field Type Constraints
id BigAutoField PK
bucket FK → ChainBucket
total_balance DecimalField(16,8)
confirmed_balance DecimalField(16,8)
times_seen IntegerField
first_seen DateTimeField
last_seen DateTimeField

Relationships

.bucket N:1 ChainBucket

Referenced By (1 tables)

ChainBucket N:1 .balance

Sample Queries (click to expand)

Get all records
ChainBucketBalance.objects.all()
Get by ID
ChainBucketBalance.objects.get(id=1)
With related ChainBucket
ChainBucketBalance.objects.select_related("bucket")
Filter by first_seen (last 7 days)
ChainBucketBalance.objects.filter(first_seen__gte=datetime.now()-timedelta(days=7))

CreditCardAutoPay

Table: credit_card_auto_pay Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
public_id UUIDField default=uuid4 unique indexed
stripe_account FK → StripeAccount
payment_method FK → StripePaymentMethod
payment_type CharField(50) choicesCreditCardPaymentOptionType
amount DecimalField(10,2) nullable
repayment_id CharField(255) nullable
next_repayment_date DateField nullable
is_deleted BooleanField default=False

Relationships

.stripe_account N:1 StripeAccount
.payment_method N:1 StripePaymentMethod

Sample Queries (click to expand)

Get all records
CreditCardAutoPay.objects.all()
Get by ID
CreditCardAutoPay.objects.get(id=1)
With related StripeAccount
CreditCardAutoPay.objects.select_related("stripe_account")
Filter by next_repayment_date (last 7 days)
CreditCardAutoPay.objects.filter(next_repayment_date__gte=datetime.now()-timedelta(days=7))

CreditCardBonusRewardRate

Table: fold_credit_card_bonus_reward_rate Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
public_id UUIDField default=uuid4 unique indexed
spending_minimum DecimalField(10,2) nullable
bonus_reward DecimalField(10,2)
payoff_bonus_reward DecimalField(10,2)
cap DecimalField(10,2) nullable
is_enabled BooleanField default=False

Sample Queries (click to expand)

Get all records
CreditCardBonusRewardRate.objects.all()
Get by ID
CreditCardBonusRewardRate.objects.get(id=1)

CreditCardBonusRewardsQualifyingSpend

Table: credit_card_bonus_rewards_qualifying_spend Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
month DateField
total_qualifying_spend DecimalField(10,2) default=0
rewards_applied_at DateTimeField nullable

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
CreditCardBonusRewardsQualifyingSpend.objects.all()
Get by ID
CreditCardBonusRewardsQualifyingSpend.objects.get(id=1)
With related Account
CreditCardBonusRewardsQualifyingSpend.objects.select_related("account")
Filter by account
CreditCardBonusRewardsQualifyingSpend.objects.filter(account_id=123)
Filter by month (last 7 days)
CreditCardBonusRewardsQualifyingSpend.objects.filter(month__gte=datetime.now()-timedelta(days=7))

CreditCardBonusRewardsQualifyingSpendAudit

Table: credit_card_bonus_rewards_qualifying_spend_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
label CharField(255) nullable
qualifying_spend_id CharField(255)
account_id CharField(255)
wallet_quote_id CharField(255) nullable
total_qualifying_spend DecimalField(10,2)
amount DecimalField(10,2)
spend_type CharField(50) choicesShow 2 choices
auto_stackAuto Stack (DCA)
direct_to_bitcoinDirect to Bitcoin
month DateField

Sample Queries (click to expand)

Get all records
CreditCardBonusRewardsQualifyingSpendAudit.objects.all()
Get by ID
CreditCardBonusRewardsQualifyingSpendAudit.objects.get(id=1)
Filter by month (last 7 days)
CreditCardBonusRewardsQualifyingSpendAudit.objects.filter(month__gte=datetime.now()-timedelta(days=7))

CreditCardEvent

Table: fold_credit_card_event Extends: AccountEvent
Field Type Constraints
id BigAutoField PK
credit_card FK → CreditCard

Relationships

.credit_card N:1 CreditCard

Sample Queries (click to expand)

Get all records
CreditCardEvent.objects.all()
Get by ID
CreditCardEvent.objects.get(id=1)
With related CreditCard
CreditCardEvent.objects.select_related("credit_card")

CreditCardFoldCHA

Table: credit_card_fold_cha Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
public_id UUIDField default=uuid4 unique
version DecimalField(6,4)
pdf_template FileField
apr_rate DecimalField(5,2)

Referenced By (1 tables)

Sample Queries (click to expand)

Get all records
CreditCardFoldCHA.objects.all()
Get by ID
CreditCardFoldCHA.objects.get(id=1)

CreditCardStatement

Table: credit_card_statement Extends: BaseModelMixin
Field Type Constraints
statement_id CharField(255) PK
stripe_account FK → StripeAccount
status CharField(255) choicesCreditCardStatementStatus
starts_at DateTimeField nullable
ends_at DateTimeField nullable
pdf_url URLField nullable

Relationships

.stripe_account N:1 StripeAccount

Sample Queries (click to expand)

Get all records
CreditCardStatement.objects.all()
Get by ID
CreditCardStatement.objects.get(id=1)
With related StripeAccount
CreditCardStatement.objects.select_related("stripe_account")
Filter by starts_at (last 7 days)
CreditCardStatement.objects.filter(starts_at__gte=datetime.now()-timedelta(days=7))

CreditCardTransaction

Table: credit_card_transaction Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
reference_id UUIDField default=uuid4 unique
authorization_id CharField(255) nullable
transaction_id CharField(255) nullable
dispute_id CharField(255) nullable
repayment_id CharField(255) nullable
disputed_by UUIDField nullable indexed
stripe_account FK → StripeAccount
amount DecimalField(10,2)
status CharField choicesCreditCardTransactionStatus
type CharField choicesCreditCardTransactionType
base_reward_rate DecimalField(10,5) nullable
base_reward_balance_change OneToOne → BalanceChange nullable
rewards_exchange_rate DecimalField(80,40) nullable
settled_at DateTimeField nullable
transacted_at DateTimeField
details JSONField nullable default=dict()
tier PositiveIntegerField nullable
merchant_name TextField nullable
is_hidden BooleanField default=False
order FK → Order nullable

Relationships

.stripe_account N:1 StripeAccount
.base_reward_balance_change 1:1 BalanceChange
.order N:1 Order

Referenced By (1 tables)

CreditCardTransactionAudit N:1 .original_transaction

Sample Queries (click to expand)

Get all records
CreditCardTransaction.objects.all()
Get by ID
CreditCardTransaction.objects.get(id=1)
With related StripeAccount
CreditCardTransaction.objects.select_related("stripe_account")
Filter by settled_at (last 7 days)
CreditCardTransaction.objects.filter(settled_at__gte=datetime.now()-timedelta(days=7))

CreditCardTransactionAudit

Table: credit_card_transaction_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
original_transaction FK → CreditCardTransaction
label CharField(255) nullable
authorization_id CharField(255) nullable
transaction_id CharField(255) nullable
dispute_id CharField(255) nullable
disputed_by UUIDField nullable
stripe_account_id CharField(255) nullable
amount DecimalField(10,2)
status CharField(50)
type CharField(50)
base_reward_rate DecimalField(10,5) nullable
base_reward_balance_change_id IntegerField nullable
rewards_exchange_rate DecimalField(80,40) nullable
settled_at DateTimeField nullable
transacted_at DateTimeField nullable
details JSONField nullable default=dict()
tier PositiveIntegerField nullable
merchant_name TextField nullable
is_hidden BooleanField default=False
order_id IntegerField nullable

Relationships

.original_transaction N:1 CreditCardTransaction

Sample Queries (click to expand)

Get all records
CreditCardTransactionAudit.objects.all()
Get by ID
CreditCardTransactionAudit.objects.get(id=1)
With related CreditCardTransaction
CreditCardTransactionAudit.objects.select_related("original_transaction")
Filter by settled_at (last 7 days)
CreditCardTransactionAudit.objects.filter(settled_at__gte=datetime.now()-timedelta(days=7))

CreditCardUnderwritingApplication

Table: credit_card_underwriting_application Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
application_id CharField(255) nullable indexed
stripe_account FK → StripeAccount
status CharField(255) choices default=value indexedCreditCardUnderwritingApplicationStatus
submitted_at DateTimeField nullable
submission_attempt_count IntegerField default=0
decision_type CharField(255) choices nullable indexedCreditCardUnderwritingDecisionType
decision_deadline DateTimeField nullable
purchase_apr DecimalField(5,2) nullable
credit_limit DecimalField(10,2) nullable
fold_cha FK → CreditCardFoldCHA nullable

Relationships

.stripe_account N:1 StripeAccount
.fold_cha N:1 CreditCardFoldCHA

Referenced By (1 tables)

CreditCardUnderwritingApplicationAudit N:1 .original_application

Sample Queries (click to expand)

Get all records
CreditCardUnderwritingApplication.objects.all()
Get by ID
CreditCardUnderwritingApplication.objects.get(id=1)
With related StripeAccount
CreditCardUnderwritingApplication.objects.select_related("stripe_account")
Filter by submitted_at (last 7 days)
CreditCardUnderwritingApplication.objects.filter(submitted_at__gte=datetime.now()-timedelta(days=7))

CreditCardUnderwritingApplicationAudit

Table: credit_card_underwriting_application_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
original_application FK → CreditCardUnderwritingApplication
label CharField(255) nullable
application_id CharField(255) nullable
stripe_account_id CharField(255)
status CharField(255)
submitted_at DateTimeField nullable
submission_attempt_count IntegerField default=0
decision_type CharField(255) nullable
decision_deadline DateTimeField nullable
purchase_apr DecimalField(5,2) nullable
credit_limit DecimalField(10,2) nullable
gross_yearly_income_tokenized CharField(255) nullable
housing_status CharField(255) nullable
monthly_housing_expense_tokenized CharField(255) nullable

Relationships

.original_application N:1 CreditCardUnderwritingApplication

Sample Queries (click to expand)

Get all records
CreditCardUnderwritingApplicationAudit.objects.all()
Get by ID
CreditCardUnderwritingApplicationAudit.objects.get(id=1)
With related CreditCardUnderwritingApplication
CreditCardUnderwritingApplicationAudit.objects.select_related("original_application")
Filter by submitted_at (last 7 days)
CreditCardUnderwritingApplicationAudit.objects.filter(submitted_at__gte=datetime.now()-timedelta(days=7))

CreditCardVerification

Table: fold_credit_card_verification
Field Type Constraints
id BigAutoField PK
credit_card OneToOne → CreditCard
updated DateTimeField
amount IntegerField
payment_string TextField nullable

Relationships

.credit_card 1:1 CreditCard

Referenced By (1 tables)

CreditCardVerificationAttempt N:1 .credit_card_verification

Sample Queries (click to expand)

Get all records
CreditCardVerification.objects.all()
Get by ID
CreditCardVerification.objects.get(id=1)
With related CreditCard
CreditCardVerification.objects.select_related("credit_card")
Filter by updated (last 7 days)
CreditCardVerification.objects.filter(updated__gte=datetime.now()-timedelta(days=7))

CreditCardVerificationAttempt

Table: fold_credit_card_verification_attempt
Field Type Constraints
id BigAutoField PK
credit_card_verification FK → CreditCardVerification
entered_amount PositiveIntegerField
created DateTimeField default=now
successful BooleanField

Relationships

.credit_card_verification N:1 CreditCardVerification

Sample Queries (click to expand)

Get all records
CreditCardVerificationAttempt.objects.all()
Get by ID
CreditCardVerificationAttempt.objects.get(id=1)
With related CreditCardVerification
CreditCardVerificationAttempt.objects.select_related("credit_card_verification")
Filter by created (last 7 days)
CreditCardVerificationAttempt.objects.filter(created__gte=datetime.now()-timedelta(days=7))

CreditCardWaitlist

Table: fold_credit_card_waitlist Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
user_email TextField unique
external_user_id IntegerField nullable
received_deposit_award BooleanField default=False
received_round_ups_enabled_award BooleanField default=False
received_direct_to_bitcoin_enabled_award BooleanField default=False
received_auto_stack_enabled_award BooleanField default=False
received_fold_cardholder_award BooleanField default=False
received_fold_plus_cardholder_award BooleanField default=False
is_deleted BooleanField default=False
iterable_user_id UUIDField default=uuid4

Sample Queries (click to expand)

Get all records
CreditCardWaitlist.objects.all()
Get by ID
CreditCardWaitlist.objects.get(id=1)

CurrencyAmount

Table: fold_currencyamount
Field Type Constraints
id BigAutoField PK
amount DecimalField(30,8) default=Decimal()
currency CharField(6) default="BTC"
created_at DateTimeField nullable

Referenced By (5 tables)

Order N:1 .amount_owed
Withdrawal N:1 .amount_requested
Payment N:1 .amount_paid
PaymentOutput N:1 .amount

Sample Queries (click to expand)

Get all records
CurrencyAmount.objects.all()
Get by ID
CurrencyAmount.objects.get(id=1)
Filter by created_at (last 7 days)
CurrencyAmount.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

Deposit

Table: fold_deposit Extends: AccountEvent
Field Type Constraints
id BigAutoField PK
api_id CharField(40)
amount DecimalField(30,8)
currency CharField(6)
address FK → DepositAddress
tx_hash CharField(256) nullable
tx_hash_unique BooleanField default=True nullable

Relationships

.address N:1 DepositAddress

Sample Queries (click to expand)

Get all records
Deposit.objects.all()
Get by ID
Deposit.objects.get(id=1)
With related DepositAddress
Deposit.objects.select_related("address")

Schema History (click to expand)

#0001CreateModel2022-09-25
#0305AlterField: tx_hash_unique2023-01-31
#0636AlterField: amount2025-09-25

DepositAddressCandidate

Table: fold_deposit_address_candidate
Field Type Constraints
id BigAutoField PK
address CharField(256)
ready BooleanField default=False
extra_data JSONField default=dict()
created_time DateTimeField

Sample Queries (click to expand)

Get all records
DepositAddressCandidate.objects.all()
Get by ID
DepositAddressCandidate.objects.get(id=1)
Filter by created_time (last 7 days)
DepositAddressCandidate.objects.filter(created_time__gte=datetime.now()-timedelta(days=7))

Dispute

Table: fold_dispute Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
amount_to_refund DecimalField(7,2)
merchant_name CharField(256)
reason CharField(256)
gpa_order_id UUIDField

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
Dispute.objects.all()
Get by ID
Dispute.objects.get(id=1)
With related Account
Dispute.objects.select_related("account")
Filter by account
Dispute.objects.filter(account_id=123)

Schema History (click to expand)

#0514CreateModel2024-07-22

EmailEvent

Table: fold_emailevent Extends: SubtypedModel
Field Type Constraints
id BigAutoField PK
email EmailField
associated_account FK → Account nullable
time DateTimeField default=now()
intended_delivery_time DateTimeField default=now()
reason CharField(30) choicesREASONS
converted BooleanField nullable

Relationships

.associated_account N:1 Account

Sample Queries (click to expand)

Get all records
EmailEvent.objects.all()
Get by ID
EmailEvent.objects.get(id=1)
With related Account
EmailEvent.objects.select_related("associated_account")
Filter by time (last 7 days)
EmailEvent.objects.filter(time__gte=datetime.now()-timedelta(days=7))

Endpath

Table: fold_journey_endpath Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
journey FK → Journey
name CharField(100) nullable
template JSONField default=dict()

Relationships

.journey N:1 Journey

Sample Queries (click to expand)

Get all records
Endpath.objects.all()
Get by ID
Endpath.objects.get(id=1)
With related Journey
Endpath.objects.select_related("journey")

Schema History (click to expand)

#0472CreateModel2024-03-26
#0609AlterField: template2025-07-18

FeatureAccessCouponRedemption

Table: fold_feature_access_coupon_redemption
Field Type Constraints
id BigAutoField PK
account FK → Account
feature_access_coupon FK → FeatureAccessCoupon
created DateTimeField

Relationships

.account N:1 Account
.feature_access_coupon N:1 FeatureAccessCoupon

Sample Queries (click to expand)

Get all records
FeatureAccessCouponRedemption.objects.all()
Get by ID
FeatureAccessCouponRedemption.objects.get(id=1)
With related Account
FeatureAccessCouponRedemption.objects.select_related("account")
Filter by account
FeatureAccessCouponRedemption.objects.filter(account_id=123)
Filter by created (last 7 days)
FeatureAccessCouponRedemption.objects.filter(created__gte=datetime.now()-timedelta(days=7))

FeatureShowcase

Table: fold_feature_showcase
Field Type Constraints
id UUIDField PK default=uuid4
image ImageField
title TextField
description TextField default=""
action TextField
additional_data JSONField default=dict()
is_enabled BooleanField default=True
is_new BooleanField default=False
border_color CharField(6)
index PositiveIntegerField

Sample Queries (click to expand)

Get all records
FeatureShowcase.objects.all()
Get by ID
FeatureShowcase.objects.get(id=1)

FoldIssuedCardWaitlistEntry

Table: fold_foldissuedcardwaitlistentry
Field Type Constraints
id BigAutoField PK
account OneToOne → Account unique
entry_date DateTimeField default=now()
referral_count PositiveIntegerField default=0
is_early_access BooleanField default=False
snapshot_position PositiveIntegerField nullable
snapshot_spend DecimalField(10,2) nullable
snapshot_lifetime_rewards DecimalField(30,10) nullable

Relationships

.account 1:1 Account

Referenced By (1 tables)

ReferralFICWaitlistConversion 1:1 .fold_issued_card_waitlist_signup

Sample Queries (click to expand)

Get all records
FoldIssuedCardWaitlistEntry.objects.all()
Get by ID
FoldIssuedCardWaitlistEntry.objects.get(id=1)
With related Account
FoldIssuedCardWaitlistEntry.objects.select_related("account")
Filter by account
FoldIssuedCardWaitlistEntry.objects.filter(account_id=123)
Filter by entry_date (last 7 days)
FoldIssuedCardWaitlistEntry.objects.filter(entry_date__gte=datetime.now()-timedelta(days=7))

FortressTransferAudit

Table: fold_fortress_transfer_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
prime_trust_account OneToOne → PrimeTrustAccount nullable
pre_transfer_amount DecimalField(10,8)
post_transfer_amount DecimalField(10,8) nullable
initiated_timestamp DateTimeField nullable
address TextField nullable
txid TextField nullable
status TextField choices default=value

Relationships

.prime_trust_account 1:1 PrimeTrustAccount

Sample Queries (click to expand)

Get all records
FortressTransferAudit.objects.all()
Get by ID
FortressTransferAudit.objects.get(id=1)
With related PrimeTrustAccount
FortressTransferAudit.objects.select_related("prime_trust_account")
Filter by initiated_timestamp (last 7 days)
FortressTransferAudit.objects.filter(initiated_timestamp__gte=datetime.now()-timedelta(days=7))

Icon

Table: fold_icon Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
name CharField(100) unique

Referenced By (1 tables)

CategoryBoost N:1 .icon_name

Sample Queries (click to expand)

Get all records
Icon.objects.all()
Get by ID
Icon.objects.get(id=1)

Schema History (click to expand)

#0651CreateModel2025-11-13

InstantWithdrawalPendingTransfer

Table: fold_instant_withdrawal_pending_transfer Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
amount DecimalField(7,2) nullable
account FK → Account nullable
transaction OneToOne → FoldCardTransaction nullable

Relationships

.account N:1 Account
.transaction 1:1 FoldCardTransaction

Sample Queries (click to expand)

Get all records
InstantWithdrawalPendingTransfer.objects.all()
Get by ID
InstantWithdrawalPendingTransfer.objects.get(id=1)
With related Account
InstantWithdrawalPendingTransfer.objects.select_related("account")
Filter by account
InstantWithdrawalPendingTransfer.objects.filter(account_id=123)

Journey

Table: fold_journey Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
title CharField(250) unique
description TextField

Referenced By (2 tables)

Question N:1 .journey
Endpath N:1 .journey

Sample Queries (click to expand)

Get all records
Journey.objects.all()
Get by ID
Journey.objects.get(id=1)

Schema History (click to expand)

#0472CreateModel2024-03-26

KardEvent

Table: fold_kard_event Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
transaction_id CharField(250)
transaction_status CharField(250) choicesKardTransactionStatus
payload JSONField default=dict()
offer_id CharField(250)
processed_at DateTimeField nullable
type CharField(100) choicesKardEventType
referring_partner_user_id CharField(250)

Sample Queries (click to expand)

Get all records
KardEvent.objects.all()
Get by ID
KardEvent.objects.get(id=1)
Filter by processed_at (last 7 days)
KardEvent.objects.filter(processed_at__gte=datetime.now()-timedelta(days=7))

KardUser

Table: fold_kard_user Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account OneToOne → Account
offers_are_active BooleanField default=False

Relationships

.account 1:1 Account

Sample Queries (click to expand)

Get all records
KardUser.objects.all()
Get by ID
KardUser.objects.get(id=1)
With related Account
KardUser.objects.select_related("account")
Filter by account
KardUser.objects.filter(account_id=123)

LegacyReferralPayout

Table: fold_legacyreferralpayout
Field Type Constraints
id BigAutoField PK
referral_token FK → LegacyReferralToken
amount FK → CurrencyAmount nullable
payment FK → CoinbasePayment nullable
order FK → Order nullable
created_at DateTimeField nullable

Relationships

.referral_token N:1 LegacyReferralToken
.amount N:1 CurrencyAmount
.payment N:1 CoinbasePayment
.order N:1 Order

Sample Queries (click to expand)

Get all records
LegacyReferralPayout.objects.all()
Get by ID
LegacyReferralPayout.objects.get(id=1)
With related LegacyReferralToken
LegacyReferralPayout.objects.select_related("referral_token")
Filter by created_at (last 7 days)
LegacyReferralPayout.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

LegacyReferralToken

Table: fold_legacyreferraltoken
Field Type Constraints
id BigAutoField PK
token BigIntegerField unique
enabled BooleanField default=True
original_order FK → Order nullable
payment_address CharField(256) nullable
created_at DateTimeField nullable

Relationships

.original_order N:1 Order

Referenced By (2 tables)

CardForCoinProfile N:M .legacy_referral_tokens
LegacyReferralPayout N:1 .referral_token

Sample Queries (click to expand)

Get all records
LegacyReferralToken.objects.all()
Get by ID
LegacyReferralToken.objects.get(id=1)
With related Order
LegacyReferralToken.objects.select_related("original_order")
Filter by created_at (last 7 days)
LegacyReferralToken.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

Listing

Table: cardforcoin_listing Extends: SubtypedModel
Field Type Constraints
id BigAutoField PK
card FK → Card
balance DecimalField(30,8) nullable
physical BooleanField default=False
time DateTimeField default=now() nullable
notes TextField

Relationships

.card N:1 Card

Referenced By (1 tables)

RaiseDenial N:1 .listing

Sample Queries (click to expand)

Get all records
Listing.objects.all()
Get by ID
Listing.objects.get(id=1)
With related Card
Listing.objects.select_related("card")
Filter by time (last 7 days)
Listing.objects.filter(time__gte=datetime.now()-timedelta(days=7))

MandrillEmailEvent

Table: fold_mandrillemailevent
Field Type Constraints
id BigAutoField PK
email EmailField
associated_profile FK → CardForCoinProfile
time DateTimeField default=now()
intended_delivery_time DateTimeField default=now()
reason CharField(30) choicesREASONS
converted BooleanField nullable
mandrill_id CharField(32)
template_slug CharField(254) nullable
rejected BooleanField nullable
rejected_reason CharField(254) nullable

Relationships

.associated_profile N:1 CardForCoinProfile

Sample Queries (click to expand)

Get all records
MandrillEmailEvent.objects.all()
Get by ID
MandrillEmailEvent.objects.get(id=1)
With related CardForCoinProfile
MandrillEmailEvent.objects.select_related("associated_profile")
Filter by time (last 7 days)
MandrillEmailEvent.objects.filter(time__gte=datetime.now()-timedelta(days=7))

MetaverseBlock

Table: metaverse_block
Field Type Constraints
id BigAutoField PK
status SmallIntegerField choicesShow 2 choices
0MEMPOOLMEMPOOL
1COMMITTEDCOMMITTED
height PositiveIntegerField
hash TextField nullable
timestamp DateTimeField nullable
total_sats PositiveIntegerField default=0
total_spins PositiveIntegerField default=0
total_players PositiveIntegerField default=0

Referenced By (1 tables)

Sample Queries (click to expand)

Get all records
MetaverseBlock.objects.all()
Get by ID
MetaverseBlock.objects.get(id=1)
Filter by timestamp (last 7 days)
MetaverseBlock.objects.filter(timestamp__gte=datetime.now()-timedelta(days=7))

MetaverseGameConfig

Table: metaverse_game_config
Field Type Constraints
id BigAutoField PK
reset_hour_utc PositiveIntegerField
reset_time_max_skew_minutes PositiveIntegerField
max_sats PositiveIntegerField
max_spins PositiveIntegerField
block_time_seconds PositiveIntegerField

Sample Queries (click to expand)

Get all records
MetaverseGameConfig.objects.all()
Get by ID
MetaverseGameConfig.objects.get(id=1)

MetaverseGameConfigWeight

Table: metaverse_game_config_weight
Field Type Constraints
id BigAutoField PK
name TextField
weight PositiveIntegerField
index PositiveIntegerField indexed

Sample Queries (click to expand)

Get all records
MetaverseGameConfigWeight.objects.all()
Get by ID
MetaverseGameConfigWeight.objects.get(id=1)

MetaverseGamePlay

Table: metaverse_game_play
Field Type Constraints
id BigAutoField PK
account FK → Account
block FK → MetaverseBlock nullable
termination_event TextField nullable
created_timestamp DateTimeField indexed
sats_earned PositiveIntegerField nullable
spins_earned PositiveIntegerField nullable
balance_change OneToOne → BalanceChange nullable
weights JSONField default=list()

Relationships

.account N:1 Account
.block N:1 MetaverseBlock
.balance_change 1:1 BalanceChange

Referenced By (1 tables)

MetaverseGamePlayPrize N:1 .game_play

Sample Queries (click to expand)

Get all records
MetaverseGamePlay.objects.all()
Get by ID
MetaverseGamePlay.objects.get(id=1)
With related Account
MetaverseGamePlay.objects.select_related("account")
Filter by account
MetaverseGamePlay.objects.filter(account_id=123)
Filter by created_timestamp (last 7 days)
MetaverseGamePlay.objects.filter(created_timestamp__gte=datetime.now()-timedelta(days=7))

MetaverseGamePlayPrize

Table: fold_metaversegameplayprize
Field Type Constraints
id BigAutoField PK
game_play FK → MetaverseGamePlay
name TextField
count PositiveIntegerField

Relationships

.game_play N:1 MetaverseGamePlay

Sample Queries (click to expand)

Get all records
MetaverseGamePlayPrize.objects.all()
Get by ID
MetaverseGamePlayPrize.objects.get(id=1)
With related MetaverseGamePlay
MetaverseGamePlayPrize.objects.select_related("game_play")

MockStarbucksCard

Table: brands_mock_starbucks_card
Field Type Constraints
id BigAutoField PK
card_number CharField(16) unique
pin CharField(8) nullable
balance DecimalField(7,2) nullable
activated BooleanField default=False
nickname TextField nullable unique

Sample Queries (click to expand)

Get all records
MockStarbucksCard.objects.all()
Get by ID
MockStarbucksCard.objects.get(id=1)

OpennodeEvent

Table: fold_opennodeevent
Field Type Constraints
id BigAutoField PK
token CharField(40)
payload JSONField
created DateTimeField
processed DateTimeField nullable

Sample Queries (click to expand)

Get all records
OpennodeEvent.objects.all()
Get by ID
OpennodeEvent.objects.get(id=1)
Filter by created (last 7 days)
OpennodeEvent.objects.filter(created__gte=datetime.now()-timedelta(days=7))

OrderCard

Table: fold_ordercard
Field Type Constraints
id BigAutoField PK
order FK → Order
user_input JSONField default=dict()
external_id CharField(256) nullable
status FK → OrderCardStatus nullable
final BooleanField default=False
card FK → Card nullable

Relationships

.order N:1 Order
.status N:1 OrderCardStatus
.card N:1 Card

Referenced By (1 tables)

OrderCardStatus N:1 .order_card

Sample Queries (click to expand)

Get all records
OrderCard.objects.all()
Get by ID
OrderCard.objects.get(id=1)
With related Order
OrderCard.objects.select_related("order")

OrderCardStatus

Table: fold_ordercardstatus
Field Type Constraints
id BigAutoField PK
order_card FK → OrderCard
status SmallIntegerField choicesShow 5 choices
0NEWNew
1PLACED_ORDERPlaced order
2RECEIVED_CARD_DATAReceived card data
3PARSED_CARD_DATAParsed card data
4FINALIZEDFinalized
time DateTimeField nullable default=now()
account_manager FK → CardForCoinProfile nullable

Relationships

.order_card N:1 OrderCard
.account_manager N:1 CardForCoinProfile

Referenced By (1 tables)

OrderCard N:1 .status

Sample Queries (click to expand)

Get all records
OrderCardStatus.objects.all()
Get by ID
OrderCardStatus.objects.get(id=1)
With related OrderCard
OrderCardStatus.objects.select_related("order_card")
Filter by time (last 7 days)
OrderCardStatus.objects.filter(time__gte=datetime.now()-timedelta(days=7))

OrderFile

Table: fold_orderfile
Field Type Constraints
id BigAutoField PK
order FK → Order
file FileField

Relationships

.order N:1 Order

Sample Queries (click to expand)

Get all records
OrderFile.objects.all()
Get by ID
OrderFile.objects.get(id=1)
With related Order
OrderFile.objects.select_related("order")

OrderNote

Table: fold_ordernote
Field Type Constraints
id BigAutoField PK
time DateTimeField nullable
author FK → CardForCoinProfile nullable
order FK → Order
note TextField

Relationships

.author N:1 CardForCoinProfile
.order N:1 Order

Sample Queries (click to expand)

Get all records
OrderNote.objects.all()
Get by ID
OrderNote.objects.get(id=1)
With related CardForCoinProfile
OrderNote.objects.select_related("author")
Filter by time (last 7 days)
OrderNote.objects.filter(time__gte=datetime.now()-timedelta(days=7))

OrderStatus

Table: fold_orderstatus
Field Type Constraints
id BigAutoField PK
order FK → Order
status SmallIntegerField choicesShow 5 choices
0NEWNew
1PLACED_ORDERPlaced order
2RECEIVED_CARD_DATAReceived card data
3PARSED_CARD_DATAParsed card data
4FINALIZEDFinalized
time DateTimeField nullable default=now()
account_manager FK → CardForCoinProfile nullable

Relationships

.order N:1 Order
.account_manager N:1 CardForCoinProfile

Referenced By (1 tables)

Order N:1 .status

Sample Queries (click to expand)

Get all records
OrderStatus.objects.all()
Get by ID
OrderStatus.objects.get(id=1)
With related Order
OrderStatus.objects.select_related("order")
Filter by time (last 7 days)
OrderStatus.objects.filter(time__gte=datetime.now()-timedelta(days=7))

Payment

Table: fold_payment Extends: SubtypedModel
Field Type Constraints
id BigAutoField PK
created_at DateTimeField nullable
amount_paid FK → CurrencyAmount nullable
recipient_address CharField(256) nullable
usd_equivalent DecimalField(8,2) nullable

Relationships

.amount_paid N:1 CurrencyAmount

Referenced By (4 tables)

Order N:M .payments
Withdrawal N:1 .payment
PaymentOutput N:1 .payment

Sample Queries (click to expand)

Get all records
Payment.objects.all()
Get by ID
Payment.objects.get(id=1)
With related CurrencyAmount
Payment.objects.select_related("amount_paid")
Filter by created_at (last 7 days)
Payment.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

Schema History (click to expand)

#0001CreateModel2022-05-24
#0001AddField: amount_paid2022-05-24
#0002AlterField: created_at2020-04-24

PaymentOutput

Table: fold_paymentoutput
Field Type Constraints
id BigAutoField PK
amount FK → CurrencyAmount
recipient_address CharField(256)
time DateTimeField default=now()
payment FK → Payment

Relationships

.amount N:1 CurrencyAmount
.payment N:1 Payment

Sample Queries (click to expand)

Get all records
PaymentOutput.objects.all()
Get by ID
PaymentOutput.objects.get(id=1)
With related CurrencyAmount
PaymentOutput.objects.select_related("amount")
Filter by time (last 7 days)
PaymentOutput.objects.filter(time__gte=datetime.now()-timedelta(days=7))

PrefineryEvent

Table: fold_prefinery_event Extends: BaseModelMixin
Field Type Constraints
token TextField PK
payload JSONField default=dict()
type TextField indexed nullable
user_email TextField indexed nullable
processed DateTimeField nullable indexed

Sample Queries (click to expand)

Get all records
PrefineryEvent.objects.all()
Get by ID
PrefineryEvent.objects.get(id=1)
Filter by processed (last 7 days)
PrefineryEvent.objects.filter(processed__gte=datetime.now()-timedelta(days=7))

ProfileBitcoinAddress

Table: fold_profilebitcoinaddress
Field Type Constraints
id BigAutoField PK
profile FK → CardForCoinProfile
time DateTimeField default=now()
address CharField(256)

Relationships

.profile N:1 CardForCoinProfile

Referenced By (1 tables)

CardForCoinProfile N:1 .bitcoin_address

Sample Queries (click to expand)

Get all records
ProfileBitcoinAddress.objects.all()
Get by ID
ProfileBitcoinAddress.objects.get(id=1)
With related CardForCoinProfile
ProfileBitcoinAddress.objects.select_related("profile")
Filter by time (last 7 days)
ProfileBitcoinAddress.objects.filter(time__gte=datetime.now()-timedelta(days=7))

ProfileEmail

Table: fold_profileemail
Field Type Constraints
id BigAutoField PK
profile FK → CardForCoinProfile
address CharField(256)
time DateTimeField default=now()

Relationships

.profile N:1 CardForCoinProfile

Referenced By (1 tables)

Sample Queries (click to expand)

Get all records
ProfileEmail.objects.all()
Get by ID
ProfileEmail.objects.get(id=1)
With related CardForCoinProfile
ProfileEmail.objects.select_related("profile")
Filter by time (last 7 days)
ProfileEmail.objects.filter(time__gte=datetime.now()-timedelta(days=7))

ProfileNote

Table: fold_profilenote
Field Type Constraints
id BigAutoField PK
time DateTimeField nullable
author FK → CardForCoinProfile nullable
profile FK → CardForCoinProfile
note TextField

Relationships

.author N:1 CardForCoinProfile
.profile N:1 CardForCoinProfile

Sample Queries (click to expand)

Get all records
ProfileNote.objects.all()
Get by ID
ProfileNote.objects.get(id=1)
With related CardForCoinProfile
ProfileNote.objects.select_related("author")
Filter by time (last 7 days)
ProfileNote.objects.filter(time__gte=datetime.now()-timedelta(days=7))

ProfilePhoneNumber

Table: fold_profilephonenumber
Field Type Constraints
id BigAutoField PK
profile FK → CardForCoinProfile
time DateTimeField default=now()

Relationships

.profile N:1 CardForCoinProfile

Referenced By (1 tables)

CardForCoinProfile N:1 .phone_number

Sample Queries (click to expand)

Get all records
ProfilePhoneNumber.objects.all()
Get by ID
ProfilePhoneNumber.objects.get(id=1)
With related CardForCoinProfile
ProfilePhoneNumber.objects.select_related("profile")
Filter by time (last 7 days)
ProfilePhoneNumber.objects.filter(time__gte=datetime.now()-timedelta(days=7))

ProxyNode

Table: fold_proxynode
Field Type Constraints
id BigAutoField PK
address_ipv4 CharField(15)
provider CharField(255)
geo_location CharField(255)
geo_location_normalized CharField(255)
data_center CharField(255)
time DateTimeField nullable
in_use BooleanField default=False

Referenced By (1 tables)

SeleniumSession N:1 .proxy_node

Sample Queries (click to expand)

Get all records
ProxyNode.objects.all()
Get by ID
ProxyNode.objects.get(id=1)
Filter by time (last 7 days)
ProxyNode.objects.filter(time__gte=datetime.now()-timedelta(days=7))

QualifiedSpendingForACHRewardRate

Table: fold_qualified_spending_for_ach_reward_rate Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
spending_amount DecimalField(10,2) default=0
spending_date DateField indexed

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
QualifiedSpendingForACHRewardRate.objects.all()
Get by ID
QualifiedSpendingForACHRewardRate.objects.get(id=1)
With related Account
QualifiedSpendingForACHRewardRate.objects.select_related("account")
Filter by account
QualifiedSpendingForACHRewardRate.objects.filter(account_id=123)
Filter by spending_date (last 7 days)
QualifiedSpendingForACHRewardRate.objects.filter(spending_date__gte=datetime.now()-timedelta(days=7))

Question

Table: fold_journey_question Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
question_id UUIDField default=uuid4 unique
journey FK → Journey
template JSONField default=dict()
index PositiveIntegerField nullable
trade_provider TextField choices nullable

Relationships

.journey N:1 Journey

Referenced By (1 tables)

Answer N:1 .question

Sample Queries (click to expand)

Get all records
Question.objects.all()
Get by ID
Question.objects.get(id=1)
With related Journey
Question.objects.select_related("journey")

Schema History (click to expand)

#0472CreateModel2024-03-26
#0491AddField: question_id2024-06-04
#0491AlterField: question_id2024-06-04
#0544AddField: trade_provider2024-11-14
#0609AlterField: template2025-07-18

QuestionSet

Table: fold_questionset
Field Type Constraints
id CharField(30) PK
time_limit IntegerField
expired BooleanField default=False
created_at DateTimeField nullable
score DecimalField(5,2) nullable
verification FK → VerificationAttempt

Relationships

.verification N:1 VerificationAttempt

Sample Queries (click to expand)

Get all records
QuestionSet.objects.all()
Get by ID
QuestionSet.objects.get(id=1)
With related VerificationAttempt
QuestionSet.objects.select_related("verification")
Filter by created_at (last 7 days)
QuestionSet.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

RaiseDailyReport

Table: cardforcoin_raise_daily_report
Field Type Constraints
id BigAutoField PK
time DateTimeField default=now()
csv TextField

Referenced By (1 tables)

Sample Queries (click to expand)

Get all records
RaiseDailyReport.objects.all()
Get by ID
RaiseDailyReport.objects.get(id=1)
Filter by time (last 7 days)
RaiseDailyReport.objects.filter(time__gte=datetime.now()-timedelta(days=7))

RaiseDailyReportRow

Table: cardforcoin_raise_daily_report_row
Field Type Constraints
id BigAutoField PK
report FK → RaiseDailyReport
json JSONField default=dict()
card FK → Card nullable

Relationships

.report N:1 RaiseDailyReport
.card N:1 Card

Referenced By (1 tables)

RaiseDenial N:1 .first_report

Sample Queries (click to expand)

Get all records
RaiseDailyReportRow.objects.all()
Get by ID
RaiseDailyReportRow.objects.get(id=1)
With related RaiseDailyReport
RaiseDailyReportRow.objects.select_related("report")

RaiseDenial

Table: cardforcoin_raise_denial
Field Type Constraints
id BigAutoField PK
listing FK → Listing
first_report FK → RaiseDailyReportRow

Relationships

.listing N:1 Listing
.first_report N:1 RaiseDailyReportRow

Referenced By (1 tables)

RaiseDenialReview N:1 .denial

Sample Queries (click to expand)

Get all records
RaiseDenial.objects.all()
Get by ID
RaiseDenial.objects.get(id=1)
With related Listing
RaiseDenial.objects.select_related("listing")

RaiseDenialReview

Table: cardforcoin_raise_denial_review
Field Type Constraints
id BigAutoField PK
denial FK → RaiseDenial
card_destroyed BooleanField default=False
balance DecimalField(30,8)
accurate BooleanField default=False
time DateTimeField default=now()

Relationships

.denial N:1 RaiseDenial

Sample Queries (click to expand)

Get all records
RaiseDenialReview.objects.all()
Get by ID
RaiseDenialReview.objects.get(id=1)
With related RaiseDenial
RaiseDenialReview.objects.select_related("denial")
Filter by time (last 7 days)
RaiseDenialReview.objects.filter(time__gte=datetime.now()-timedelta(days=7))

ReferralConversion

Table: fold_referralconversion
Field Type Constraints
id BigAutoField PK
token FK → ReferralToken
order FK → Order
time DateTimeField default=now()
referral_bonus OneToOne → BalanceChange
referral_rate DecimalField(12,2) nullable

Relationships

.token N:1 ReferralToken
.order N:1 Order
.referral_bonus 1:1 BalanceChange

Sample Queries (click to expand)

Get all records
ReferralConversion.objects.all()
Get by ID
ReferralConversion.objects.get(id=1)
With related ReferralToken
ReferralConversion.objects.select_related("token")
Filter by time (last 7 days)
ReferralConversion.objects.filter(time__gte=datetime.now()-timedelta(days=7))

RewardWithdrawalRequest

Table: fold_rewardwithdrawalrequest Extends: SaveHooks
Field Type Constraints
id BigAutoField PK
status SmallIntegerField choices default=WAITING() indexedSTATUSES
api_id CharField(40)
batch FK → RewardWithdrawalBatch nullable
account FK → Account
amount_requested DecimalField(30,8)
balance_change OneToOne → BalanceChange nullable
created DateTimeField default=now()
modified_at DateTimeField nullable
address CharField(256)
withdrawal_type CharField(40) nullable choicesShow 2 choices
LNLN
ON_CHAINOn Chain
external_id CharField(40) nullable
expiry_date IntegerField nullable

Relationships

.account N:1 Account
.balance_change 1:1 BalanceChange

Referenced By (1 tables)

RewardWithdrawalRequestEvent N:1 .reward_withdrawal_request

Sample Queries (click to expand)

Get all records
RewardWithdrawalRequest.objects.all()
Get by ID
RewardWithdrawalRequest.objects.get(id=1)
With related RewardWithdrawalBatch
RewardWithdrawalRequest.objects.select_related("batch")
Filter by account
RewardWithdrawalRequest.objects.filter(account_id=123)
Filter by created (last 7 days)
RewardWithdrawalRequest.objects.filter(created__gte=datetime.now()-timedelta(days=7))

RewardWithdrawalRequestEvent

Table: fold_reward_withdrawal_request_event Extends: AccountEvent
Field Type Constraints
id BigAutoField PK
reward_withdrawal_request FK → RewardWithdrawalRequest nullable
new_status SmallIntegerField choicesRewardWithdrawalRequest STATUSES

Relationships

.reward_withdrawal_request N:1 RewardWithdrawalRequest

Sample Queries (click to expand)

Get all records
RewardWithdrawalRequestEvent.objects.all()
Get by ID
RewardWithdrawalRequestEvent.objects.get(id=1)
With related RewardWithdrawalRequest
RewardWithdrawalRequestEvent.objects.select_related("reward_withdrawal_request")

RoundUp

Table: fold_round_up Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
is_enabled BooleanField default=False
multiplier DecimalField(6,2)
accumulated_round_up_amount DecimalField(10,2)

Relationships

.account N:1 Account

Referenced By (2 tables)

WalletQuote N:1 .round_up

Sample Queries (click to expand)

Get all records
RoundUp.objects.all()
Get by ID
RoundUp.objects.get(id=1)
With related Account
RoundUp.objects.select_related("account")
Filter by account
RoundUp.objects.filter(account_id=123)

Sale

Table: fold_sale
Field Type Constraints
id BigAutoField PK
card OneToOne → Card
buyer FK → Buyer
created_at DateTimeField nullable
balance_usd DecimalField(7,2) default=Decimal()
price_usd DecimalField(7,2) default=Decimal()

Relationships

.card 1:1 Card
.buyer N:1 Buyer

Sample Queries (click to expand)

Get all records
Sale.objects.all()
Get by ID
Sale.objects.get(id=1)
With related Card
Sale.objects.select_related("card")
Filter by created_at (last 7 days)
Sale.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

Schema History (click to expand)

#0001CreateModel2022-05-24
#0001AddField: card2022-05-24

SardineExternalAccountStatusAudit

Table: fold_sardineexternalaccountstatusaudit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
sardine_external_account FK → SardineExternalAccount
status CharField(255)
info JSONField default=dict() nullable

Relationships

.sardine_external_account N:1 SardineExternalAccount

Sample Queries (click to expand)

Get all records
SardineExternalAccountStatusAudit.objects.all()
Get by ID
SardineExternalAccountStatusAudit.objects.get(id=1)
With related SardineExternalAccount
SardineExternalAccountStatusAudit.objects.select_related("sardine_external_account")

SardineSession

Table: sardine_session Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account nullable
device_id TextField unique
session_key TextField unique nullable
current_flow CharField(20) choices nullableShow 2 choices
0SIGNUPsignup
1ONBOARDINGonboarding

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
SardineSession.objects.all()
Get by ID
SardineSession.objects.get(id=1)
With related Account
SardineSession.objects.select_related("account")
Filter by account
SardineSession.objects.filter(account_id=123)

SeleniumNode

Table: mechant_dash_selenium_node
Field Type Constraints
id BigAutoField PK
address_ipv4 CharField(15)
time DateTimeField nullable
in_use BooleanField default=False

Referenced By (1 tables)

SeleniumSession N:1 .selenium_node

Sample Queries (click to expand)

Get all records
SeleniumNode.objects.all()
Get by ID
SeleniumNode.objects.get(id=1)
Filter by time (last 7 days)
SeleniumNode.objects.filter(time__gte=datetime.now()-timedelta(days=7))

SeleniumSession

Table: mechant_dash_selenium_session
Field Type Constraints
id BigAutoField PK
selenium_session_id CharField(255) unique
selenium_node FK → SeleniumNode
proxy_node FK → ProxyNode nullable
time DateTimeField nullable
in_use BooleanField default=False

Relationships

.selenium_node N:1 SeleniumNode
.proxy_node N:1 ProxyNode

Referenced By (2 tables)

Transfer N:1 .selenium_session
SeleniumSessionError N:1 .selenium_session

Sample Queries (click to expand)

Get all records
SeleniumSession.objects.all()
Get by ID
SeleniumSession.objects.get(id=1)
With related SeleniumNode
SeleniumSession.objects.select_related("selenium_node")
Filter by time (last 7 days)
SeleniumSession.objects.filter(time__gte=datetime.now()-timedelta(days=7))

SeleniumSessionError

Table: fold_seleniumsessionerror
Field Type Constraints
id BigAutoField PK
selenium_session FK → SeleniumSession
brand CharField(30) nullable
reason CharField(100)
time DateTimeField

Relationships

.selenium_session N:1 SeleniumSession

Sample Queries (click to expand)

Get all records
SeleniumSessionError.objects.all()
Get by ID
SeleniumSessionError.objects.get(id=1)
With related SeleniumSession
SeleniumSessionError.objects.select_related("selenium_session")
Filter by time (last 7 days)
SeleniumSessionError.objects.filter(time__gte=datetime.now()-timedelta(days=7))

Slot

Table: fold_slot
Field Type Constraints
id BigAutoField PK
account FK → Account
amount DecimalField(30,8)
archived BooleanField default=False
api_id CharField(40)
brand FK → Brand
brand_field_deprecated CharField(30) nullable
card OneToOne → Card nullable
currency CharField(6)
is_refundable BooleanField default=False
order OneToOne → Order nullable
refund_rate DecimalField(30,8) nullable
time_created DateTimeField
time_refund_requested DateTimeField nullable
public_id CharField(60) nullable unique

Relationships

.account N:1 Account
.brand N:1 Brand
.card 1:1 Card
.order 1:1 Order

Sample Queries (click to expand)

Get all records
Slot.objects.all()
Get by ID
Slot.objects.get(id=1)
With related Account
Slot.objects.select_related("account")
Filter by account
Slot.objects.filter(account_id=123)
Filter by time_created (last 7 days)
Slot.objects.filter(time_created__gte=datetime.now()-timedelta(days=7))

Schema History (click to expand)

#0001AlterField: card2022-09-25
#0001AddField: order2022-09-25
#0001AddField: archived2022-09-25
#0001RenameField2022-09-25
#0001AlterField: brand_field_deprecated2022-09-25
#0001AddField: brand2022-09-25
#0001AlterField: card2022-09-25
#0539AddField: public_id2024-10-31
#0636AlterField: amount2025-09-25
#0636AlterField: refund_rate2025-09-25

SpendForSpinRewardTrigger

Table: spend_for_spin_reward_trigger Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
spend_threshold DecimalField(7,2)
num_of_spins_to_award PositiveIntegerField

Referenced By (1 tables)

AccountToSpendForSpinRewardTrigger N:1 .spend_for_spin_reward_trigger

Sample Queries (click to expand)

Get all records
SpendForSpinRewardTrigger.objects.all()
Get by ID
SpendForSpinRewardTrigger.objects.get(id=1)

SpendSpinBoost

Table: fold_spend_spin_boost Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
multiplier DecimalField(4,2)
spend_source TextField choicesSpendSources
percentage_to_convert_min PositiveIntegerField nullable

Sample Queries (click to expand)

Get all records
SpendSpinBoost.objects.all()
Get by ID
SpendSpinBoost.objects.get(id=1)

SpendingLimit

Table: fold_spending_limit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
spending_limit DecimalField(7,2)
amount_to_mask DecimalField(7,2) nullable
account FK → Account
token CharField(256) unique
is_active BooleanField default=False

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
SpendingLimit.objects.all()
Get by ID
SpendingLimit.objects.get(id=1)
With related Account
SpendingLimit.objects.select_related("account")
Filter by account
SpendingLimit.objects.filter(account_id=123)

StripeAccount

Table: credit_card_stripe_account Extends: BaseModelMixin
Field Type Constraints
stripe_account_id CharField(255) PK
account FK → Account
is_deleted BooleanField default=False
customer_id CharField(255) nullable
gross_yearly_income_tokenized CharField(255) nullable
housing_status CharField(255) nullable
monthly_housing_expense_tokenized CharField(255) nullable
issuing_program_applied_at DateTimeField nullable
issuing_program_id CharField(255) nullable
credit_policy_applied_at DateTimeField nullable
credit_policy_id CharField(255) nullable
cardholder_id CharField(255) nullable
kyc_status CharField(255) choices default=valueStripeAccountKYCStatus
credit_period_ends_on_days IntegerField nullable

Relationships

.account N:1 Account

Referenced By (7 tables)

CreditCard N:1 .stripe_account
CreditCardTransaction N:1 .stripe_account
CreditCardStatement N:1 .stripe_account
CreditCardAutoPay N:1 .stripe_account
StripeEvent N:1 .stripe_account
StripePaymentMethod N:1 .stripe_account

Sample Queries (click to expand)

Get all records
StripeAccount.objects.all()
Get by ID
StripeAccount.objects.get(id=1)
With related Account
StripeAccount.objects.select_related("account")
Filter by account
StripeAccount.objects.filter(account_id=123)
Filter by issuing_program_applied_at (last 7 days)
StripeAccount.objects.filter(issuing_program_applied_at__gte=datetime.now()-timedelta(days=7))

StripeEvent

Table: credit_card_stripe_event Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
event_id CharField(255) unique
payload JSONField default=dict()
stripe_account FK → StripeAccount nullable
type CharField(255)
processed_at DateTimeField nullable

Relationships

.stripe_account N:1 StripeAccount

Sample Queries (click to expand)

Get all records
StripeEvent.objects.all()
Get by ID
StripeEvent.objects.get(id=1)
With related StripeAccount
StripeEvent.objects.select_related("stripe_account")
Filter by processed_at (last 7 days)
StripeEvent.objects.filter(processed_at__gte=datetime.now()-timedelta(days=7))

StripePaymentMethod

Table: credit_card_stripe_payment_method Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
payment_method_id CharField(255) unique
payment_intent_id CharField(255) unique
stripe_account FK → StripeAccount
ach_account FK → ACHAccount nullable
fold_checking_account_token CharField(255) nullable
is_deleted BooleanField default=False

Relationships

.stripe_account N:1 StripeAccount
.ach_account N:1 ACHAccount

Referenced By (1 tables)

CreditCardAutoPay N:1 .payment_method

Sample Queries (click to expand)

Get all records
StripePaymentMethod.objects.all()
Get by ID
StripePaymentMethod.objects.get(id=1)
With related StripeAccount
StripePaymentMethod.objects.select_related("stripe_account")

Tier

Table: fold_tier Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
tier_id PositiveIntegerField unique
name CharField(40) unique
config JSONField default=dict()

Sample Queries (click to expand)

Get all records
Tier.objects.all()
Get by ID
Tier.objects.get(id=1)

Schema History (click to expand)

#0584CreateModel2025-03-17

Transfer

Table: fold_transfer Extends: SubtypedModel
Field Type Constraints
id BigAutoField PK
created_at DateTimeField nullable
status FK → TransferStatus nullable
account FK → BrandAccount nullable
sources M2M → Card
targets M2M → Card
external_id CharField(40) nullable
notes TextField nullable
selenium_session FK → SeleniumSession nullable

Relationships

.status N:1 TransferStatus
.account N:1 BrandAccount
.sources N:M Card
.targets N:M Card
.selenium_session N:1 SeleniumSession

Referenced By (4 tables)

Order N:M .transfers
TransferStatus N:1 .transfer
TransferSource N:1 .transfer
TransferTarget N:1 .transfer

Sample Queries (click to expand)

Get all records
Transfer.objects.all()
Get by ID
Transfer.objects.get(id=1)
With related TransferStatus
Transfer.objects.select_related("status")
Filter by account
Transfer.objects.filter(account_id=123)
Filter by created_at (last 7 days)
Transfer.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

Schema History (click to expand)

#0001CreateModel2022-05-24
#0001AddField: selenium_session2022-05-24
#0001AddField: sources2022-05-24
#0001AddField: status2022-05-24
#0001AddField: targets2022-05-24
#0002AlterField: sources2020-04-24
#0002AlterField: targets2020-04-24
#0004RenameField2020-04-24
#0016AddField: starbucks_account2020-04-24
#0018RenameField2022-05-24

TransferLimit

Table: fold_transfer_limit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
amount_per_transaction DecimalField(7,2)
amount_per_day DecimalField(7,2)
amount_per_month DecimalField(7,2)
account FK → Account
type CharField(50) choicesFoldCardTransferType

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
TransferLimit.objects.all()
Get by ID
TransferLimit.objects.get(id=1)
With related Account
TransferLimit.objects.select_related("account")
Filter by account
TransferLimit.objects.filter(account_id=123)

TransferSource

Table: merchant_dash_transfer_sources
Field Type Constraints
id BigAutoField PK
transfer FK → Transfer
card FK → Card nullable
amount_usd DecimalField(7,2) default=Decimal() nullable

Relationships

.transfer N:1 Transfer
.card N:1 Card

Sample Queries (click to expand)

Get all records
TransferSource.objects.all()
Get by ID
TransferSource.objects.get(id=1)
With related Transfer
TransferSource.objects.select_related("transfer")

TransferStatus

Table: mechant_dash_transfer_status Extends: SaveHooks
Field Type Constraints
id BigAutoField PK
time DateTimeField default=now()
transfer FK → Transfer
status CharField(10) choices
failure_reason CharField(100)

Relationships

.transfer N:1 Transfer

Referenced By (1 tables)

Transfer N:1 .status

Sample Queries (click to expand)

Get all records
TransferStatus.objects.all()
Get by ID
TransferStatus.objects.get(id=1)
With related Transfer
TransferStatus.objects.select_related("transfer")
Filter by time (last 7 days)
TransferStatus.objects.filter(time__gte=datetime.now()-timedelta(days=7))

TransferTarget

Table: merchant_dash_transfer_targets
Field Type Constraints
id BigAutoField PK
transfer FK → Transfer
card FK → Card nullable
amount_usd DecimalField(7,2) default=Decimal() nullable

Relationships

.transfer N:1 Transfer
.card N:1 Card

Sample Queries (click to expand)

Get all records
TransferTarget.objects.all()
Get by ID
TransferTarget.objects.get(id=1)
With related Transfer
TransferTarget.objects.select_related("transfer")

TrendingPreference

Table: fold_trending_preference
Field Type Constraints
id BigAutoField PK
user OneToOneField
email EmailField nullable
keep_updated BooleanField default=False
participating BooleanField default=True

Sample Queries (click to expand)

Get all records
TrendingPreference.objects.all()
Get by ID
TrendingPreference.objects.get(id=1)

UserInterest

Table: fold_user_interest Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
additional_data JSONField default=dict()

Relationships

.account N:1 Account

Sample Queries (click to expand)

Get all records
UserInterest.objects.all()
Get by ID
UserInterest.objects.get(id=1)
With related Account
UserInterest.objects.select_related("account")
Filter by account
UserInterest.objects.filter(account_id=123)

VerificationAttempt

Table: fold_verificationattempt
Field Type Constraints
id CharField(30) PK
valid BooleanField default=False
created_at DateTimeField nullable
profile FK → CardForCoinProfile

Relationships

.profile N:1 CardForCoinProfile

Referenced By (1 tables)

QuestionSet N:1 .verification

Sample Queries (click to expand)

Get all records
VerificationAttempt.objects.all()
Get by ID
VerificationAttempt.objects.get(id=1)
With related CardForCoinProfile
VerificationAttempt.objects.select_related("profile")
Filter by created_at (last 7 days)
VerificationAttempt.objects.filter(created_at__gte=datetime.now()-timedelta(days=7))

WalletDeposit

Table: fold_wallet_deposit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
asset TextField choices
amount DecimalField(10,8)
public_id UUIDField unique default=uuid4 indexed
status TextField choices indexed
transaction_hash TextField nullable indexed
origin_address TextField nullable
destination_address TextField nullable
bitgo_account FK → BitgoAccount nullable
prime_trust_account FK → PrimeTrustAccount nullable
fortress_account FK → FortressAccount nullable

Relationships

.bitgo_account N:1 BitgoAccount
.prime_trust_account N:1 PrimeTrustAccount
.fortress_account N:1 FortressAccount

Referenced By (2 tables)

WalletTransaction 1:1 .wallet_deposit
WalletDepositWrongCustodian 1:1 .wallet_deposit

Sample Queries (click to expand)

Get all records
WalletDeposit.objects.all()
Get by ID
WalletDeposit.objects.get(id=1)
With related BitgoAccount
WalletDeposit.objects.select_related("bitgo_account")

WalletDepositWrongCustodian

Table: fold_wallet_deposit_wrong_custodian Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
wallet_deposit OneToOne → WalletDeposit nullable
receiving_custodian TextField choices
correct_custodian TextField choices
resolved BooleanField default=False

Relationships

.account N:1 Account
.wallet_deposit 1:1 WalletDeposit

Sample Queries (click to expand)

Get all records
WalletDepositWrongCustodian.objects.all()
Get by ID
WalletDepositWrongCustodian.objects.get(id=1)
With related Account
WalletDepositWrongCustodian.objects.select_related("account")
Filter by account
WalletDepositWrongCustodian.objects.filter(account_id=123)

WalletQuote

Table: fold_wallet_quote Extends: BaseModelMixin
Field Type Constraints
id UUIDField PK default=uuid4
external_id UUIDField nullable
trade_provider TextField choices
transaction_type TextField choices
async_processing BooleanField default=False
otc_request BooleanField default=False
auto_stack_frequency CharField(100) choices nullable
input_currency TextField choices
input_amount DecimalField(14,8)
fee_user_visible_amount_usd DecimalField(10,2)
fee_spread_amount_usd DecimalField(10,2)
fee_user_visible_amount_btc DecimalField(10,8) nullable
fee_spread_amount_btc DecimalField(10,8) nullable
trade_provider_input_amount DecimalField(10,2) nullable
output_currency TextField choices
output_amount DecimalField(14,8)
provider_exchange_rate DecimalField(14,2) nullable
output_amount_estimate DecimalField(14,8) nullable
trade_provider_output_amount DecimalField(14,8) nullable
expiration_time DateTimeField
settlement_time DateTimeField nullable
unlock_time DateTimeField nullable
prime_trust_created_at DateTimeField nullable
provider_created_at DateTimeField nullable
bitgo_account FK → BitgoAccount nullable
fortress_account FK → FortressAccount nullable
prime_trust_account FK → PrimeTrustAccount nullable
auto_stack FK → AutoStack nullable
round_up FK → RoundUp nullable
direct_to_bitcoin FK → DirectToBitcoin nullable
fold_card_transaction OneToOne → FoldCardTransaction nullable
fold_card_transaction_reversal OneToOne → FoldCardTransaction nullable
status CharField(255) choices default=value
bitgo_cash_transfer_id CharField(64) nullable
bitgo_cash_reversal_id CharField(64) nullable
external_fee_transfer_id CharField(64) nullable
external_spread_transfer_id CharField(64) nullable
fortress_cash_transfer_id UUIDField nullable
fortress_cash_reversal_id UUIDField nullable
prime_trust_cash_transfer_id UUIDField nullable
prime_trust_cash_reversal_id UUIDField nullable
extra_spin_count IntegerField
extra_spin_entries M2M → AccountGameEntry

Relationships

.bitgo_account N:1 BitgoAccount
.fortress_account N:1 FortressAccount
.prime_trust_account N:1 PrimeTrustAccount
.auto_stack N:1 AutoStack
.round_up N:1 RoundUp
.direct_to_bitcoin N:1 DirectToBitcoin
.fold_card_transaction 1:1 FoldCardTransaction
.fold_card_transaction_reversal 1:1 FoldCardTransaction
.extra_spin_entries N:M AccountGameEntry

Referenced By (3 tables)

WalletQuoteStatusAudit N:1 .wallet_quote
BitcoinBuyLockOverrideAudit N:1 .quote_overridden

Sample Queries (click to expand)

Get all records
WalletQuote.objects.all()
Get by ID
WalletQuote.objects.get(id=1)
With related BitgoAccount
WalletQuote.objects.select_related("bitgo_account")
Filter by expiration_time (last 7 days)
WalletQuote.objects.filter(expiration_time__gte=datetime.now()-timedelta(days=7))

WalletQuoteStatusAudit

Table: fold_wallet_quote_status_audit Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
wallet_quote FK → WalletQuote
status CharField(255)

Relationships

.wallet_quote N:1 WalletQuote

Sample Queries (click to expand)

Get all records
WalletQuoteStatusAudit.objects.all()
Get by ID
WalletQuoteStatusAudit.objects.get(id=1)
With related WalletQuote
WalletQuoteStatusAudit.objects.select_related("wallet_quote")

WalletTransaction

Table: fold_wallet_transaction Extends: BaseModelMixin
Field Type Constraints
id UUIDField PK default=uuid4
account FK → Account
type TextField choices
automation_type TextField choices nullable
quote OneToOne → WalletQuote nullable
wallet_withdrawal OneToOne → WalletWithdrawal nullable
wallet_deposit OneToOne → WalletDeposit nullable
bitcoin_gift_card_redemption OneToOne → BitcoinGiftCardQuote nullable
asset_amount DecimalField(10,8)
asset_currency TextField choices
fiat_amount DecimalField(10,2) nullable
fiat_currency TextField choices nullable
status TextField choices

Relationships

.account N:1 Account
.quote 1:1 WalletQuote
.wallet_withdrawal 1:1 WalletWithdrawal
.wallet_deposit 1:1 WalletDeposit
.bitcoin_gift_card_redemption 1:1 BitcoinGiftCardQuote

Sample Queries (click to expand)

Get all records
WalletTransaction.objects.all()
Get by ID
WalletTransaction.objects.get(id=1)
With related Account
WalletTransaction.objects.select_related("account")
Filter by account
WalletTransaction.objects.filter(account_id=123)

WalletWithdrawal

Table: fold_wallet_withdrawal Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
asset TextField choices
amount DecimalField(10,8)
amount_network_fees DecimalField(10,8)
amount_additional_fees DecimalField(10,8)
public_id UUIDField unique default=uuid4 indexed
external_id UUIDField unique indexed
status TextField choices indexed
transaction_id TextField nullable indexed
destination_address TextField nullable
prime_trust_account FK → PrimeTrustAccount nullable
fortress_account FK → FortressAccount nullable
bitgo_account FK → BitgoAccount nullable
external_fee_id TextField nullable

Relationships

.prime_trust_account N:1 PrimeTrustAccount
.fortress_account N:1 FortressAccount
.bitgo_account N:1 BitgoAccount

Referenced By (1 tables)

WalletTransaction 1:1 .wallet_withdrawal

Sample Queries (click to expand)

Get all records
WalletWithdrawal.objects.all()
Get by ID
WalletWithdrawal.objects.get(id=1)
With related PrimeTrustAccount
WalletWithdrawal.objects.select_related("prime_trust_account")

WhatsNewCard

Table: fold_whats_new_card
Field Type Constraints
id BigAutoField PK
title_text TextField nullable
body_text TextField nullable
call_to_action_text TextField nullable
call_to_action_type TextField nullable
call_to_action_additional_data JSONField default=dict()
image ImageField nullable
is_global BooleanField default=False
show_if_has_features M2M → Feature
show_if_has_tier IntegerField nullable
show_if_state_allows_bitcoin_buying BooleanField default=False
is_enabled BooleanField default=False
index PositiveIntegerField default=0

Relationships

.show_if_has_features N:M Feature

Sample Queries (click to expand)

Get all records
WhatsNewCard.objects.all()
Get by ID
WhatsNewCard.objects.get(id=1)
With related Feature
WhatsNewCard.objects.select_related("show_if_has_features")

WithdrawOnlyAccountDisable

Table: fold_withdrawonlyaccountdisable Extends: BaseModelMixin
Field Type Constraints
id BigAutoField PK
account FK → Account
auto_stack FK → AutoStack nullable
direct_to_bitcoin FK → DirectToBitcoin nullable
round_up FK → RoundUp nullable

Relationships

.account N:1 Account
.auto_stack N:1 AutoStack
.direct_to_bitcoin N:1 DirectToBitcoin
.round_up N:1 RoundUp

Sample Queries (click to expand)

Get all records
WithdrawOnlyAccountDisable.objects.all()
Get by ID
WithdrawOnlyAccountDisable.objects.get(id=1)
With related Account
WithdrawOnlyAccountDisable.objects.select_related("account")
Filter by account
WithdrawOnlyAccountDisable.objects.filter(account_id=123)

ZendeskTicket

Table: fold_zendeskticket
Field Type Constraints
ticket_number IntegerField PK unique
orders M2M → Order

Relationships

.orders N:M Order

Sample Queries (click to expand)

Get all records
ZendeskTicket.objects.all()
Get by ID
ZendeskTicket.objects.get(id=1)
With related Order
ZendeskTicket.objects.select_related("orders")