> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galadriel.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Reselling GPU Time

> Recover costs by selling unused GPU time back to the marketplace

# Reselling GPU Time

Galadriel's **secondary market** allows you to resell unused GPU time when you finish your workload early. This unique feature helps you recover costs and creates additional liquidity in the marketplace.

## Why Resell?

**Common Scenario:**

* You bought 7 days of GPU time for model training
* Your model converged after 5 days
* You have 2 days of unused time remaining
* Terminating early gives you a refund, but reselling can earn you more

**Benefits:**

* 💰 **Recover more money** than just terminating
* ⏱️ **Help other users** get GPUs at discounted prices
* 🔄 **Create market liquidity** and efficiency
* ✅ **Seamless transfer** with zero downtime for buyer

## How It Works

### Overview

```
You (Original Buyer)          Marketplace          New Buyer
────────────────────          ───────────          ─────────

1. Buy 7 days @ $1.30/hr
   ↓
2. Use GPUs for 5 days
   ↓
3. List remaining 2 days
   @ $1.20/hr              →  Order added to
                               orderbook
                                    ↓
4. Buyer purchases                  ← Match occurs
   at $1.20/hr
   ↓                                ↓
5. Transfer scheduled         Transfer time:
   Your access ends           2025-11-12 14:00
   ↓                                ↓
6. Receive:                   Buyer gets:
   - Original refund          - Full node access
   - Resale proceeds          - Your remaining time
```

### Economics Example

```
Original Purchase:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Duration: 168h (7 days)
- GPUs: 16 H100
- Rate: $1.30/GPU/hr
- Total: 168h × 16 × $1.30 = $3,494.40

After 5 Days (120h used):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Remaining: 48h (2 days)
- Without reselling: Terminate and get refund

Option A: Just Terminate
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Refund: 48h × 16 × $1.30 = $998.40
Total recovered: $998.40

Option B: Resell at $1.20/GPU/hr
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Original refund:    48h × 16 × $1.30 = $998.40
Resale revenue:     48h × 16 × $1.20 = $460.80
Platform fee (10%):                    -$46.08
Net from resale:                       $414.72
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Total recovered: $998.40 + $414.72 = $1,413.12

Extra recovered by reselling: $414.72 ✨
```

## Creating a Resell Order

### CLI

Basic resell:

```bash theme={null}
galadriel lease resell lse_xyz123 --price 3.00
```

With specific transfer time:

```bash theme={null}
galadriel lease resell lse_xyz123 \
  --price 3.00 \
  --from "2025-11-12T14:00:00Z"
```

Transfer immediately (terminate your access now):

```bash theme={null}
galadriel lease resell lse_xyz123 \
  --price 3.00 \
  --transfer-now
```

### API

```http theme={null}
POST /api/v1/leases/lse_xyz123/resell
Authorization: Bearer <token>
Content-Type: application/json

{
  "limit_price": 3.00,
  "available_from": "2025-11-12T14:00:00Z",
  "available_until": null,
  "transfer_immediately": false
}
```

### SDK (Python)

```python theme={null}
from galadriel import Client

client = Client(api_token="your_token")

# Resell unused time
resell_order = client.leases.resell(
    lease_id="lse_xyz123",
    limit_price=3.00,
    available_from="2025-11-12T14:00:00Z"
)

print(f"Resell order ID: {resell_order.order_id}")
print(f"Potential recovery: ${resell_order.potential_recovery}")
print(f"Net recovery: ${resell_order.net_recovery} (after 10% fee)")
```

## Resell Order Responses

### Pending (Waiting for Buyer)

```
💰 Creating resell order for unused GPU time...
✓ Order ID: ord_resell123
✓ Lease: lse_xyz123 (16x H100 GPUs)
✓ Original price: $1.30/GPU/hr
✓ Resell price: $1.20/GPU/hr
✓ Time remaining: 48 hours (2 days)
✓ Potential recovery: $2,304.00
✓ After 10% platform fee: $1,958.40

📊 Your lease timeline:
  Now ────────────> 2025-11-12 14:00 ────────────> 2025-11-14 14:00
  │                 │                              │
  You keep using    Transfer to buyer             Original end
                    (if matched)

💡 Next steps:
  - Your order is live in the marketplace
  - Continue using GPUs until transfer time
  - You'll be notified when a buyer is matched
  - Check status: galadriel order get ord_resell123
```

### Immediately Matched

```
💰 Creating resell order for unused GPU time...
✓ Matched instantly!
✓ Buyer: ord_buyer789
✓ Sale amount: $2,304.00 (16 GPUs × 48h × $1.20)
✓ Platform fee (10%): -$345.60
✓ Net recovery: $1,958.40
✓ Original refund: $2,649.60 (from Galadriel)
✓ Total recovered: $4,608.00

🎉 Your unused GPU time has been sold!

⏰ Transfer scheduled for: 2025-11-12 14:00 UTC
   - Your access will be terminated at that time
   - Buyer will receive kubeconfig and SSH access
   - Funds will be credited to your account

📧 You'll receive:
   1. Confirmation email now
   2. Reminder 1 hour before transfer
   3. Transfer completion notification
```

