MCPcopy Index your code
hub / github.com/dcapal/dcapal

github.com/dcapal/dcapal @v0.9.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.0 ↗ · + Follow
535 symbols 1,233 edges 125 files 7 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

About

DcaPal is a pragmatic Dollar Cost Averaging tool for passive investors like me: financially-educated people managing their own portfolios of not-too-many assets replicating major world indices.

I was facing a common problem: it's that time of the month, got some savings to invest and have to split them across my portfolio assets. How the heck can I do it so that my portfolio stays balanced?

Hence DcaPal. You come here every week/month/quarter, build your portfolio, define asset allocation in percentage, input how much you want to invest and let the algorithm do the splitting for you.

Getting started

You can start using DcaPal right away. It's free. No registration required.

Build your own portfolio or, if you don't know where to start, explore our Demo portfolios:

Build Instructions

DcaPal does not store any user data. But if you are still concerned for your privacy, you can build and run it on your machine.

Start Docker environment

  • Setup the .env file
cp dcapal-backend/.env.example dcapal-backend/.env
  • Setup a password for the db and the JWT secret (you can use openssl rand -base64 32 to generate a random string) in the new .env file
POSTGRES_PASSWORD=<replace-with-your-pwd>
JWT_SECRET=<generated_secret>
  • Start the Docker environment
make dev-up

(Note: if you're using a Mac with an ARM processor, you should replace (in the docker-compose dev file) Cadvisor's image version with gcr.io/cadvisor/cadvisor:v0.47.1 and set platform: linux/aarch64)

Run DcaPal backend

Prepare dcapal.yml config file

cd dcapal-backend
cp config/dcapal/dcapal.yml dcapal.yml

Compile and start backend service

cargo run --release

Run DcaPal frontend

Build DcaPal Optimizer

cd dcapal-optimizer-wasm
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
wasm-pack build --release

Install NPM dependencies. Note: this is installing dcapal-optimizer-wasm package as well.

cd ../dcapal-frontend
npm install # Install dcapal-optimizer-wasm pkg as well

Run frontend server

npm run start

Architecture

flowchart LR
    Frontend[Frontend] ---|"/api/external/search?q={query}

/api/external/chart/${symbol}"|nginx[nginx]
    subgraph dcapal.com
        nginx---TradFiProvider[TradFi Provider]
        nginx---Backend[Backend]
        Backend---CryptoProvider[Crypto Provider REST API]
        Backend---|"/assets/fiat

/assets/crypto

/price/{base}?quote={quote}"|Redis[Redis]
    end

Contributing

Contributions and suggestions about how to improve this project are welcome! Please follow our contribution guidelines.

Thanks to all Contributors ❤️

Born as a personal Sunday morning project, DcaPal would have never grown so much without the help of heros willing to contribute with their time and work. Thank you very much ya all!

Missing contributors

Extension points exported contracts — how you extend this code

Expiring (Interface)
(no doc) [3 implementers]
dcapal-backend/src/app/infra/utils.rs
RedisMarket (Interface)
(no doc) [1 implementers]
dcapal-backend/src/ports/outbound/repository/market_data/redis_market.rs
RedisAsset (Interface)
(no doc) [1 implementers]
dcapal-backend/src/ports/outbound/repository/market_data/redis_asset.rs
AsRedisIndex (Interface)
(no doc) [1 implementers]
dcapal-backend/src/ports/outbound/repository/market_data/redis_asset.rs
AsYahooMarket (Interface)
(no doc) [1 implementers]
dcapal-backend/src/ports/outbound/adapter/yahoo.rs

Core symbols most depended-on inside this repo

get
called by 57
dcapal-backend/src/app/infra/utils.rs
t
called by 43
dcapal-frontend/src/components/allocationFlow/steps/end/allocateCard.js
currentPortfolio
called by 41
dcapal-frontend/src/components/allocationFlow/portfolioSlice.js
into
called by 34
dcapal-backend/src/ports/outbound/adapter/cw.rs
id
called by 17
dcapal-backend/src/app/domain/entity.rs
cn
called by 16
dcapal-frontend/src/lib/utils.js
solve
called by 12
dcapal-optimizer-wasm/src/optimize/advanced.rs
default
called by 10
dcapal-backend/src/app/infra/utils.rs

Shape

Function 216
Method 160
Class 125
Enum 29
Interface 5

Languages

Rust76%
TypeScript24%

Modules by API surface

dcapal-backend/src/ports/outbound/adapter/kraken.rs34 symbols
dcapal-optimizer-wasm/src/optimize/advanced.rs32 symbols
dcapal-optimizer-wasm/src/lib.rs28 symbols
dcapal-backend/src/app/domain/entity.rs20 symbols
dcapal-optimizer-wasm/src/optimize/basic.rs17 symbols
dcapal-backend/src/config.rs17 symbols
dcapal-backend/src/ports/outbound/repository/mod.rs16 symbols
dcapal-backend/src/ports/outbound/adapter/cw.rs16 symbols
dcapal-backend/src/ports/outbound/adapter/yahoo.rs14 symbols
dcapal-frontend/src/components/allocationFlow/portfolioSlice.js13 symbols
dcapal-backend/src/app/infra/utils.rs13 symbols
dcapal-backend/src/lib.rs12 symbols

For agents

$ claude mcp add dcapal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact