1-Click Perpetual Position Migration
Migrate open perpetual positions from any exchange to Pacifica in < 2 seconds. Zero market exposure. Zero price risk.
PaciPort is a delta-neutral position migration engine built for the Pacifica Exchange Hackathon. It enables traders to teleport their open perp positions between exchanges with atomic, slippage-minimized execution β closing on the source and opening on the destination in parallel to maintain continuous market exposure.
Moving perpetual positions between crypto exchanges is a nightmare:
- Manual close β transfer β re-open takes minutes, exposing traders to price risk
- No tooling exists to atomically migrate positions across exchanges
- Sticky TVL β exchanges benefit from the friction. Traders pay the cost
PaciPort executes a delta-neutral swap β simultaneously closing a position on the source exchange and opening an identical position on the destination β achieving zero net market exposure during migration.
Key features:
- Atomic 2-leg execution β close source + open destination concurrently via
Promise.allSettled - Automatic rollback β if one leg fails, the other is reversed
- Live price simulation β real-time PnL updates on all positions
- Migration receipt β detailed execution report with slippage analysis
- Fee savings calculator β shows annual savings from lower maker/taker fees
- Position teleport animation β Framer Motion "teleport" effect as positions move between panels
| Layer | Technology |
|---|---|
| Framework | Next.js 16.2.2 (App Router) |
| UI | React 19.2.4 |
| Styling | Tailwind CSS v4 + CSS custom props |
| Animations | Framer Motion 12 |
| Exchange | CCXT 4.5 (unified trading API) |
| Backend | Supabase (auth + credential vault) |
| Fonts | Inter + JetBrains Mono |
| Language | TypeScript 5 |
- Node.js β₯ 18
- npm β₯ 9
git clone https://github.com/edycutjong/paciport.git
cd paciport
npm installCreate a .env.local file in the project root:
# Supabase (optional β falls back to mock)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-keyNote: The app runs fully in demo mode without any environment variables. All exchange credentials are mocked and sandbox mode is enforced.
npm run devOpen http://localhost:3000 to see the dashboard.
npm run build
npm startpaciport/
βββ app/
β βββ api/
β β βββ migrate/route.ts # POST β execute position migration
β β βββ positions/route.ts # GET β fetch live positions
β βββ globals.css # Design tokens + animations
β βββ layout.tsx # Root layout with metadata
β βββ page.tsx # Main dashboard (3-column layout)
βββ components/
β βββ ExchangePanelHeader.tsx # Exchange connection status header
β βββ MigrateButton.tsx # Animated migration trigger
β βββ MigrationProgress.tsx # Step-by-step execution timeline
β βββ MigrationReceipt.tsx # Post-migration execution report
β βββ PositionCard.tsx # Individual position display card
βββ lib/
β βββ demo-data.ts # Demo positions + price simulator
β βββ exchange-client.ts # CCXT client factory + caching
β βββ migration-engine.ts # Core delta-neutral swap engine
β βββ supabase.ts # Supabase client + credential vault
β βββ types.ts # TypeScript interfaces
βββ public/ # Static assets
βββ package.json
βββ tsconfig.json
βββ next.config.ts
Execute a delta-neutral position migration.
Request Body:
{
"positionIds": ["pos-sol-long", "pos-eth-short"],
"sourceExchange": "binance",
"destinationExchange": "pacifica",
"maxSlippage": 0.1,
"dryRun": false
}Response:
{
"results": [
{
"id": "mig-1712592000000-a1b2c3",
"status": "success",
"position": { "..." },
"sourceLeg": { "status": "filled", "fillPrice": 148.18, "slippage": 0.0135 },
"destinationLeg": { "status": "filled", "fillPrice": 148.22, "slippage": 0.0135 },
"executionTimeMs": 1412,
"netSlippage": 0.0135
}
],
"summary": {
"total": 1,
"successful": 1,
"failed": 0,
"totalExecutionTimeMs": 1412,
"allSuccess": true
}
}Fetch all demo positions with live price updates.
- Select positions on the source exchange panel (Binance)
- Click Migrate β triggers
POST /api/migrate - Engine executes concurrently:
- Source leg: Close position on Binance (market sell for longs, market buy for shorts)
- Destination leg: Open identical position on Pacifica (same size, same side)
- Atomic safety:
- Both legs execute via
Promise.allSettled - If one leg fails and the other succeeds β automatic rollback
- If both succeed β migration complete
- Both legs execute via
- Receipt generated with execution time, slippage per leg, and net slippage
| Feature | Demo Mode (demo-user) |
Live Mode (real userId) |
|---|---|---|
| Order execution | Simulated (random slippage) | Real CCXT market orders |
| Exchange connection | Mocked credentials | Decrypted from Supabase vault |
| Sandbox mode | Always on | Based on API key prefix |
| Rollback | Simulated | Real reverse orders |
The UI uses a custom dark theme with CSS custom properties:
| Token | Value | Usage |
|---|---|---|
--bg |
#09090b |
Page background |
--surface |
#111113 |
Card backgrounds |
--primary |
#06b6d4 |
Pacifica brand (cyan) |
--migrate |
#3b82f6 |
Migration action (blue) |
--success |
#22c55e |
Positive PnL |
--loss |
#ef4444 |
Negative PnL |
--speed-gold |
#fbbf24 |
Fee savings highlight |
--competitor |
#f59e0b |
Source exchange (amber) |
Fonts: Inter (UI) + JetBrains Mono (data/numbers)
Competition: Pacifica Exchange Hackathon
Track: DeFi / Exchange Tooling
Core Thesis: Reduce TVL friction by making position migration instant, safe, and free β giving Pacifica a competitive acquisition channel for existing perp traders.
- TVL acquisition tool β removes the #1 barrier to switching exchanges
- Network effect β each migration adds liquidity to Pacifica's order books
- Fee incentive β savings calculator shows traders exactly how much they'd save annually
MIT Β© 2026 Edy Cu