## Transfer Process

### What Happens at Transfer Time

**1 Hour Before Transfer:**

```
⏰ Lease Transfer Reminder

Your lease lse_xyz123 will transfer in 1 hour:
- Transfer time: 2025-11-12 14:00 UTC
- New owner: Customer ord_buyer789
- Your access will be terminated

Action required:
- Save any important data
- Stop running jobs
- Your pods will be deleted at transfer time
```

**At Transfer Time (Automated):**

```
Step 1: Your access terminated
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- All your pods deleted
- Kubeconfig invalidated
- SSH access revoked
- Namespace cleaned up

Step 2: Buyer access granted
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- New namespace created
- Fresh kubeconfig generated
- SSH keys set up
- Full access to same nodes

Step 3: Financial settlement
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Original refund: $2,649.60 credited
- Resale proceeds: $1,958.40 credited
- Total: $4,608.00 in your account
```

## Pricing Strategies

### Pricing at Market Rate

List at current market price for quick sale:

```bash theme={null}
# Check current market price
galadriel orderbook --gpu-type h100 --zone us-west-1

# List at best ask price
galadriel lease resell lse_xyz123 --price 1.40
```

**Pros:**

* ✅ Quick sale (usually under 1 hour)
* ✅ Maximum recovery
* ✅ Less risk of not selling

**Cons:**

* ⚠️ May not sell if market drops

### Pricing Below Market (Discount)

List below market for guaranteed sale:

```bash theme={null}
# List 10% below market
galadriel lease resell lse_xyz123 --price 1.20  # if market is $1.30
```

**Pros:**

* ✅ Very quick sale (under 30 min)
* ✅ Still better than just terminating
* ✅ Helps market liquidity

**Cons:**

* ⚠️ Less total recovery

### Pricing Above Original Cost

List higher than what you paid (if market went up):

```bash theme={null}
# You paid $1.30, now market is $1.50
galadriel lease resell lse_xyz123 --price 1.45
```

**Pros:**

* ✅ Profit on resale
* ✅ Recover original cost + extra

**Cons:**

* ⚠️ May take longer to sell
* ⚠️ Risk market drops before sale

## Managing Resell Orders

### Check Resell Order Status

```bash theme={null}
galadriel order get ord_resell123
```

Output:

```
ORDER ID:       ord_resell123
TYPE:           limit (resell)
SIDE:           sell
LEASE ID:       lse_xyz123
GPU TYPE:       h100
GPU COUNT:      16
LIMIT PRICE:    $1.20/hr
STATUS:         pending
CREATED:        2h ago
TRANSFER TIME:  2025-11-12 14:00 UTC

POTENTIAL RECOVERY:
  Resale revenue:     $2,304.00
  Platform fee (10%): -$345.60
  Net recovery:       $1,958.40
  Original refund:    $2,649.60
  Total recovery:     $4,608.00

CURRENT MARKET:
  Best bid: $2.95/hr (close to your price!)
  Best ask: $3.70/hr
```

### Cancel Resell Order

If you change your mind before it's matched:

```bash theme={null}
galadriel order cancel ord_resell123
```

<Note>
  You can only cancel if the order hasn't been matched yet. Once matched, the transfer will proceed as scheduled.
</Note>

### Update Resell Price

Cancel and create a new order with different price:

```bash theme={null}
# Cancel existing
galadriel order cancel ord_resell123

# Create new with different price
galadriel lease resell lse_xyz123 --price 3.20
```

## Edge Cases & FAQs

