This page has not been updated yet for BIP-29, which introduced dynamic pricing functions on the Pod Market. The Marketplace Facet page is up to date.
The Market will house various DEXs for zero fee trading. For now, there is only the Pod Market, but in the future there may be a zero fee AMM, a zero fee NFT marketplace, etc.
The Pod Market allows Farmers to create, Fill and Cancel Pod Listings and Pod Orders.
Farmers with Pods can create Pod Listings, which allow other Farmers to buy part or all of their Plots at a given price.
Pod Listings are contained in the following struct:
Pod Listings are created with the createPodListing
function. Pod Listings can only be created by the owner of the Plot being listed.
When a Pod Listing is created, The PodListing
struct with the exception of account
and index
is encoded and hashed. Beanstalk stores the hash of the listing on-chain in the s.podListings
state mapping. Pod Listing hashes are stored by index of the corresponding Plot. The Pod Listing struct is emitted in an event upon creation.
Pod Listings are Filled with the fillPodListing
function. The Pod buyer is required to input the PodListing
struct associated with the Plot being transferred. Beanstalk hashes the PodListing
data and verifies that the hash is the same as the hash in storage at the corresponding index. If the original Plot owner no longer owns the Plot, then the transaction will fail. If the Fill is successful, Beanstalk then transfers the corresponding part of the Plot to the buyer in exchange for Beans. If the Listing is not empty, the updated Listing is then hashed and stored on-chain.
Pod Listings can be Cancelled at any time with the cancelPodListing
function. Pod Listings are automatically Cancelled on Harvest, Transfer or if a new Pod Listing is created with the same plot.
Pod Orders allow Farmer with Beans to create Orders to buy Plots. An Order specifies a max Place in Line that the Farmer is will to buy Pods at, the price they are willing to by Pods at and the amount they are willing to buy. All Orders are denominated in Beans. Pod Orders are contained in the following struct:
Pod Orders are created with the createPodOrder
function. Pod Orders can be created by any Farmer.
When a Pod Order is created, The PodOrder
struct is encoded and hashed. Beanstalk stores the hash of the Order on-chain in the s.podOrders
state mapping. The hash is the key in the mapping and the amount in the Order is stored in the hash. When a Pod Order is created, Beans are transferred from the Farmer to Beanstalk equal to the amount of Pods being bought times the Price per Pod in the Order. These Beans are locked in Beanstalk until either the Pod Order creator Cancels the Order or the Order is Filled.
Farmers with Pods can sell Pods to open Pod Orders with the fillPodOrder
function. The Pod seller is required to input what part of which Plot is being sold and the PodOrder
struct associated with Order they are filling. Beanstalk hashes the PodOrder
data and verifies that the hash maps to a non-zero value in s.podOrders
. The seller is also required to input the Plot being sold as a part of the calldata. If the Fill is successful, the value at the hash key is updated to equal the new amount remaining in the Pod Order.
Pod Orders can be Cancelled at anytime with the cancelPodOrder
function. When an Order is Cancelled, Beanstalk returns the remaining Beans in the Pod Order to the Farmer.
The Marketplace Facet handles logic for buying and selling Pods on the Pod Market.
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
index
uint256
WIP
start
uint256
WIP
amount
uint256
WIP
pricePerPod
uint24
WIP
maxHarvestableIndex
uint256
WIP
minFillAmount
uint256
WIP
mode
To
WIP
index
uint256
WIP
start
uint256
WIP
amount
uint256
WIP
maxHarvestableIndex
uint256
WIP
minFillAmount
uint256
WIP
pricingFunction
bytes
WIP
mode
To
WIP
l
PodListing
WIP
beanAmount
uint256
WIP
mode
From
WIP
l
PodListing
WIP
beanAmount
uint256
WIP
pricingFunction
bytes
WIP
mode
From
WIP
index
uint256
WIP
beanAmount
uint256
WIP
pricePerPod
uint24
WIP
maxPlaceInLine
uint256
WIP
minFillAmount
uint256
WIP
mode
From
WIP
id
bytes32
WIP
beanAmount
uint256
WIP
maxPlaceInLine
uint256
WIP
minFillAmount
uint256
WIP
pricingFunction
bytes
WIP
mode
From
WIP
id
bytes32
WIP
o
PodOrder
WIP
index
uint256
WIP
start
uint256
WIP
amount
uint256
WIP
mode
To
WIP
o
PodOrder
WIP
index
uint256
WIP
start
uint256
WIP
amount
uint256
WIP
pricingFunction
bytes
WIP
mode
To
WIP
pricePerPod
uint24
WIP
maxPlaceInLine
uint256
WIP
minFillAmount
uint256
WIP
mode
To
WIP
maxPlaceInLine
uint256
WIP
minFillAmount
uint256
WIP
pricingFunction
bytes
WIP
mode
To
WIP
sender
address
WIP
recipient
address
WIP
id
uint256
WIP
start
uint256
WIP
end
uint256
WIP
spender
address
WIP
amount
uint256
WIP
placeInLine
uint256
WIP
podListingAmount
uint256
WIP
fillBeanAmount
uint256
WIP
pricingFunction
bytes
WIP
amount
uint256
WIP
placeInLine
uint256
WIP
amountPodsFromOrder
uint256
WIP
pricingFunction
bytes
WIP
beanAmount
uint256
WIP
account
address
WIP
pricePerPod
uint24
WIP
maxPlaceInLine
uint256
WIP
minFillAmount
uint256
WIP
uint256
WIP
account
address
WIP
maxPlaceInLine
uint256
WIP
minFillAmount
uint256
WIP
pricingFunction
bytes
WIP
uint256
WIP
id
bytes32
WIP
uint256
WIP
index
uint256
WIP
bytes32
WIP
owner
address
WIP
spender
address
WIP
uint256
WIP
account
address
WIP
index
uint256
WIP
start
uint256
WIP
amount
uint256
WIP
pricePerPod
uint24
WIP
maxHarvestableIndex
uint256
WIP
minFillAmount
uint256
WIP
pricingFunction
bytes
WIP
mode
To
WIP
pricingType
PriceType
WIP
from
address
WIP
to
address
WIP
index
uint256
WIP
start
uint256
WIP
amount
uint256
WIP
costInBeans
uint256
WIP
account
address
WIP
index
uint256
WIP
account
address
WIP
id
bytes32
WIP
amount
uint256
WIP
pricePerPod
uint24
WIP
maxPlaceInLine
uint256
WIP
minFillAmount
uint256
WIP
pricingFunction
bytes
WIP
priceType
PriceType
WIP
from
address
WIP
to
address
WIP
id
bytes32
WIP
index
uint256
WIP
start
uint256
WIP
amount
uint256
WIP
costInBeans
uint256
WIP
account
address
WIP
id
bytes32
WIP
from
address
WIP
to
address
WIP
id
uint256
WIP
pods
uint256
WIP
owner
address
WIP
spender
address
WIP
pods
uint256
WIP