Bids and Leases

How does the Marketplace work?

The Akash Marketplace revolves around Deployments, which fully describe the resources that a tenant is requesting from the network. Deployments contain Groups, which is a grouping of resources that are meant to be leased together from a single provider.

Deploying applications onto Akash involves two types of users:

  1. The Tenant: the entity that deploys the application.
  2. The Provider: the entity that hosts the application.

What is a Reverse Auction?

Akash uses a reverse auction. Tenants set the price and terms of their deployment, and the Cloud providers bid on the deployments.

In a very simple reverse auction:

  1. A tenant creates orders.
  2. Providers bid on orders.
  3. Tenants choose winning bids and create leases.

Akash Deployment Lifecycle

The lifecycle of a typical application deployment is as follows:

  1. The tenant creates a .yml file made up of SDL markup which describes the resources needed to run their application. This is known as a deployment.
  2. The tenant submits that definition to the blockchain.
  3. Their submission generates an order on the marketplace.
  4. Providers that would like to fulfill that order bid on it.
  5. After some period of time, a winning bid for the order is chosen, and a lease is created.
  6. Once a lease has been created, the tenant submits a manifest to the provider.
  7. The provider executes workloads as instructed by the manifest.
  8. The workload is running - if it is a web application it can be visited
  9. The provider or tenant eventually closes the lease, shutting down the workload.

Payments

Leases are paid from deployment owner (tenant) to the provider through a deposit and withdraw mechanism.

Tenants are required to submit a deposit when creating a deployment. Leases will be paid passively from the balance of this deposit. At any time, a lease provider may withdraw the balance owed to them from this deposit.

If the available funds in the deposit ever reaches zero, a provider may close the lease, therefore a tenant who wishes to keep a lease alive must add funds to their deposit as this ensures that their lease does not end prematurely. When a deployment is closed, the unspent portion of the balance will be returned to the tenant.

Escrow Accounts

Escrow accounts are a mechanism that allows for time-based payments from one account to another without block-by-block micropayments. They also support holding funds for an account until an arbitrary event occurs.

Escrow accounts are necessary in Akash for two primary reasons:

  1. Leases in Akash are priced in blocks - every new block, a payment from the tenant (deployment owner) to the provider (lease holder) is due. Performance and security considerations prohibit the naive approach of transferring tokens on every block.
  2. Bidding on an order should not be free (for various reasons, including performance and security). Akash requires a deposit for every bid. The deposit is returned to the bidder when the bid is closed.

Bid Deposits

Bidding on an order requires a deposit to be made. The deposit will be returned to the provider account when the bid transitions to state CLOSED.

Bid deposits are implemented with an escrow account module. See here for more information.

Audited Attributes

Audited attributes allow users deploying applications to be more selective about which providers can run their apps. Anyone on the Akash Network can assign these attributes to Providers via an on-chain transaction.

On-Chain Parameters

NameInitial ValueDescription
deployment_min_deposit0.5aktMinimum deposit to make deployments. Target: ~$2.2
bid_min_deposit0.5aktDeposit amount required to bid. Target: ~$2.2

Transactions

DeploymentCreate

Creates a deployment, and open groups and orders for it.

Parameters

NameDescription
DeploymentIDID of Deployment.
DepositAmountDeposit amount. Must be greater than deployment_min_deposit.
VersionHash of the manifest that is sent to the providers.
GroupsA list of group descriptions.

DeploymentDeposit

Add funds to a deployment’s balance.

Parameters

NameDescription
DeploymentIDID of Deployment.
DepositAmountDeposit amount. Must be greater than deployment_min_deposit

GroupClose

Closes a group and any orders for it. Sent by the tenant.

Parameters

NameDescription
IDID of Group.

GroupPause

Puts a PAUSED state, and closes any and orders for it. Sent by the tenant.

Parameters

NameDescription
IDID of Group.

GroupStart

Transitions a group from state PAUSED to state OPEN. Sent by the tenant.

Parameters

NameDescription
IDID of Group.

BidCreate

Sent by a provider to bid on an open order. The required deposit will be returned when the bid transitions to state CLOSED.

Parameters

namedescription
OrderIDID of Order
TTLNumber of blocks this bid is valid for
DepositDeposit amount. bid_min_deposit if empty.

BidClose

Sent by provider to close a bid or a lease from an existing bid.

When closing a lease, the bid’s group will be put in state PAUSED.

Parameters

namedescription
BidIDID of Bid

State Transitions

ObjectPrevious StateNew State
BidACTIVECLOSED
LeaseACTIVECLOSED
OrderACTIVECLOSED
GroupOPENPAUSED

LeaseCreate

Sent by tenant to create a lease.

  1. Creates a Lease from the given bid.
  2. Sets all non-winning bids to state CLOSED (deposit returned).

Parameters

namedescription
BidIDBid to create a lease from

MarketWithdraw

This withdraws balances earned by providing for leases and deposits of bids that have expired.

Parameters

namedescription
OwnerProvider ID to withdraw funds for.

Models

Deployment

NameDescription
ID.Owneraccount address of tenant
ID.DSeqArbitrary sequence number that identifies the deployment. Defaults to block height.
StateState of the deployment.
VersionHash of the manifest that is sent to the providers.

State

NameDescription
OPENOrders may be created.
CLOSEDAll groups are closed. Terminal.

Group

NameDescription
ID.DeploymentIDDeployment ID of group.
ID.GSeqArbitrary sequence number. Internally incremented, starting at 1.
StateState of the group.

State

NameDescription
OPENHas an open or active order.
PAUSEDBid closed by provider. May be restarted.
CLOSEDNo open or active orders. Terminal.

Order

NameDescription
ID.GroupIDGroup ID of group.
ID.OSeqArbitrary sequence number. Internally incremented, starting at 1.
StateState of the order.

State

NameDescription
OPENAccepting bids.
ACTIVEOpen lease has been created.
CLOSEDNo active leases and not accepting bids. Terminal.

Bid

NameDescription
ID.OrderIDGroup ID of group.
ID.ProviderAccount address of provider.
StateState of the bid.
EndsOnHeight at which the bid ends if it is not already matched.
PriceBid price - amount to be paid on every block.

State

NameDescription
OPENAwaiting matching.
ACTIVEBid for an active lease (winner).
CLOSEDNo active leases for this bid. Terminal.

Lease

NameDescription
IDThe same as the bid ID for the lease.
StateState of the bid.

State

NameDescription
ACTIVEActive lease - tenant is paying provider on every block.
CLOSEDNo payments being made. Terminal.
footer-logo-dark

© Akash Network 2024 The Akash Network Authors Documentation Distributed under CC BY 4.0

Open-source Apache 2.0 Licensed.

GitHub v0.20.0

Privacy