<AccordionGroup>
  <Accordion title="What if my resell order doesn't match before transfer time?">
    If your resell order doesn't match by the transfer time (`available_from`), it will be automatically cancelled. Your lease continues until the original end time. You keep using the GPUs as normal.

    You can:

    * Create a new resell order with different pricing
    * Continue using until original lease end
    * Terminate early for a refund
  </Accordion>

  <Accordion title="Can I continue using GPUs while listed for resale?">
    **Yes!** You maintain full access until the transfer time. The resell order just makes your unused time available for future purchase.

    Your timeline:

    ```
    Now ──────────────> Transfer Time ─────────> Original End
    │                   │                         │
    Full access         Transfer happens         Would have ended
    (working normally)  (if matched)
    ```
  </Accordion>

  <Accordion title="What happens to my running pods at transfer?">
    At transfer time, all your pods are **automatically deleted**. The buyer gets clean nodes.

    **Best practice:**

    * Save checkpoints before transfer time
    * Set `available_from` to when you're actually done
    * Don't schedule critical jobs near transfer time
  </Accordion>

  <Accordion title="Can I cancel after the order is matched?">
    **No.** Once matched, the transfer is committed. The buyer has already paid, and the transaction cannot be reversed.

    You will receive:

    * 1 hour warning before transfer
    * Final notification at transfer

    Make sure you're ready to give up access before creating the resell order.
  </Accordion>

  <Accordion title="What if I want to transfer immediately?">
    Use the `--transfer-now` flag:

    ```bash theme={null}
    galadriel lease resell lse_xyz123 --price 3.00 --transfer-now
    ```

    This sets `available_from` to NOW, meaning if a buyer matches, the transfer happens immediately. Your access is terminated right away.

    Use this when:

    * You're completely done with the GPUs
    * Want to maximize recovery ASAP
    * Don't need gradual transition
  </Accordion>

  <Accordion title="Do I get the original refund AND resale proceeds?">
    **Yes!** This is the key benefit of reselling.

    You receive:

    1. **Original refund** from Galadriel for unused time at your purchase price
    2. **Net resale proceeds** from the buyer (their payment minus 15% fee)

    Total recovery = Original refund + Net resale proceeds
  </Accordion>

  <Accordion title="What if market price drops below my listing?">
    Your order won't match until:

    * Market price rises to your listing price, OR
    * You cancel and relist at a lower price

    If it doesn't match by transfer time, the order is automatically cancelled and you keep the GPUs until original lease end.
  </Accordion>

  <Accordion title="Can the buyer see my data or workloads?">
    **No.** At transfer time:

    * All your pods are deleted
    * Namespace is destroyed
    * Nodes are cleaned (tmp files removed)
    * Buyer gets fresh, clean nodes

    **However**, if you stored data in persistent volumes or node-local directories, you should clean those up yourself before transfer.
  </Accordion>
</AccordionGroup>

## Best Practices

### 1. Price Competitively

Check the orderbook before listing:

```bash theme={null}
galadriel orderbook --gpu-type h100 --zone us-west-1
```

List at or slightly below best ask for quick sale.

### 2. Set Realistic Transfer Times

Don't set `available_from` too soon if you're still working:

```bash theme={null}
# Good: Giving yourself buffer
galadriel lease resell lse_xyz123 \
  --price 3.00 \
  --from "2025-11-12T14:00:00Z"  # 6 hours from now

# Risky: Too soon, might still be working
galadriel lease resell lse_xyz123 \
  --price 3.00 \
  --from "2025-11-12T08:30:00Z"  # 30 min from now
```

### 3. Save Checkpoints

Before transfer time:

* Save model checkpoints
* Export important data
* Document your setup (for future reference)

### 4. Monitor Market Conditions

If listing for a while:

```bash theme={null}
# Check if market moved
galadriel prices --gpu-type h100 --zone us-west-1 --days 1

# Adjust price if needed
galadriel order cancel ord_resell123
galadriel lease resell lse_xyz123 --price 3.20  # new price
```

### 5. Plan Transfer Time

Choose transfer times strategically:

* **Peak hours** (9am-6pm): More buyers, better chance of matching
* **Off-peak** (nights): Fewer buyers, but lower competition
* **Weekends**: Moderate activity

## Real-World Example

**Scenario: Training a 70B LLM**

```bash theme={null}
# Day 1: Purchase GPUs
galadriel order buy \
  --gpu-type h100 \
  --gpus 16 \
  --duration 168h \
  --price 3.45 \
  --zone us-west-1

# Cost: 168h × 16 × $1.30 = $9,273.60

# Days 1-5: Training
kubectl apply -f llm-training.yaml
# ... training runs ...

# Day 5: Model converged! 🎉
# Check remaining time
galadriel get lse_xyz123
# Shows: 48h remaining (2 days)

# Day 5: List unused time for resale
galadriel lease resell lse_xyz123 \
  --price 3.00 \
  --from "2025-11-12T18:00:00Z"  # 2 hours from now

# Hour later: Matched!
# Transfer at 18:00 UTC
# Pods automatically cleaned up
# Buyer gets access

# Final accounting:
# - Used: 120h × 16 × $1.30 = $6,624.00 (actual cost)
# - Original refund: $2,649.60
# - Resale recovery: $1,958.40
# - Total back: $4,608.00
# - Net cost: $6,624.00 - $4,608.00 = $2,016.00
#
# Effective rate: $2,016 ÷ (120h × 16) = $1.05/GPU/hr
# Saved: $4,608.00 compared to no reselling! 💰
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Pricing Guide" icon="dollar-sign" href="/marketplace/pricing">
    Learn more cost optimization strategies
  </Card>

  <Card title="How the Marketplace Works" icon="scale-balanced" href="/marketplace/how-it-works">
    Understand orderbooks and matching
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference">
    Resell API documentation
  </Card>

  <Card title="Examples" icon="book" href="/examples">
    See real-world reselling examples
  </Card>
</CardGroup>
