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.
Select → Teleport → Done. Positions fly from Binance to Pacifica with atomic delta-neutral execution. Zero market exposure, zero price risk.
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.coNEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-keyNote for Judges: The app runs fully in demo mode without any environment variables. All exchange credentials are mocked and sandbox mode is enforced. No accounts, API keys, or configuration needed — just
npm install && npm run dev.
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/
│ ├── ExchangeConnector.tsx # Exchange API key connection modal
│ ├── ExchangeLogo.tsx # Dynamic exchange logo renderer
│ ├── FeeSavingsCard.tsx # Annual fee savings calculator
│ ├── HeroSection.tsx # Landing hero with value prop
│ ├── MigrateButton.tsx # Animated migration trigger
│ ├── MigrationReceipt.tsx # Post-migration execution report
│ ├── PositionCard.tsx # Individual position display card
│ ├── PositionTable.tsx # Sortable position data table
│ └── SplitScreenMigration.tsx # Main 3-panel migration dashboard
├── 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 (logo, OpenAPI spec)
├── .env.example # Environment template for judges
├── 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
| Integration | File | Description |
|---|---|---|
| CCXT Exchange API | lib/exchange-client.ts | Unified trading client supporting Pacifica + 100 exchanges |
| Migration Engine | lib/migration-engine.ts | Delta-neutral swap with atomic rollback |
| Position Fetching | app/api/positions/route.ts | Live position data with real-time PnL |
| Migration Endpoint | app/api/migrate/route.ts | POST handler for executing position swaps |
| Fee Calculator | components/FeeSavingsCard.tsx | Annual savings comparison vs competitor fees |
MIT © 2026 Edy Cu


